On Tue, Oct 23, 2007 at 06:11:06PM +0200, Ralph Roessner wrote:
> Not only does it seem excessive but the $sock->peerhost in the following
> test will return the proxy, not the target, thus breaking the test.
> 

Not sure about that. The point of the test is *not* to optimise an
unreachable host away early.  I put this bit of code in as a fix for
bugs like  #387449 and #413391 which were caused by not distinguishing
between absolute URLs which are proxy requests in HTTP 1.1 and almost
universal in HTTP 1.3 as spoken by recent versions of apt.

GET http://locahost/debian/... needs to be converted to a relative URL,
ie GET /debian/...

GET http://remotehost/debian needs to be passed complete (ie just http://
removed here, but added back in fetch_store())

If we don't do this right we get circular requests in the first of these
cases and a hang if the cache doesn't have the file.

> Sending a negative response to the client at this point looks like an
> optimization, the test does not require it. Maybe it would be best to
> silently ignore a connection error at this point in the code, i.e. jump over
> the hostname comparison and $sock->shutdown part, and ignore the whole
> use_proxy or not use_proxy issue.

Maybe, it just seems silly to continue if we know a host is not
reachable.

More thought required....

Mark



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to