From: Amos Jeffries Date: Sun, 3 May 2009 12:24:02 +0000 (+1200) Subject: Author: Christos Tsantilas X-Git-Tag: SQUID_3_0_STABLE15~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62d8009f059a42a895c323aaca245dcfa2971115;p=thirdparty%2Fsquid.git Author: Christos Tsantilas Bug 2652: tunnelReadServer: read failure: (0) Success error message -Method TunnelStateData::Connection::error: The xerrno is the errno values (EAGAIN, EINTR etc) not a COMM_XX error/flag. - Methods TunnelStateData::writeServerDone,TunnelStateData::writeClientDone: if the related connection fd closing (flag==COMM_ERR_CLOSING) just return --- diff --git a/src/tunnel.cc b/src/tunnel.cc index 0ef502ffc2..9d4109c2c6 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -258,11 +258,8 @@ TunnelStateData::Connection::error(int const xerrno) /* XXX fixme xstrerror and xerrno... */ errno = xerrno; - if (xerrno == COMM_ERR_CLOSING) - return; - - debugs(50, debugLevelForError(xerrno), "tunnelReadServer: FD " << fd() << - ": read failure: " << xstrerror()); + debugs(50, debugLevelForError(xerrno), "TunnelStateData::Connection::error: FD " << fd() << + ": read/write failure: " << xstrerror()); if (!ignoreErrno(xerrno)) comm_close(fd()); @@ -343,6 +340,9 @@ TunnelStateData::writeServerDone(char *buf, size_t len, comm_err_t flag, int xer { debugs(26, 3, "tunnelWriteServer: FD " << server.fd() << ", " << len << " bytes written"); + if(flag == COMM_ERR_CLOSING) + return; + /* Error? */ if (len < 0 || flag != COMM_OK) { server.error(xerrno); // may call comm_close @@ -401,6 +401,9 @@ TunnelStateData::writeClientDone(char *buf, size_t len, comm_err_t flag, int xer { debugs(26, 3, "tunnelWriteClient: FD " << client.fd() << ", " << len << " bytes written"); + if(flag == COMM_ERR_CLOSING) + return; + /* Error? */ if (len < 0 || flag != COMM_OK) { client.error(xerrno); // may call comm_close