misc/134389: phttpget opens a new connections for every file
fetched via proxy
Thiago Damas
tdamas at gmail.com
Sat May 9 13:30:03 UTC 2009
>Number: 134389
>Category: misc
>Synopsis: phttpget opens a new connections for every file fetched via proxy
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat May 09 13:30:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Thiago Damas
>Release: 7.2-RELEASE
>Organization:
>Environment:
FreeBSD mx1.vetorial.net 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May 1 07:18:07 UTC 2009 root at driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
When using portsnap/freebsd-update with a proxy configured (via HTTP_PROXY env variable), phttpget opens a new connections for every file fetched, ignoring "Connection: keep-alive"
>How-To-Repeat:
Using portsnap/freebsd-update and doing sockstat -4c | grep phttpget
>Fix:
I made a patch for phttpget:
--- /usr/src/usr.sbin/portsnap/phttpget/phttpget.c 2009-04-15
00:14:26.000000000 -0300
+++ /root/src/portsnap/phttpget/phttpget.c 2009-05-08
11:03:36.000000000 -0300
@@ -520,6 +520,17 @@
continue;
}
+ if(env_HTTP_PROXY && strncasecmp(hln,
"Proxy-Connection:", 17) == 0) {
+ hln += 17;
+ if (strcasestr(hln, "close") != NULL)
+ pipelined = 0;
+ if (strcasestr(hln, "Keep-Alive") != NULL)
+ keepalive = 1;
+
+ /* Next header... */
+ continue;
+ }
+
/* Check for "Content-Length:" header */
if (strncasecmp(hln, "Content-Length:", 15) == 0) {
hln += 15;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list