Commit a0667703 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[#491,!363] Removed unnecessary parameters passed to HTTP conn factory.

parent 8b0b79ac
......@@ -89,13 +89,8 @@ HttpListenerImpl::accept() {
HttpResponseCreatorPtr response_creator = creator_factory_->create();
HttpAcceptorCallback acceptor_callback =
boost::bind(&HttpListenerImpl::acceptHandler, this, _1);
HttpConnectionPtr conn = createConnection(io_service_,
acceptor_,
connections_,
response_creator,
acceptor_callback,
request_timeout_,
idle_timeout_);
HttpConnectionPtr conn = createConnection(response_creator,
acceptor_callback);
// Add this new connection to the pool.
connections_.start(conn);
}
......@@ -108,13 +103,8 @@ HttpListenerImpl::acceptHandler(const boost::system::error_code&) {
}
HttpConnectionPtr
HttpListenerImpl::createConnection(IOService& io_service,
HttpAcceptor& acceptor,
HttpConnectionPool& connection_pool,
const HttpResponseCreatorPtr& response_creator,
const HttpAcceptorCallback& callback,
const long request_timeout,
const long idle_timeout) {
HttpListenerImpl::createConnection(const HttpResponseCreatorPtr& response_creator,
const HttpAcceptorCallback& callback) {
HttpConnectionPtr
conn(new HttpConnection(io_service_, acceptor_, connections_,
response_creator, callback,
......
......@@ -92,26 +92,13 @@ protected:
/// This method is virtual so as it can be overriden when customized
/// connections are to be used, e.g. in case of unit testing.
///
/// @param io_service IO service to be used by the connection.
/// @param acceptor Reference to the TCP acceptor object used to listen for
/// new HTTP connections.
/// @param connection_pool Connection pool in which this connection is
/// stored.
/// @param response_creator Pointer to the response creator object used to
/// create HTTP response from the HTTP request received.
/// @param callback Callback invoked when new connection is accepted.
/// @param request_timeout Configured timeout for a HTTP request.
/// @param idle_timeout Timeout after which persistent HTTP connection is
/// closed by the server.
///
/// @return Pointer to the created connection.
virtual HttpConnectionPtr createConnection(asiolink::IOService& io_service,
HttpAcceptor& acceptor,
HttpConnectionPool& connection_pool,
const HttpResponseCreatorPtr& response_creator,
const HttpAcceptorCallback& callback,
const long request_timeout,
const long idle_timeout);
virtual HttpConnectionPtr createConnection(const HttpResponseCreatorPtr& response_creator,
const HttpAcceptorCallback& callback);
/// @brief Reference to the IO service.
asiolink::IOService& io_service_;
......
......@@ -233,13 +233,8 @@ protected:
/// closed by the server.
///
/// @return Pointer to the created connection.
virtual HttpConnectionPtr createConnection(IOService& io_service,
HttpAcceptor& acceptor,
HttpConnectionPool& connection_pool,
const HttpResponseCreatorPtr& response_creator,
const HttpAcceptorCallback& callback,
const long request_timeout,
const long idle_timeout) {
virtual HttpConnectionPtr createConnection(const HttpResponseCreatorPtr& response_creator,
const HttpAcceptorCallback& callback) {
HttpConnectionPtr
conn(new HttpConnectionType(io_service_, acceptor_, connections_,
response_creator, callback,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment