From: Alex Rousskov Date: Fri, 3 Dec 2010 23:04:01 +0000 (-0700) Subject: Avoid comm_read "!fd_table[fd].closing()" assertion after adaptation ACL check X-Git-Tag: take1~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=505c2f289bcb3e2cc32d1ca15a8ff41ad3330004;p=thirdparty%2Fsquid.git Avoid comm_read "!fd_table[fd].closing()" assertion after adaptation ACL check The assertion was hit if Server fd was closed while we were checking adaptation ACLs, and we have not been notified of the closure yet (because the Adaptation::AccessCheck callback is not async while closure notification is). --- diff --git a/src/http.cc b/src/http.cc index fc2dddb3f9..7bb69d10e7 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1012,6 +1012,13 @@ HttpStateData::persistentConnStatus() const if (eof) // already reached EOF return COMPLETE_NONPERSISTENT_MSG; + /* If server fd is closing (but we have not been notified yet), stop Comm + I/O to avoid assertions. TODO: Change Comm API to handle callers that + want more I/O after async closing (usually initiated by others). */ + // XXX: add canReceive or s/canSend/canTalkToServer/ + if (!canSend(fd)) + return COMPLETE_NONPERSISTENT_MSG; + /** \par * In chunked response we do not know the content length but we are absolutely * sure about the end of response, so we are calling the statusIfComplete to