]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/example/cpp03/http/server3/connection.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / asio / example / cpp03 / http / server3 / connection.cpp
index 76d7132743842c5833db1e5e587acbc2736157e9..37890b570d196c9af21681af351857be504eb358 100644 (file)
@@ -2,7 +2,7 @@
 // connection.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 namespace http {
 namespace server3 {
 
-connection::connection(boost::asio::io_service& io_service,
+connection::connection(boost::asio::io_context& io_context,
     request_handler& handler)
-  : strand_(io_service),
-    socket_(io_service),
+  : strand_(io_context),
+    socket_(io_context),
     request_handler_(handler)
 {
 }
@@ -32,7 +32,7 @@ boost::asio::ip::tcp::socket& connection::socket()
 void connection::start()
 {
   socket_.async_read_some(boost::asio::buffer(buffer_),
-      strand_.wrap(
+      boost::asio::bind_executor(strand_,
         boost::bind(&connection::handle_read, shared_from_this(),
           boost::asio::placeholders::error,
           boost::asio::placeholders::bytes_transferred)));
@@ -51,7 +51,7 @@ void connection::handle_read(const boost::system::error_code& e,
     {
       request_handler_.handle_request(request_, reply_);
       boost::asio::async_write(socket_, reply_.to_buffers(),
-          strand_.wrap(
+          boost::asio::bind_executor(strand_,
             boost::bind(&connection::handle_write, shared_from_this(),
               boost::asio::placeholders::error)));
     }
@@ -59,14 +59,14 @@ void connection::handle_read(const boost::system::error_code& e,
     {
       reply_ = reply::stock_reply(reply::bad_request);
       boost::asio::async_write(socket_, reply_.to_buffers(),
-          strand_.wrap(
+          boost::asio::bind_executor(strand_,
             boost::bind(&connection::handle_write, shared_from_this(),
               boost::asio::placeholders::error)));
     }
     else
     {
       socket_.async_read_some(boost::asio::buffer(buffer_),
-          strand_.wrap(
+          boost::asio::bind_executor(strand_,
             boost::bind(&connection::handle_read, shared_from_this(),
               boost::asio::placeholders::error,
               boost::asio::placeholders::bytes_transferred)));