Bug 32238

Summary: /stand/sysinstall breaks when installing across Cacheflow HTTP proxies
Product: Base System Reporter: Christoph Weber-Fahr <christoph.weber-fahr>
Component: binAssignee: matusita
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.4-RELEASE   
Hardware: Any   
OS: Any   

Description Christoph Weber-Fahr 2001-11-24 03:40:01 UTC
Apparently Cacheflow Webcaches burp (*) when getting a HEAD-request for a ftp:// url. Since sysinstall checks the install site by issuing HEAD requests when using a HTTP proxy, it refuses to install

(*) "burp" means closing the connection immediately without answer. Yes, I know that's completely against any rfc, but the machines are out there

Fix: Replace HEAD with GET. Tested that, works.



msgNotify("Checking access to\n %s", variable_get(VAR_HTTP_PATH));
-    sprintf(req,"HEAD %s/ HTTP/1.0\r\n\r\n", variable_get(VAR_HTTP_PATH));
+    sprintf(req,"GET %s/ HTTP/1.0\r\n\r\n", variable_get(VAR_HTTP_PATH));
     write(s,req,strlen(req));
 /*
  *  scan the headers of the response
  *  this is extremely quick'n dirty--6JowTqxYym1QmWyCeuaTPZYBSm9Ot1aQcVoFOTcY5EY0gBo8
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- /usr/src/release/sysinstall/http.c.orig     Sat Nov 24 05:00:07 2001
+++ /usr/src/release/sysinstall/http.c  Sat Nov 24 05:21:18 2001
@@ -57,9 +57,9 @@
        return TRUE;
     }
How-To-Repeat: wefa@xxxxx 3:54 [~] telnet xx.xx.xx.xxx 8000
Trying xx.xx.xx.xx...
Connected to wwwproxy-ffm....
Escape character is '^]'.
HEAD ftp://ftp.de.freebsd.org/pub/ HTTP/1.0

Connection closed by foreign host.
wefa@xxxxx 3:55 [~]

(if you want to test this I can give you access to such 
a machine upon request)
Comment 1 Makoto Matsushita 2001-11-24 17:40:57 UTC
> Apparently Cacheflow Webcaches burp (*) when getting a HEAD-request
> for a ftp:// url. Since sysinstall checks the install site by
> issuing HEAD requests when using a HTTP proxy, it refuses to install

This part uses 'GET' request to verify, but PR: 21449, and its
associated commit, http.c rev 1.4, changes to 'HEAD'.

I can't read from this PR that why s/GET/HEAD/ change was occured, but
I'm afraid that there are some meanings and can't be changed back to
'GET'.  The PR: 21449 submitter, p@i609.hadiko.de, would you please
explain the details?

-- -
Makoto `MAR' Matsushita
Comment 2 matusita freebsd_committer freebsd_triage 2001-11-24 17:41:26 UTC
State Changed
From-To: open->feedback

In src/usr.sbin/sysinstall/http.c rev 1.4, 'GET' method was 
changed to 'HEAD' request, according to the associated PR: 21449. 

I've sent the previous PR submitter why this change is required. 


Comment 3 matusita freebsd_committer freebsd_triage 2001-11-24 17:41:26 UTC
Responsible Changed
From-To: freebsd-bugs->matusita

I'm willing to handle this.
Comment 4 Philipp Mergenthaler 2001-11-24 18:24:21 UTC
On Sun, Nov 25, 2001 at 02:40:57AM +0900, Makoto Matsushita wrote:
> 
> > Apparently Cacheflow Webcaches burp (*) when getting a HEAD-request
> > for a ftp:// url. Since sysinstall checks the install site by
> > issuing HEAD requests when using a HTTP proxy, it refuses to install
> 
> This part uses 'GET' request to verify, but PR: 21449, and its
> associated commit, http.c rev 1.4, changes to 'HEAD'.
> 
> I can't read from this PR that why s/GET/HEAD/ change was occured, but
> I'm afraid that there are some meanings and can't be changed back to
> 'GET'.  The PR: 21449 submitter, p@i609.hadiko.de, would you please
> explain the details?

Sorry, I should have mentioned this in the PR: this request only
checks whether host and path are ok and doesn't need the file's
content.  Therefore I thought a 'HEAD' would be more appropriate
than a 'GET' and possibly easier on the server's resources.
Of course, it doesn't make much difference compared to a complete
FreeBSD install. :-)

Changing back to 'GET' is absolutely ok.

Bye, Philipp
Comment 5 Makoto Matsushita 2001-11-24 19:30:19 UTC
philipp.mergenthaler>  Of course, it doesn't make much difference
philipp.mergenthaler>  compared to a complete FreeBSD install. :-)
philipp.mergenthaler>  
philipp.mergenthaler>  Changing back to 'GET' is absolutely ok.

Glad to hear that.  Thank you!

I would like to commit this PR's patch, but http.c lacks copyright
notice. I believe you are the person who submited PR: 11316; would you
please send me your (BSD-style) copyright notice, just like other
sysinstall source codes?  I want to include your copyright notice, add
FreeBSD: CVSID, then commit it.

-- -
Makoto `MAR' Matsushita
Comment 6 Makoto Matsushita 2001-11-25 00:54:22 UTC
philipp.mergenthaler>  Of course, it doesn't make much difference
philipp.mergenthaler>  compared to a complete FreeBSD install. :-)
philipp.mergenthaler>  
philipp.mergenthaler>  Changing back to 'GET' is absolutely ok.

Glad to hear that.  I've applied a patch for changing back to 'GET' for
HEAD branch.  RELENG_4 will be changed in a week later.

-- -
Makoto `MAR' Matsushita
Comment 7 matusita freebsd_committer freebsd_triage 2001-12-01 15:01:01 UTC
State Changed
From-To: feedback->closed

Patch commited to src/usr.sbin/sysinstall/http.c rev 1.6 and 
src/release/sysinstall/http.c rev 1.2.2.4.  Thanks!