From: Amos Jeffries Date: Fri, 29 Jan 2010 11:23:57 +0000 (+1300) Subject: Add warnings explaining Invalid Response errors generated by Squid X-Git-Tag: SQUID_3_1_0_16~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14277fa0528a466c895b9ec2d20a3d7268f4d562;p=thirdparty%2Fsquid.git Add warnings explaining Invalid Response errors generated by Squid --- diff --git a/src/http.cc b/src/http.cc index ae9f07effc..fc11d6d0c4 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1150,6 +1150,7 @@ HttpStateData::continueAfterParsingHeader() const http_status s = vrep->sline.status; const HttpVersion &v = vrep->sline.version; if (s == HTTP_INVALID_HEADER && v != HttpVersion(0,9)) { + debugs(11, DBG_IMPORTANT, "WARNING: HTTP: Invalid Response: Bad header encountered from " << entry->url() << " AKA " << orig_request->GetHost() << orig_request->urlpath.termedBuf() ); error = ERR_INVALID_RESP; } else if (s == HTTP_HEADER_TOO_LARGE) { fwd->dontRetry(true); @@ -1159,12 +1160,18 @@ HttpStateData::continueAfterParsingHeader() } } else { // parsed headers but got no reply + debugs(11, DBG_IMPORTANT, "WARNING: HTTP: Invalid Response: No reply at all for " << entry->url() << " AKA " << orig_request->GetHost() << orig_request->urlpath.termedBuf() ); error = ERR_INVALID_RESP; } } else { assert(eof); - error = readBuf->hasContent() ? - ERR_INVALID_RESP : ERR_ZERO_SIZE_OBJECT; + if (readBuf->hasContent()) { + error = ERR_INVALID_RESP; + debugs(11, DBG_IMPORTANT, "WARNING: HTTP: Invalid Response: Headers did not parse at all for " << entry->url() << " AKA " << orig_request->GetHost() << orig_request->urlpath.termedBuf() ); + } else { + error = ERR_ZERO_SIZE_OBJECT; + debugs(11, DBG_IMPORTANT, "WARNING: HTTP: Invalid Response: No object data received for " << entry->url() << " AKA " << orig_request->GetHost() << orig_request->urlpath.termedBuf() ); + } } assert(error != ERR_NONE);