From: Marcin Siodelski Date: Thu, 6 Apr 2017 10:40:14 +0000 (+0200) Subject: [master] Fixing hang in the text causing memory corruption and hang. X-Git-Tag: trac5213_base~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=87da3cd1ff21a90ee99b52fba58bc619e2691b7e;p=thirdparty%2Fkea.git [master] Fixing hang in the text causing memory corruption and hang. Okayed on Jabber. --- diff --git a/src/bin/agent/tests/ca_command_mgr_unittests.cc b/src/bin/agent/tests/ca_command_mgr_unittests.cc index 9f00ceabf6..c70e76e09e 100644 --- a/src/bin/agent/tests/ca_command_mgr_unittests.cc +++ b/src/bin/agent/tests/ca_command_mgr_unittests.cc @@ -318,7 +318,8 @@ TEST_F(CtrlAgentCommandMgrTest, failForwardToServer) { /// Check that control command is not forwarded if the service is not specified. TEST_F(CtrlAgentCommandMgrTest, noService) { testForward(CtrlAgentCfgContext::TYPE_DHCP6, "", - isc::config::CONTROL_RESULT_COMMAND_UNSUPPORTED); + isc::config::CONTROL_RESULT_COMMAND_UNSUPPORTED, + -1, -1, 0); } /// Check that error is returned to the client when the server to which the diff --git a/src/lib/asiolink/testutils/test_server_unix_socket.cc b/src/lib/asiolink/testutils/test_server_unix_socket.cc index 6143b0489d..ab374cc062 100644 --- a/src/lib/asiolink/testutils/test_server_unix_socket.cc +++ b/src/lib/asiolink/testutils/test_server_unix_socket.cc @@ -61,7 +61,13 @@ public: /// /// @param bytes_transferred Number of bytes received. void - readHandler(const boost::system::error_code&, size_t bytes_transferred) { + readHandler(const boost::system::error_code& ec, + size_t bytes_transferred) { + // This is most likely due to the abort. + if (ec) { + return; + } + if (!custom_response_.empty()) { boost::asio::write(*socket_, boost::asio::buffer(custom_response_.c_str(), custom_response_.size()));