Added workaround for buggy MSVS

This commit is contained in:
eidheim 2016-11-23 09:24:41 +01:00
commit b1200958cc
2 changed files with 9 additions and 9 deletions

View file

@ -46,21 +46,21 @@ namespace SimpleWeb {
(const boost::system::error_code &ec, boost::asio::ip::tcp::resolver::iterator /*it*/){
if(!ec) {
boost::asio::ip::tcp::no_delay option(true);
socket->lowest_layer().set_option(option);
this->socket->lowest_layer().set_option(option);
auto timer=get_timeout_timer();
socket->async_handshake(boost::asio::ssl::stream_base::client,
[this, timer](const boost::system::error_code& ec) {
this->socket->async_handshake(boost::asio::ssl::stream_base::client,
[this, timer](const boost::system::error_code& ec) {
if(timer)
timer->cancel();
if(ec) {
socket=nullptr;
this->socket=nullptr;
throw boost::system::system_error(ec);
}
});
}
else {
socket=nullptr;
this->socket=nullptr;
throw boost::system::system_error(ec);
}
});