From: Marcin Siodelski Date: Wed, 13 Jun 2018 23:07:06 +0000 (+0200) Subject: [5649] Further improvements to the timeouts mgmt. X-Git-Tag: Kea-1.4.0~1^2~3^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9664641c271879407c5574d47e2586dc91ee8851;p=thirdparty%2Fkea.git [5649] Further improvements to the timeouts mgmt. --- diff --git a/src/bin/agent/ca_command_mgr.cc b/src/bin/agent/ca_command_mgr.cc index fc08bbae77..f3ee5fb8b1 100644 --- a/src/bin/agent/ca_command_mgr.cc +++ b/src/bin/agent/ca_command_mgr.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -34,7 +34,7 @@ namespace { /// @brief Client side connection timeout. /// @todo Make it configurable. -const long CONNECTION_TIMEOUT = 5000; +const long CONNECTION_TIMEOUT = 10000; } diff --git a/src/lib/http/connection.cc b/src/lib/http/connection.cc index 4be0663a87..ebb6a7ffb6 100644 --- a/src/lib/http/connection.cc +++ b/src/lib/http/connection.cc @@ -239,6 +239,9 @@ HttpConnection::socketReadCallback(boost::system::error_code ec, size_t length) .arg(parser_->getBufferAsString(MAX_LOGGED_MESSAGE_SIZE)); } + // Don't want to timeout if creation of the response takes long. + request_timer_.cancel(); + HttpResponsePtr response = response_creator_->createHttpResponse(request_); LOG_DEBUG(http_logger, isc::log::DBGLVL_TRACE_BASIC, HTTP_SERVER_RESPONSE_SEND) @@ -251,6 +254,9 @@ HttpConnection::socketReadCallback(boost::system::error_code ec, size_t length) .arg(HttpMessageParserBase::logFormatHttpMessage(response->toString(), MAX_LOGGED_MESSAGE_SIZE)); + // Response created. Active timer again. + setupRequestTimer(); + asyncSendResponse(response); } }