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.

Although it looks a bit clumsy, I still like my originally proposed patch
best. The real purpose - as I understand it - of the passage is to find out
whether or not the requested host name is local (and the ports match). I
think we can assume that connections from the apt-cacher to itself will
never fail. So we get:

  connection ok & hosts/ports match       --> serve request locally
  connection ok & hosts/ports don't match --> proxy request
  connection failed                       --> proxy request

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.

Ralph



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

Reply via email to