]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Import fixes for defects in client_side_reply, client_side_request, esi
authorThomas Hozza <thozza@redhat.com>
Wed, 26 Dec 2012 14:03:11 +0000 (15:03 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 26 Dec 2012 14:03:11 +0000 (15:03 +0100)
and ufsswapdir from Red Hat's patchset.

src/client_side_reply.cc
src/client_side_request.cc
src/esi/Esi.cc
src/fs/ufs/UFSSwapDir.cc

index 2fcbf316af3cb18be904ac9d6362aa1d0aa72b4d..942d81737c795193898dd4a2e44fc58ebc232021 100644 (file)
@@ -2067,10 +2067,14 @@ clientReplyContext::sendMoreData (StoreIOBuffer result)
 
     ConnStateData * conn = http->getConn();
 
-    if (conn == NULL || !conn->isOpen()) {
-        // too late, our conn is closing
-        // TODO: should we also quit?
-        debugs(33,3, HERE << "not sending more data to a closing " << conn->clientConnection);
+    // too late, our conn is closing
+    // TODO: should we also quit?
+    if (conn == NULL) {
+        debugs(33,3, "not sending more data to a closed connection" );
+        return;
+    }
+    if (!conn->isOpen()) {
+        debugs(33,3, "not sending more data to closing connection " << conn->clientConnection);
         return;
     }
 
index ac0eee0d29e0ed858b3bddae65a72c095aec848f..c1f395f3b3759cd694692f3bcc5610eedebbdeaf 100644 (file)
@@ -1814,6 +1814,7 @@ ClientHttpRequest::handleAdaptedHeader(HttpMsg *msg)
 
         clientStreamNode *node = (clientStreamNode *)client_stream.tail->prev->data;
         clientReplyContext *repContext = dynamic_cast<clientReplyContext *>(node->data.getRaw());
+        assert(repContext);
         repContext->createStoreEntry(request->method, request->flags);
 
         EBIT_CLR(storeEntry()->flags, ENTRY_FWD_HDR_WAIT);
index 082b6e123d0d850644f03ecea075ee46b213cd5d..60c2344750bbb81281f6f1be308b30aaaaf3a02e 100644 (file)
@@ -2077,12 +2077,13 @@ esiChoose::addElement(ESIElement::Pointer element)
 
         debugs (86,3, "esiChooseAdd: Added a new element, elements = " << elements.size());
 
-        if (chosenelement == -1)
-            if ((dynamic_cast<esiWhen *>(element.getRaw()))->
-                    testsTrue()) {
+        if (chosenelement == -1) {
+            const esiWhen * topElement=dynamic_cast<esiWhen *>(element.getRaw());
+            if (topElement && topElement->testsTrue()) {
                 chosenelement = elements.size() - 1;
                 debugs (86,3, "esiChooseAdd: Chose element " << elements.size());
             }
+        }
     }
 
     return true;
index 83f2eb1b618514c3bab796f52795b2a97cac0ab4..99d9011967db3de6520f4b026c375f706cae9092 100644 (file)
@@ -236,7 +236,7 @@ Fs::Ufs::UFSSwapDir::changeIO(DiskIOModule *module)
     /* TODO: factor out these 4 lines */
     ConfigOption *ioOptions = IO->io->getOptionTree();
 
-    if (ioOptions)
+    if (currentIOOptions && ioOptions)
         currentIOOptions->options.push_back(ioOptions);
 }