summaryrefslogtreecommitdiff
path: root/src/lib/server.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-06 11:09:16 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-06 11:09:16 +0100
commitebc29bddd5cbc5cad23cc9b1095d842f55ece5e0 (patch)
tree7095d6d7cd9df042f80eb2952b666b57afc8cdc1 /src/lib/server.cc
parent4d3d20687c9e334b29c8a2821e0646fb9166ab3f (diff)
Try to prevent encode server test crashing in valgrind.
Diffstat (limited to 'src/lib/server.cc')
-rw-r--r--src/lib/server.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/server.cc b/src/lib/server.cc
index 722b1c811..9a633c861 100644
--- a/src/lib/server.cc
+++ b/src/lib/server.cc
@@ -25,9 +25,10 @@
using boost::shared_ptr;
-Server::Server (int port)
+Server::Server (int port, int timeout)
: _terminate (false)
, _acceptor (_io_service, boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(), port))
+ , _timeout (timeout)
{
}
@@ -60,7 +61,7 @@ Server::start_accept ()
}
}
- shared_ptr<Socket> socket (new Socket);
+ shared_ptr<Socket> socket (new Socket(_timeout));
_acceptor.async_accept (socket->socket (), boost::bind (&Server::handle_accept, this, socket, boost::asio::placeholders::error));
}