From: Henrik Nordstrom Date: Fri, 7 Jun 2013 08:49:36 +0000 (+1200) Subject: Kill some old unused & unmaintained code for sending an error response X-Git-Tag: SQUID_3_4_0_1~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6177a89fb89f5ab789a38e3c89d4355d7568b9a3;p=thirdparty%2Fsquid.git Kill some old unused & unmaintained code for sending an error response ... on timeout before seeing a request Ported from 2.7 rev.11516 --- diff --git a/src/client_side.cc b/src/client_side.cc index f77fd82562..9f344e364d 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -3307,71 +3307,16 @@ ConnStateData::noteBodyConsumerAborted(BodyPipe::Pointer ) void ConnStateData::requestTimeout(const CommTimeoutCbParams &io) { -#if THIS_CONFUSES_PERSISTENT_CONNECTION_AWARE_BROWSERS_AND_USERS - debugs(33, 3, "requestTimeout: FD " << io.fd << ": lifetime is expired."); - - if (COMMIO_FD_WRITECB(io.fd)->active) { - /* FIXME: If this code is reinstated, check the conn counters, - * not the fd table state - */ - /* - * Some data has been sent to the client, just close the FD - */ - clientConnection->close(); - } else if (nrequests) { - /* - * assume its a persistent connection; just close it - */ - clientConnection->close(); - } else { - /* - * Generate an error - */ - ClientHttpRequest **H; - clientStreamNode *node; - ClientHttpRequest *http = parseHttpRequestAbort(this, "error:Connection%20lifetime%20expired"); - node = http->client_stream.tail->prev->data; - clientReplyContext *repContext = dynamic_cast(node->data.getRaw()); - assert (repContext); - repContext->setReplyToError(ERR_LIFETIME_EXP, - Http::scRequestTimeout, Http::METHOD_NONE, "N/A", &CachePeer.sin_addr, - NULL, NULL, NULL); - /* No requests can be outstanded */ - assert(chr == NULL); - /* add to the client request queue */ - - for (H = &chr; *H; H = &(*H)->next); - *H = http; - - clientStreamRead(http->client_stream.tail->data, http, 0, - HTTP_REQBUF_SZ, context->reqbuf); - - /* - * if we don't close() here, we still need a timeout handler! - */ - typedef CommCbMemFunT TimeoutDialer; - AsyncCall::Pointer timeoutCall = JobCallback(33, 5, - TimeoutDialer, this, ConnStateData::requestTimeout); - commSetConnTimeout(io.conn, 30, timeoutCall); - - /* - * Aha, but we don't want a read handler! - */ - Comm::SetSelect(io.fd, COMM_SELECT_READ, NULL, NULL, 0); - } - -#else /* * Just close the connection to not confuse browsers - * using persistent connections. Some browsers opens - * an connection and then does not use it until much + * using persistent connections. Some browsers open + * a connection and then do not use it until much * later (presumeably because the request triggering * the open has already been completed on another * connection) */ debugs(33, 3, "requestTimeout: FD " << io.fd << ": lifetime is expired."); io.conn->close(); -#endif } static void