From: Thomas Hozza Date: Wed, 26 Dec 2012 14:03:11 +0000 (+0100) Subject: Import fixes for defects in client_side_reply, client_side_request, esi X-Git-Tag: SQUID_3_4_0_1~421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea25a575f24c04d4a7aa0862302112ac2a754ebe;p=thirdparty%2Fsquid.git Import fixes for defects in client_side_reply, client_side_request, esi and ufsswapdir from Red Hat's patchset. --- diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 2fcbf316af..942d81737c 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -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; } diff --git a/src/client_side_request.cc b/src/client_side_request.cc index ac0eee0d29..c1f395f3b3 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1814,6 +1814,7 @@ ClientHttpRequest::handleAdaptedHeader(HttpMsg *msg) clientStreamNode *node = (clientStreamNode *)client_stream.tail->prev->data; clientReplyContext *repContext = dynamic_cast(node->data.getRaw()); + assert(repContext); repContext->createStoreEntry(request->method, request->flags); EBIT_CLR(storeEntry()->flags, ENTRY_FWD_HDR_WAIT); diff --git a/src/esi/Esi.cc b/src/esi/Esi.cc index 082b6e123d..60c2344750 100644 --- a/src/esi/Esi.cc +++ b/src/esi/Esi.cc @@ -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(element.getRaw()))-> - testsTrue()) { + if (chosenelement == -1) { + const esiWhen * topElement=dynamic_cast(element.getRaw()); + if (topElement && topElement->testsTrue()) { chosenelement = elements.size() - 1; debugs (86,3, "esiChooseAdd: Chose element " << elements.size()); } + } } return true; diff --git a/src/fs/ufs/UFSSwapDir.cc b/src/fs/ufs/UFSSwapDir.cc index 83f2eb1b61..99d9011967 100644 --- a/src/fs/ufs/UFSSwapDir.cc +++ b/src/fs/ufs/UFSSwapDir.cc @@ -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); }