]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5649] Further improvements to the timeouts mgmt.
authorMarcin Siodelski <marcin@isc.org>
Wed, 13 Jun 2018 23:07:06 +0000 (01:07 +0200)
committerMarcin Siodelski <marcin@isc.org>
Wed, 13 Jun 2018 23:07:06 +0000 (01:07 +0200)
src/bin/agent/ca_command_mgr.cc
src/lib/http/connection.cc

index fc08bbae77ee0c714711dcb62804bb5fb583a061..f3ee5fb8b138818b13bcf4148bdddd1a47f88167 100644 (file)
@@ -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;
 
 }
 
index 4be0663a879cb13bbde4532f84e3f78da5aeafd9..ebb6a7ffb66cb1e9c0505efef69b427f5594887c 100644 (file)
@@ -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);
     }
 }