]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 3 May 2009 12:24:02 +0000 (00:24 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 3 May 2009 12:24:02 +0000 (00:24 +1200)
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

src/tunnel.cc

index 0ef502ffc27cc425921dcc1b4ea05eea1bcf986d..9d4109c2c6aa5589593a3ded772ef47fb44bab10 100644 (file)
@@ -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