]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Temporary fix for segmentation faults in FwdState::serverClosed debugging.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 9 May 2014 04:45:54 +0000 (22:45 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 9 May 2014 04:45:54 +0000 (22:45 -0600)
See r13404 for details.

src/FwdState.cc

index 1fd52ade5825a8eaa5f88f87b7907e9af7160e5d..8dc659584980c5f2944d0a464ea0a99b03579c69 100644 (file)
@@ -619,9 +619,10 @@ FwdState::checkRetriable()
 void
 FwdState::serverClosed(int fd)
 {
+    // XXX: fd is often -1 here
     debugs(17, 2, "FD " << fd << " " << entry->url() << " after " <<
-           fd_table[fd].pconn.uses << " requests");
-    if (fd >= 0 && serverConnection()->fd == fd) // XXX: fd is often -1 here
+           (fd >= 0 ? fd_table[fd].pconn.uses : -1) << " requests");
+    if (fd >= 0 && serverConnection()->fd == fd)
         fwdPconnPool->noteUses(fd_table[fd].pconn.uses);
     retryOrBail();
 }