Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
a0667703
Commit
a0667703
authored
Jun 17, 2019
by
Marcin Siodelski
Browse files
[
#491
,
!363
] Removed unnecessary parameters passed to HTTP conn factory.
parent
8b0b79ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/http/listener_impl.cc
View file @
a0667703
...
...
@@ -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
,
...
...
src/lib/http/listener_impl.h
View file @
a0667703
...
...
@@ -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_
;
...
...
src/lib/http/tests/server_client_unittests.cc
View file @
a0667703
...
...
@@ -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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment