ports/147904: [PATCH] www/p5-AnyEvent-HTTP: add patch for fastclose bug

Maxim Dounin mdounin at mdounin.ru
Wed Jun 16 11:50:02 UTC 2010


>Number:         147904
>Category:       ports
>Synopsis:       [PATCH] www/p5-AnyEvent-HTTP: add patch for fastclose bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 16 11:50:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Maxim Dounin
>Release:        FreeBSD 7.2-RELEASE-p6 i386
>Organization:
>Environment:
System: FreeBSD mdounin.cust.ramtel.ru 7.2-RELEASE-p6 FreeBSD 7.2-RELEASE-p6 #3: Fri Jan  8 06:37:37 MSK
>Description:
The following patch fixes die in AnyEvent::HTTP which happens when remote
server closes connection right after it's established.  This patch was
submitted upstream several months ago but there is no reaction.  Please
consider adding it to FreeBSD ports tree.

Added file(s):
- files/patch-fastclose

Port maintainer (vovkasm at gmail.com) is cc'd.
>How-To-Repeat:
>Fix:

--- p5-AnyEvent-HTTP-1.44,1.patch begins here ---
Index: files/patch-fastclose
===================================================================
RCS file: files/patch-fastclose
diff -N files/patch-fastclose
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-fastclose	16 Jun 2010 11:36:31 -0000
@@ -0,0 +1,20 @@
+Don't die on errors in push_write().
+
+During processing of push_write() error may happen (e.g. EPIPE due to
+connection close by server).  This will result in callbacks called and
+%state cleared.  Avoid doing push_read() on undefined $state{handle} if
+it happens.
+
+diff --git a/HTTP.pm b/HTTP.pm
+--- HTTP.pm
++++ HTTP.pm
+@@ -498,6 +498,9 @@ sub http_request($$@) {
+ 
+             %hdr = (); # reduce memory usage, save a kitten
+ 
++            # return if error happened during push_write()
++            return unless $state{handle};
++
+             # status line
+             $state{handle}->push_read (line => $qr_nl, sub {
+                $_[1] =~ /^HTTP\/([0-9\.]+) \s+ ([0-9]{3}) (?: \s+ ([^\015\012]*) )?/ix
--- p5-AnyEvent-HTTP-1.44,1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list