From: Alex Rousskov Date: Thu, 24 Jan 2013 16:22:45 +0000 (-0700) Subject: Bug 3111: Mid-term fix for the forward.cc "err" assertion. X-Git-Tag: SQUID_3_4_0_1~351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a04b7e6ed8bf69e6afdb9954287b12eece98d926;p=thirdparty%2Fsquid.git Bug 3111: Mid-term fix for the forward.cc "err" assertion. The assert is triggered when a close handler for the server connection destroys FwdState before we have received anything from the origin server. Instead of asserting, we now respond with a 502 (Bad Gateway) ERR_READ_ERROR. That error seems the most appropriate single choice among available ones, but it may be misleading (in access.log) when the close handler was called due to client problems. Hopefully, another error will be logged in most of those cases. --- diff --git a/src/forward.cc b/src/forward.cc index 434969bd25..084855b568 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -223,6 +223,8 @@ FwdState::completed() if (entry->store_status == STORE_PENDING) { if (entry->isEmpty()) { + if (!err) // we quit (e.g., fd closed) before an error or content + fail(new ErrorState(ERR_READ_ERROR, HTTP_BAD_GATEWAY, request)); assert(err); errorAppendEntry(entry, err); err = NULL;