From owner-freebsd-bugs@FreeBSD.ORG Sat May 9 13:30:03 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B7CC1065670 for ; Sat, 9 May 2009 13:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id EA8E18FC19 for ; Sat, 9 May 2009 13:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n49DU2a2080226 for ; Sat, 9 May 2009 13:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n49DU2oq080223; Sat, 9 May 2009 13:30:02 GMT (envelope-from gnats) Resent-Date: Sat, 9 May 2009 13:30:02 GMT Resent-Message-Id: <200905091330.n49DU2oq080223@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Thiago Damas Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 095C3106564A for ; Sat, 9 May 2009 13:25:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id EBA618FC16 for ; Sat, 9 May 2009 13:25:37 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n49DPbW8084122 for ; Sat, 9 May 2009 13:25:37 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n49DPbBm084080; Sat, 9 May 2009 13:25:37 GMT (envelope-from nobody) Message-Id: <200905091325.n49DPbBm084080@www.freebsd.org> Date: Sat, 9 May 2009 13:25:37 GMT From: Thiago Damas To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/134389: phttpget opens a new connections for every file fetched via proxy X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2009 13:30:03 -0000 >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: