Added possibility of no timeout (=0)
This commit is contained in:
parent
c12e026e0e
commit
cdf7114f2d
3 changed files with 21 additions and 9 deletions
|
|
@ -32,10 +32,13 @@ namespace SimpleWeb {
|
|||
|
||||
if(!ec) {
|
||||
//Set timeout on the following boost::asio::ssl::stream::async_handshake
|
||||
auto timer=set_timeout_on_socket(socket, timeout_request);
|
||||
std::shared_ptr<boost::asio::deadline_timer> timer;
|
||||
if(timeout_request>0)
|
||||
timer=set_timeout_on_socket(socket, timeout_request);
|
||||
(*socket).async_handshake(boost::asio::ssl::stream_base::server, [this, socket, timer]
|
||||
(const boost::system::error_code& ec) {
|
||||
timer->cancel();
|
||||
if(timeout_request>0)
|
||||
timer->cancel();
|
||||
if(!ec)
|
||||
process_request_and_respond(socket);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue