From 9664641c271879407c5574d47e2586dc91ee8851 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Thu, 14 Jun 2018 01:07:06 +0200 Subject: [PATCH] [5649] Further improvements to the timeouts mgmt. --- src/bin/agent/ca_command_mgr.cc | 4 ++-- src/lib/http/connection.cc | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) 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); } } -- 2.47.2