From 66ff2c7875c51156d33782638b56700e8b7c7566 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 23 Apr 2014 13:44:08 -0400 Subject: [PATCH] eliminate boost::protect --- HTTPServer.cpp | 5 ++--- Streaming.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/HTTPServer.cpp b/HTTPServer.cpp index ac23ebb3..c2a235fa 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -1,5 +1,4 @@ #include -#include #include #include "base64.h" #include "Log.h" @@ -388,8 +387,8 @@ namespace util { if (m_Stream) m_Stream->AsyncReceive (boost::asio::buffer (m_StreamBuffer, 8192), - boost::protect (boost::bind (&HTTPConnection::HandleStreamReceive, this, - boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)), + boost::bind (&HTTPConnection::HandleStreamReceive, this, + boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred), 45); // 45 seconds timeout } diff --git a/Streaming.h b/Streaming.h index 88fd7c20..dd6e1378 100644 --- a/Streaming.h +++ b/Streaming.h @@ -214,8 +214,8 @@ namespace stream } } m_ReceiveTimer.expires_from_now (boost::posix_time::seconds(timeout)); - m_ReceiveTimer.async_wait (boost::bind (&Stream::HandleReceiveTimer, - this, boost::asio::placeholders::error, buffer, handler)); + m_ReceiveTimer.async_wait ([&buffer, handler, this](const boost::system::error_code& ecode) + { this->HandleReceiveTimer (ecode, buffer, handler); }); } template