Date: Sat, 9 May 2009 13:25:37 GMT From: Thiago Damas <tdamas@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/134389: phttpget opens a new connections for every file fetched via proxy Message-ID: <200905091325.n49DPbBm084080@www.freebsd.org> Resent-Message-ID: <200905091330.n49DU2oq080223@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905091325.n49DPbBm084080>