From: Amos Jeffries Date: Fri, 1 Apr 2011 02:04:29 +0000 (+1300) Subject: Bug 3007 (extra): Set 500 status on peer proxy connection failure X-Git-Tag: take06~27^2~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efbfce77432c84049ce5bb94f18c2a7ec8eb4991;p=thirdparty%2Fsquid.git Bug 3007 (extra): Set 500 status on peer proxy connection failure rev11299 avoided 000 status, but ignores the error cases and always sends 200 success. TODO: Proper handling of the error cases to allow peer failovers is now possible but not included in the scope of this patch. --- diff --git a/src/tunnel.cc b/src/tunnel.cc index 8d409913a7..0ae00b6d1e 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -524,7 +524,10 @@ tunnelProxyConnectedWriteDone(int fd, char *buf, size_t size, comm_err_t flag, i { TunnelStateData *tunnelState = static_cast(data); debugs(26, 3, HERE << "FD " << fd << " tunnelState=" << tunnelState); - *tunnelState->status_ptr = HTTP_OK; + if (flag == COMM_OK) + *tunnelState->status_ptr = HTTP_OK; + else + *tunnelState->status_ptr = HTTP_INTERNAL_SERVER_ERROR; tunnelConnectedWriteDone(fd, buf, size, flag, xerrno, data); }