From efbfce77432c84049ce5bb94f18c2a7ec8eb4991 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 1 Apr 2011 15:04:29 +1300 Subject: [PATCH] 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. --- src/tunnel.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.47.3