------------------------------------------------------------ revno: 12900 revision-id: squid3@treenet.co.nz-20130607084936-nmzcrjilt0ess0qf parent: squid3@treenet.co.nz-20130607043525-y2drbfgk4q5gu0ht author: Henrik Nordstrom committer: Amos Jeffries branch nick: trunk timestamp: Fri 2013-06-07 20:49:36 +1200 message: Kill some old unused & unmaintained code for sending an error response ... on timeout before seeing a request Ported from 2.7 rev.11516 ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20130607084936-nmzcrjilt0ess0qf # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: e66bfc863c3273c1e545a47ef01bb4a249ca07ca # timestamp: 2013-06-07 08:50:36 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20130607043525-\ # y2drbfgk4q5gu0ht # # Begin patch === modified file 'src/client_side.cc' --- src/client_side.cc 2013-06-07 04:35:25 +0000 +++ src/client_side.cc 2013-06-07 08:49:36 +0000 @@ -3307,71 +3307,16 @@ 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