Bug 134389 - portsnap(8): phttpget opens a new connections for every file fetched via proxy
Summary: portsnap(8): phttpget opens a new connections for every file fetched via proxy
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 7.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-09 14:30 UTC by Thiago Damas
Modified: 2017-12-31 22:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Damas 2009-05-09 14:30:02 UTC
  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"

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;
How-To-Repeat:   Using portsnap/freebsd-update and doing sockstat -4c | grep phttpget
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-05-09 14:47:30 UTC
Responsible Changed
From-To: freebsd-bugs->cperciva

Over to maintainer.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:53 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped