]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/beast/test/beast/websocket/test.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / beast / test / beast / websocket / test.hpp
index b4c90d2b738ccedc399bb564161beaae594b6de2..1575db32bb8009d7bfe08bbdb22bd8b6f172109d 100644 (file)
@@ -72,8 +72,7 @@ public:
 
         std::ostream& log_;
         net::io_context ioc_;
-        net::executor_work_guard<
-            net::io_context::executor_type> work_;
+        net::any_io_executor work_;
         static_buffer<buf_size> buffer_;
         test::stream ts_;
         std::thread t_;
@@ -86,7 +85,8 @@ public:
             std::ostream& log,
             kind k = kind::sync)
             : log_(log)
-            , work_(ioc_.get_executor())
+            , work_(net::require(ioc_.get_executor(),
+                net::execution::outstanding_work.tracked))
             , ts_(ioc_)
             , ws_(ts_)
         {
@@ -115,7 +115,7 @@ public:
 
         ~echo_server()
         {
-            work_.reset();
+            work_ = {};
             t_.join();
         }
 
@@ -1249,8 +1249,8 @@ public:
     {
         error_code ec;
         ws.async_accept(handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1266,8 +1266,8 @@ public:
     {
         error_code ec;
         ws.async_accept(buffers, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1280,8 +1280,8 @@ public:
     {
         error_code ec;
         ws.async_accept(req, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1296,8 +1296,8 @@ public:
     {
         error_code ec;
         ws.async_accept_ex(d, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1314,8 +1314,8 @@ public:
     {
         error_code ec;
         ws.async_accept_ex(buffers, d, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1331,8 +1331,8 @@ public:
     {
         error_code ec;
         ws.async_accept_ex(req, d, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1350,8 +1350,8 @@ public:
         error_code ec;
         ws.async_accept_ex(
             req, buffers, d, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1367,8 +1367,8 @@ public:
         error_code ec;
         ws.async_handshake(
             uri, path, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1384,8 +1384,8 @@ public:
         error_code ec;
         ws.async_handshake(
             res, uri, path, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1403,8 +1403,8 @@ public:
         error_code ec;
         ws.async_handshake_ex(
             uri, path, d, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1423,8 +1423,8 @@ public:
         error_code ec;
         ws.async_handshake_ex(
             res, uri, path, d, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1437,8 +1437,8 @@ public:
     {
         error_code ec;
         ws.async_ping(payload, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1451,8 +1451,8 @@ public:
     {
         error_code ec;
         ws.async_pong(payload, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1465,8 +1465,8 @@ public:
     {
         error_code ec;
         ws.async_close(cr, handler(ec));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
     }
@@ -1482,8 +1482,8 @@ public:
         error_code ec;
         std::size_t n;
         ws.async_read(buffer, handler(ec, n));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
         return n;
@@ -1501,8 +1501,8 @@ public:
         error_code ec;
         std::size_t n;
         ws.async_read_some(buffer, limit, handler(ec, n));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
         return n;
@@ -1519,8 +1519,8 @@ public:
         error_code ec;
         std::size_t n;
         ws.async_read_some(buffers, handler(ec, n));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
         return n;
@@ -1537,8 +1537,8 @@ public:
         error_code ec;
         std::size_t n;
         ws.async_write(buffers, handler(ec, n));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
         return n;
@@ -1556,8 +1556,8 @@ public:
         error_code ec;
         std::size_t n;
         ws.async_write_some(fin, buffers, handler(ec, n));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
         return n;
@@ -1575,8 +1575,8 @@ public:
         std::size_t n;
         net::async_write(ws.next_layer(),
             buffers, handler(ec, n));
-        ws.get_executor().context().run();
-        ws.get_executor().context().restart();
+        net::query(ws.get_executor(), net::execution::context).run();
+        net::query(ws.get_executor(), net::execution::context).restart();
         if(ec)
             throw system_error{ec};
         return n;