boost: Package Version Update (1.73.0)
[feed/packages.git] / libs / boost / patches / 003-beast-coroutines.patch
1 --- a/boost/beast/core/detail/impl/read.hpp 2020-04-22 09:34:50.000000000 -0400
2 +++ b/boost/beast/core/detail/impl/read.hpp 2020-05-02 13:50:11.141761700 -0400
3 @@ -214,7 +214,7 @@
4 class AsyncReadStream,
5 class DynamicBuffer,
6 class CompletionCondition,
7 - class ReadHandler,
8 + BOOST_BEAST_ASYNC_TPARAM2 ReadHandler,
9 class>
10 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
11 async_read(
12 diff -aruN a/boost/beast/core/detail/is_invocable.hpp b/boost/beast/core/detail/is_invocable.hpp
13 --- a/boost/beast/core/detail/is_invocable.hpp 2020-04-22 09:34:50.000000000 -0400
14 +++ b/boost/beast/core/detail/is_invocable.hpp 2020-05-02 13:50:11.141761700 -0400
15 @@ -10,6 +10,8 @@
16 #ifndef BOOST_BEAST_DETAIL_IS_INVOCABLE_HPP
17 #define BOOST_BEAST_DETAIL_IS_INVOCABLE_HPP
18
19 +#include <boost/asio/async_result.hpp>
20 +#include <boost/type_traits/make_void.hpp>
21 #include <type_traits>
22 #include <utility>
23
24 @@ -51,6 +53,26 @@
25 };
26 /** @} */
27
28 +template<class CompletionToken, class Signature, class = void>
29 +struct is_completion_token_for : std::false_type
30 +{
31 +};
32 +
33 +struct any_initiation
34 +{
35 + template<class...AnyArgs>
36 + void operator()(AnyArgs&&...);
37 +};
38 +
39 +template<class CompletionToken, class R, class...Args>
40 +struct is_completion_token_for<
41 + CompletionToken, R(Args...), boost::void_t<decltype(
42 + boost::asio::async_initiate<CompletionToken, R(Args...)>(
43 + any_initiation(), std::declval<CompletionToken&>())
44 + )>> : std::true_type
45 +{
46 +};
47 +
48 } // detail
49 } // beast
50 } // boost
51 diff -aruN a/boost/beast/core/detail/read.hpp b/boost/beast/core/detail/read.hpp
52 --- a/boost/beast/core/detail/read.hpp 2020-04-22 09:34:50.000000000 -0400
53 +++ b/boost/beast/core/detail/read.hpp 2020-05-02 13:50:11.142761711 -0400
54 @@ -219,7 +219,7 @@
55 class AsyncReadStream,
56 class DynamicBuffer,
57 class CompletionCondition,
58 - class ReadHandler
59 + BOOST_BEAST_ASYNC_TPARAM2 ReadHandler
60 #if ! BOOST_BEAST_DOXYGEN
61 , class = typename std::enable_if<
62 is_async_read_stream<AsyncReadStream>::value &&
63 diff -aruN a/boost/beast/core/detect_ssl.hpp b/boost/beast/core/detect_ssl.hpp
64 --- a/boost/beast/core/detect_ssl.hpp 2020-04-22 09:34:50.000000000 -0400
65 +++ b/boost/beast/core/detect_ssl.hpp 2020-05-02 13:50:11.143761722 -0400
66 @@ -374,13 +374,13 @@
67 void operator()(
68 DetectHandler&& h,
69 AsyncReadStream* s, // references are passed as pointers
70 - DynamicBuffer& b)
71 + DynamicBuffer* b)
72 {
73 detect_ssl_op<
74 typename std::decay<DetectHandler>::type,
75 AsyncReadStream,
76 DynamicBuffer>(
77 - std::forward<DetectHandler>(h), *s, b);
78 + std::forward<DetectHandler>(h), *s, *b);
79 }
80 };
81
82 @@ -439,7 +439,7 @@
83 detail::run_detect_ssl_op{},
84 token,
85 &stream, // pass the reference by pointer
86 - buffer);
87 + &buffer);
88 }
89
90 //]
91 diff -aruN a/boost/beast/core/impl/basic_stream.hpp b/boost/beast/core/impl/basic_stream.hpp
92 --- a/boost/beast/core/impl/basic_stream.hpp 2020-04-22 09:34:50.000000000 -0400
93 +++ b/boost/beast/core/impl/basic_stream.hpp 2020-05-02 13:50:11.144761733 -0400
94 @@ -776,7 +776,7 @@
95 //------------------------------------------------------------------------------
96
97 template<class Protocol, class Executor, class RatePolicy>
98 -template<class ConnectHandler>
99 +template<BOOST_BEAST_ASYNC_TPARAM1 ConnectHandler>
100 BOOST_BEAST_ASYNC_RESULT1(ConnectHandler)
101 basic_stream<Protocol, Executor, RatePolicy>::
102 async_connect(
103 @@ -795,7 +795,7 @@
104 template<class Protocol, class Executor, class RatePolicy>
105 template<
106 class EndpointSequence,
107 - class RangeConnectHandler,
108 + BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, typename Protocol::endpoint)) RangeConnectHandler,
109 class>
110 BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void(error_code, typename Protocol::endpoint))
111 basic_stream<Protocol, Executor, RatePolicy>::
112 @@ -817,7 +817,7 @@
113 template<
114 class EndpointSequence,
115 class ConnectCondition,
116 - class RangeConnectHandler,
117 + BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, typename Protocol::endpoint)) RangeConnectHandler,
118 class>
119 BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void (error_code, typename Protocol::endpoint))
120 basic_stream<Protocol, Executor, RatePolicy>::
121 @@ -839,7 +839,7 @@
122 template<class Protocol, class Executor, class RatePolicy>
123 template<
124 class Iterator,
125 - class IteratorConnectHandler>
126 + BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, Iterator)) IteratorConnectHandler>
127 BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator))
128 basic_stream<Protocol, Executor, RatePolicy>::
129 async_connect(
130 @@ -860,7 +860,7 @@
131 template<
132 class Iterator,
133 class ConnectCondition,
134 - class IteratorConnectHandler>
135 + BOOST_ASIO_COMPLETION_TOKEN_FOR(void(error_code, Iterator)) IteratorConnectHandler>
136 BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator))
137 basic_stream<Protocol, Executor, RatePolicy>::
138 async_connect(
139 @@ -881,7 +881,7 @@
140 //------------------------------------------------------------------------------
141
142 template<class Protocol, class Executor, class RatePolicy>
143 -template<class MutableBufferSequence, class ReadHandler>
144 +template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
145 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
146 basic_stream<Protocol, Executor, RatePolicy>::
147 async_read_some(
148 @@ -901,7 +901,7 @@
149 }
150
151 template<class Protocol, class Executor, class RatePolicy>
152 -template<class ConstBufferSequence, class WriteHandler>
153 +template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
154 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
155 basic_stream<Protocol, Executor, RatePolicy>::
156 async_write_some(
157 diff -aruN a/boost/beast/core/impl/buffered_read_stream.hpp b/boost/beast/core/impl/buffered_read_stream.hpp
158 --- a/boost/beast/core/impl/buffered_read_stream.hpp 2020-04-22 09:34:50.000000000 -0400
159 +++ b/boost/beast/core/impl/buffered_read_stream.hpp 2020-05-02 13:50:11.144761733 -0400
160 @@ -110,7 +110,7 @@
161 operator()(
162 ReadHandler&& h,
163 buffered_read_stream* s,
164 - Buffers const& b)
165 + Buffers const* b)
166 {
167 // If you get an error on the following line it means
168 // that your handler does not meet the documented type
169 @@ -124,7 +124,7 @@
170 read_op<
171 Buffers,
172 typename std::decay<ReadHandler>::type>(
173 - std::forward<ReadHandler>(h), *s, b);
174 + std::forward<ReadHandler>(h), *s, *b);
175 }
176 };
177
178 @@ -141,7 +141,7 @@
179 }
180
181 template<class Stream, class DynamicBuffer>
182 -template<class ConstBufferSequence, class WriteHandler>
183 +template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
184 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
185 buffered_read_stream<Stream, DynamicBuffer>::
186 async_write_some(
187 @@ -153,7 +153,7 @@
188 static_assert(net::is_const_buffer_sequence<
189 ConstBufferSequence>::value,
190 "ConstBufferSequence type requirements not met");
191 - static_assert(detail::is_invocable<WriteHandler,
192 + static_assert(detail::is_completion_token_for<WriteHandler,
193 void(error_code, std::size_t)>::value,
194 "WriteHandler type requirements not met");
195 return next_layer_.async_write_some(buffers,
196 @@ -212,7 +212,7 @@
197 }
198
199 template<class Stream, class DynamicBuffer>
200 -template<class MutableBufferSequence, class ReadHandler>
201 +template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
202 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
203 buffered_read_stream<Stream, DynamicBuffer>::
204 async_read_some(
205 @@ -233,7 +233,7 @@
206 typename ops::run_read_op{},
207 handler,
208 this,
209 - buffers);
210 + &buffers);
211 }
212
213 } // beast
214 diff -aruN a/boost/beast/core/impl/flat_stream.hpp b/boost/beast/core/impl/flat_stream.hpp
215 --- a/boost/beast/core/impl/flat_stream.hpp 2020-04-22 09:34:50.000000000 -0400
216 +++ b/boost/beast/core/impl/flat_stream.hpp 2020-05-02 13:50:11.145761743 -0400
217 @@ -144,7 +144,7 @@
218 template<class NextLayer>
219 template<
220 class MutableBufferSequence,
221 - class ReadHandler>
222 + BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
223 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
224 flat_stream<NextLayer>::
225 async_read_some(
226 @@ -225,7 +225,7 @@
227 template<class NextLayer>
228 template<
229 class ConstBufferSequence,
230 - class WriteHandler>
231 + BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
232 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
233 flat_stream<NextLayer>::
234 async_write_some(
235 diff -aruN a/boost/beast/_experimental/http/impl/icy_stream.hpp b/boost/beast/_experimental/http/impl/icy_stream.hpp
236 --- a/boost/beast/_experimental/http/impl/icy_stream.hpp 2020-04-22 09:34:50.000000000 -0400
237 +++ b/boost/beast/_experimental/http/impl/icy_stream.hpp 2020-05-02 13:50:11.146761754 -0400
238 @@ -259,7 +259,7 @@
239 template<class NextLayer>
240 template<
241 class MutableBufferSequence,
242 - class ReadHandler>
243 + BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
244 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
245 icy_stream<NextLayer>::
246 async_read_some(
247 @@ -311,7 +311,7 @@
248 template<class NextLayer>
249 template<
250 class MutableBufferSequence,
251 - class WriteHandler>
252 + BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
253 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
254 icy_stream<NextLayer>::
255 async_write_some(
256 diff -aruN a/boost/beast/_experimental/test/impl/stream.hpp b/boost/beast/_experimental/test/impl/stream.hpp
257 --- a/boost/beast/_experimental/test/impl/stream.hpp 2020-04-22 09:34:50.000000000 -0400
258 +++ b/boost/beast/_experimental/test/impl/stream.hpp 2020-05-02 13:50:11.147761765 -0400
259 @@ -306,7 +306,7 @@
260 return 0;
261 }
262
263 -template<class MutableBufferSequence, class ReadHandler>
264 +template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
265 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
266 stream::
267 async_read_some(
268 @@ -386,7 +386,7 @@
269 return n;
270 }
271
272 -template<class ConstBufferSequence, class WriteHandler>
273 +template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
274 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
275 stream::
276 async_write_some(
277 diff -aruN a/boost/beast/http/field.hpp b/boost/beast/http/field.hpp
278 --- a/boost/beast/http/field.hpp 2020-04-22 09:34:50.000000000 -0400
279 +++ b/boost/beast/http/field.hpp 2020-05-02 13:50:11.149761786 -0400
280 @@ -396,12 +396,9 @@
281 string_to_field(string_view s);
282
283 /// Write the text for a field name to an output stream.
284 -inline
285 +BOOST_BEAST_DECL
286 std::ostream&
287 -operator<<(std::ostream& os, field f)
288 -{
289 - return os << to_string(f);
290 -}
291 +operator<<(std::ostream& os, field f);
292
293 } // http
294 } // beast
295 diff -aruN a/boost/beast/http/impl/field.ipp b/boost/beast/http/impl/field.ipp
296 --- a/boost/beast/http/impl/field.ipp 2020-04-22 09:34:50.000000000 -0400
297 +++ b/boost/beast/http/impl/field.ipp 2020-05-02 13:50:11.150761798 -0400
298 @@ -11,10 +11,12 @@
299 #define BOOST_BEAST_HTTP_IMPL_FIELD_IPP
300
301 #include <boost/beast/http/field.hpp>
302 +#include <boost/assert.hpp>
303 #include <algorithm>
304 #include <array>
305 #include <cstring>
306 -#include <boost/assert.hpp>
307 +#include <ostream>
308 +
309
310 namespace boost {
311 namespace beast {
312 @@ -565,6 +567,12 @@
313 return detail::get_field_table().string_to_field(s);
314 }
315
316 +std::ostream&
317 +operator<<(std::ostream& os, field f)
318 +{
319 + return os << to_string(f);
320 +}
321 +
322 } // http
323 } // beast
324 } // boost
325 diff -aruN a/boost/beast/http/impl/file_body_win32.hpp b/boost/beast/http/impl/file_body_win32.hpp
326 --- a/boost/beast/http/impl/file_body_win32.hpp 2020-04-22 09:34:50.000000000 -0400
327 +++ b/boost/beast/http/impl/file_body_win32.hpp 2020-05-02 13:50:11.150761798 -0400
328 @@ -597,7 +597,7 @@
329 template<
330 class Protocol, class Executor,
331 bool isRequest, class Fields,
332 - class WriteHandler>
333 + BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
334 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
335 async_write_some(
336 net::basic_stream_socket<
337 diff -aruN a/boost/beast/http/impl/read.hpp b/boost/beast/http/impl/read.hpp
338 --- a/boost/beast/http/impl/read.hpp 2020-04-22 09:34:50.000000000 -0400
339 +++ b/boost/beast/http/impl/read.hpp 2020-05-02 13:50:11.150761798 -0400
340 @@ -304,7 +304,7 @@
341 class AsyncReadStream,
342 class DynamicBuffer,
343 bool isRequest,
344 - class ReadHandler>
345 + BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
346 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
347 async_read_some(
348 AsyncReadStream& stream,
349 @@ -373,7 +373,7 @@
350 class AsyncReadStream,
351 class DynamicBuffer,
352 bool isRequest,
353 - class ReadHandler>
354 + BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
355 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
356 async_read_header(
357 AsyncReadStream& stream,
358 @@ -443,7 +443,7 @@
359 class AsyncReadStream,
360 class DynamicBuffer,
361 bool isRequest,
362 - class ReadHandler>
363 + BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
364 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
365 async_read(
366 AsyncReadStream& stream,
367 @@ -531,7 +531,7 @@
368 class AsyncReadStream,
369 class DynamicBuffer,
370 bool isRequest, class Body, class Allocator,
371 - class ReadHandler>
372 + BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
373 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
374 async_read(
375 AsyncReadStream& stream,
376 diff -aruN a/boost/beast/http/impl/write.hpp b/boost/beast/http/impl/write.hpp
377 --- a/boost/beast/http/impl/write.hpp 2020-04-22 09:34:50.000000000 -0400
378 +++ b/boost/beast/http/impl/write.hpp 2020-05-02 13:50:11.150761798 -0400
379 @@ -463,7 +463,7 @@
380 template<
381 class AsyncWriteStream,
382 bool isRequest, class Body, class Fields,
383 - class WriteHandler>
384 + BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
385 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
386 async_write_some_impl(
387 AsyncWriteStream& stream,
388 @@ -526,7 +526,7 @@
389 template<
390 class AsyncWriteStream,
391 bool isRequest, class Body, class Fields,
392 - class WriteHandler>
393 + BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
394 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
395 async_write_some(
396 AsyncWriteStream& stream,
397 @@ -608,7 +608,7 @@
398 template<
399 class AsyncWriteStream,
400 bool isRequest, class Body, class Fields,
401 - class WriteHandler>
402 + BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
403 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
404 async_write_header(
405 AsyncWriteStream& stream,
406 @@ -681,7 +681,7 @@
407 template<
408 class AsyncWriteStream,
409 bool isRequest, class Body, class Fields,
410 - class WriteHandler>
411 + BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
412 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
413 async_write(
414 AsyncWriteStream& stream,
415 @@ -801,7 +801,7 @@
416 template<
417 class AsyncWriteStream,
418 bool isRequest, class Body, class Fields,
419 - class WriteHandler>
420 + BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
421 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
422 async_write(
423 AsyncWriteStream& stream,
424 @@ -830,7 +830,7 @@
425 template<
426 class AsyncWriteStream,
427 bool isRequest, class Body, class Fields,
428 - class WriteHandler>
429 + BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
430 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
431 async_write(
432 AsyncWriteStream& stream,
433 diff -aruN a/boost/beast/http/span_body.hpp b/boost/beast/http/span_body.hpp
434 --- a/boost/beast/http/span_body.hpp 2020-04-22 09:34:50.000000000 -0400
435 +++ b/boost/beast/http/span_body.hpp 2020-05-02 13:50:11.151761808 -0400
436 @@ -36,8 +36,10 @@
437 struct span_body
438 {
439 private:
440 - static_assert(std::is_pod<T>::value,
441 - "POD requirements not met");
442 + static_assert(
443 + std::is_trivial<T>::value &&
444 + std::is_standard_layout<T>::value,
445 + "POD requirements not met");
446
447 public:
448 /** The type of container used for the body
449 diff -aruN a/boost/beast/ssl/ssl_stream.hpp b/boost/beast/ssl/ssl_stream.hpp
450 --- a/boost/beast/ssl/ssl_stream.hpp 2020-04-22 09:34:50.000000000 -0400
451 +++ b/boost/beast/ssl/ssl_stream.hpp 2020-05-02 13:50:11.151761808 -0400
452 @@ -555,7 +555,7 @@
453 need to ensure that all data is written before the asynchronous operation
454 completes.
455 */
456 - template<class ConstBufferSequence, class WriteHandler>
457 + template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
458 BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void(boost::system::error_code, std::size_t))
459 async_write_some(ConstBufferSequence const& buffers,
460 BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
461 @@ -636,7 +636,7 @@
462 if you need to ensure that the requested amount of data is read before
463 the asynchronous operation completes.
464 */
465 - template<class MutableBufferSequence, class ReadHandler>
466 + template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
467 BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void(boost::system::error_code, std::size_t))
468 async_read_some(MutableBufferSequence const& buffers,
469 BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
470 diff -aruN a/boost/beast/version.hpp b/boost/beast/version.hpp
471 --- a/boost/beast/version.hpp 2020-04-22 09:34:50.000000000 -0400
472 +++ b/boost/beast/version.hpp 2020-05-02 13:50:11.151761808 -0400
473 @@ -20,7 +20,7 @@
474 This is a simple integer that is incremented by one every
475 time a set of code changes is merged to the develop branch.
476 */
477 -#define BOOST_BEAST_VERSION 290
478 +#define BOOST_BEAST_VERSION 292
479
480 #define BOOST_BEAST_VERSION_STRING "Boost.Beast/" BOOST_STRINGIZE(BOOST_BEAST_VERSION)
481
482 diff -aruN a/boost/beast/websocket/impl/accept.hpp b/boost/beast/websocket/impl/accept.hpp
483 --- a/boost/beast/websocket/impl/accept.hpp 2020-04-22 09:34:50.000000000 -0400
484 +++ b/boost/beast/websocket/impl/accept.hpp 2020-05-02 13:50:11.153761830 -0400
485 @@ -542,7 +542,7 @@
486
487 template<class NextLayer, bool deflateSupported>
488 template<
489 - class AcceptHandler>
490 + BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
491 BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
492 stream<NextLayer, deflateSupported>::
493 async_accept(
494 @@ -564,7 +564,7 @@
495 template<class NextLayer, bool deflateSupported>
496 template<
497 class ResponseDecorator,
498 - class AcceptHandler>
499 + BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
500 BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
501 stream<NextLayer, deflateSupported>::
502 async_accept_ex(
503 @@ -590,7 +590,7 @@
504 template<class NextLayer, bool deflateSupported>
505 template<
506 class ConstBufferSequence,
507 - class AcceptHandler>
508 + BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
509 BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
510 stream<NextLayer, deflateSupported>::
511 async_accept(
512 @@ -621,7 +621,7 @@
513 template<
514 class ConstBufferSequence,
515 class ResponseDecorator,
516 - class AcceptHandler>
517 + BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
518 BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
519 stream<NextLayer, deflateSupported>::
520 async_accept_ex(
521 @@ -654,7 +654,7 @@
522 template<class NextLayer, bool deflateSupported>
523 template<
524 class Body, class Allocator,
525 - class AcceptHandler>
526 + BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
527 BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
528 stream<NextLayer, deflateSupported>::
529 async_accept(
530 @@ -678,7 +678,7 @@
531 template<
532 class Body, class Allocator,
533 class ResponseDecorator,
534 - class AcceptHandler>
535 + BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
536 BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
537 stream<NextLayer, deflateSupported>::
538 async_accept_ex(
539 diff -aruN a/boost/beast/websocket/impl/close.hpp b/boost/beast/websocket/impl/close.hpp
540 --- a/boost/beast/websocket/impl/close.hpp 2020-04-22 09:34:50.000000000 -0400
541 +++ b/boost/beast/websocket/impl/close.hpp 2020-05-02 13:50:11.153761830 -0400
542 @@ -382,7 +382,7 @@
543 }
544
545 template<class NextLayer, bool deflateSupported>
546 -template<class CloseHandler>
547 +template<BOOST_BEAST_ASYNC_TPARAM1 CloseHandler>
548 BOOST_BEAST_ASYNC_RESULT1(CloseHandler)
549 stream<NextLayer, deflateSupported>::
550 async_close(close_reason const& cr, CloseHandler&& handler)
551 diff -aruN a/boost/beast/websocket/impl/handshake.hpp b/boost/beast/websocket/impl/handshake.hpp
552 --- a/boost/beast/websocket/impl/handshake.hpp 2020-04-22 09:34:50.000000000 -0400
553 +++ b/boost/beast/websocket/impl/handshake.hpp 2020-05-02 13:50:11.153761830 -0400
554 @@ -268,7 +268,7 @@
555 //------------------------------------------------------------------------------
556
557 template<class NextLayer, bool deflateSupported>
558 -template<class HandshakeHandler>
559 +template<BOOST_BEAST_ASYNC_TPARAM1 HandshakeHandler>
560 BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler)
561 stream<NextLayer, deflateSupported>::
562 async_handshake(
563 @@ -293,7 +293,7 @@
564 }
565
566 template<class NextLayer, bool deflateSupported>
567 -template<class HandshakeHandler>
568 +template<BOOST_BEAST_ASYNC_TPARAM1 HandshakeHandler>
569 BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler)
570 stream<NextLayer, deflateSupported>::
571 async_handshake(
572 diff -aruN a/boost/beast/websocket/impl/ping.hpp b/boost/beast/websocket/impl/ping.hpp
573 --- a/boost/beast/websocket/impl/ping.hpp 2020-04-22 09:34:50.000000000 -0400
574 +++ b/boost/beast/websocket/impl/ping.hpp 2020-05-02 13:50:11.153761830 -0400
575 @@ -288,7 +288,7 @@
576 }
577
578 template<class NextLayer, bool deflateSupported>
579 -template<class WriteHandler>
580 +template<BOOST_BEAST_ASYNC_TPARAM1 WriteHandler>
581 BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
582 stream<NextLayer, deflateSupported>::
583 async_ping(ping_data const& payload, WriteHandler&& handler)
584 @@ -306,7 +306,7 @@
585 }
586
587 template<class NextLayer, bool deflateSupported>
588 -template<class WriteHandler>
589 +template<BOOST_BEAST_ASYNC_TPARAM1 WriteHandler>
590 BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
591 stream<NextLayer, deflateSupported>::
592 async_pong(ping_data const& payload, WriteHandler&& handler)
593 diff -aruN a/boost/beast/websocket/impl/read.hpp b/boost/beast/websocket/impl/read.hpp
594 --- a/boost/beast/websocket/impl/read.hpp 2020-04-22 09:34:50.000000000 -0400
595 +++ b/boost/beast/websocket/impl/read.hpp 2020-05-02 13:50:11.153761830 -0400
596 @@ -804,7 +804,7 @@
597 }
598
599 template<class NextLayer, bool deflateSupported>
600 -template<class DynamicBuffer, class ReadHandler>
601 +template<class DynamicBuffer, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
602 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
603 stream<NextLayer, deflateSupported>::
604 async_read(DynamicBuffer& buffer, ReadHandler&& handler)
605 @@ -878,7 +878,7 @@
606 }
607
608 template<class NextLayer, bool deflateSupported>
609 -template<class DynamicBuffer, class ReadHandler>
610 +template<class DynamicBuffer, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
611 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
612 stream<NextLayer, deflateSupported>::
613 async_read_some(
614 @@ -1263,7 +1263,7 @@
615 }
616
617 template<class NextLayer, bool deflateSupported>
618 -template<class MutableBufferSequence, class ReadHandler>
619 +template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
620 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
621 stream<NextLayer, deflateSupported>::
622 async_read_some(
623 diff -aruN a/boost/beast/websocket/impl/write.hpp b/boost/beast/websocket/impl/write.hpp
624 --- a/boost/beast/websocket/impl/write.hpp 2020-04-22 09:34:50.000000000 -0400
625 +++ b/boost/beast/websocket/impl/write.hpp 2020-05-02 13:50:11.153761830 -0400
626 @@ -700,7 +700,7 @@
627 }
628
629 template<class NextLayer, bool deflateSupported>
630 -template<class ConstBufferSequence, class WriteHandler>
631 +template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
632 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
633 stream<NextLayer, deflateSupported>::
634 async_write_some(bool fin,
635 @@ -756,7 +756,7 @@
636 }
637
638 template<class NextLayer, bool deflateSupported>
639 -template<class ConstBufferSequence, class WriteHandler>
640 +template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
641 BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
642 stream<NextLayer, deflateSupported>::
643 async_write(
644 diff -aruN a/boost/beast/websocket/stream.hpp b/boost/beast/websocket/stream.hpp
645 --- a/boost/beast/websocket/stream.hpp 2020-04-22 09:34:50.000000000 -0400
646 +++ b/boost/beast/websocket/stream.hpp 2020-05-02 13:50:11.154761841 -0400
647 @@ -2634,7 +2634,7 @@
648
649 template<
650 class ResponseDecorator,
651 - class AcceptHandler>
652 + BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
653 BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
654 async_accept_ex(
655 ResponseDecorator const& decorator,
656 @@ -2643,7 +2643,7 @@
657 template<
658 class ConstBufferSequence,
659 class ResponseDecorator,
660 - class AcceptHandler>
661 + BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
662 BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
663 async_accept_ex(
664 ConstBufferSequence const& buffers,
665 @@ -2656,7 +2656,7 @@
666 template<
667 class Body, class Allocator,
668 class ResponseDecorator,
669 - class AcceptHandler>
670 + BOOST_BEAST_ASYNC_TPARAM1 AcceptHandler>
671 BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)
672 async_accept_ex(
673 http::request<Body,
674 diff -aruN a/libs/beast/CHANGELOG.md b/libs/beast/CHANGELOG.md
675 --- a/libs/beast/CHANGELOG.md 2020-04-22 09:34:50.000000000 -0400
676 +++ b/libs/beast/CHANGELOG.md 2020-05-02 13:51:02.388315008 -0400
677 @@ -1,3 +1,25 @@
678 +Version 292:
679 +
680 +* Fix compile errors on Visual Studio with /std:c++latest
681 +* Fix standalone compilation error with std::string_view
682 +* OpenSSL 1.0.2 or later is required
683 +* Fix c++20 deprecation warning in span_body
684 +
685 +--------------------------------------------------------------------------------
686 +
687 +Version 291:
688 +
689 +* Test websocket with use_awaitable
690 +* Test http write with use_awaitable
691 +* Test http read with use_awaitable
692 +* Fix use buffered_read_stream with use_awaitable
693 +* Implement is_completion_token_for trait
694 +* Test use_awaitable with basic_stream
695 +* Fix async_detect_ssl with use_awaitable
696 +* Add clang coroutines-ts to circleci config
697 +
698 +--------------------------------------------------------------------------------
699 +
700 Version 290:
701
702 * Travis build host now bionic
703 diff -aruN a/libs/beast/CMakeLists.txt b/libs/beast/CMakeLists.txt
704 --- a/libs/beast/CMakeLists.txt 2020-04-22 09:34:50.000000000 -0400
705 +++ b/libs/beast/CMakeLists.txt 2020-05-02 13:51:02.389315019 -0400
706 @@ -40,7 +40,7 @@
707 #
708 #-------------------------------------------------------------------------------
709
710 -project (Beast VERSION 290)
711 +project (Beast VERSION 292)
712
713 set_property (GLOBAL PROPERTY USE_FOLDERS ON)
714 option (Beast_BUILD_EXAMPLES "Build examples" ON)
715 diff -aruN a/libs/beast/doc/qbk/01_intro/_intro.qbk b/libs/beast/doc/qbk/01_intro/_intro.qbk
716 --- a/libs/beast/doc/qbk/01_intro/_intro.qbk 2020-04-22 09:34:50.000000000 -0400
717 +++ b/libs/beast/doc/qbk/01_intro/_intro.qbk 2020-05-02 13:51:02.391315040 -0400
718 @@ -58,7 +58,7 @@
719
720 * [*C++11:] Robust support for most language features.
721 * [*Boost:] Beast only works with Boost, not stand-alone Asio
722 -* [*OpenSSL:] Required to build the tests, examples, and to use TLS/Secure sockets.
723 +* [*OpenSSL:] Version 1.0.2 or higher. Required to build the tests, examples, and to use TLS/Secure sockets.
724
725 Tested with these compilers: msvc-14+, gcc 4.8.4+, clang 3.6+.
726
727 diff -aruN a/libs/beast/test/beast/core/async_base.cpp b/libs/beast/test/beast/core/async_base.cpp
728 --- a/libs/beast/test/beast/core/async_base.cpp 2020-04-22 09:34:50.000000000 -0400
729 +++ b/libs/beast/test/beast/core/async_base.cpp 2020-05-02 13:51:02.470315892 -0400
730 @@ -585,7 +585,7 @@
731 //--------------------------------------------------------------------------
732
733 // Asynchronously read into a buffer until the buffer is full, or an error occurs
734 - template<class AsyncReadStream, class ReadHandler>
735 + template<class AsyncReadStream, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
736 typename net::async_result<ReadHandler, void(error_code, std::size_t)>::return_type
737 async_read(AsyncReadStream& stream, net::mutable_buffer buffer, ReadHandler&& handler)
738 {
739 diff -aruN a/libs/beast/test/beast/core/basic_stream.cpp b/libs/beast/test/beast/core/basic_stream.cpp
740 --- a/libs/beast/test/beast/core/basic_stream.cpp 2020-04-22 09:34:50.000000000 -0400
741 +++ b/libs/beast/test/beast/core/basic_stream.cpp 2020-05-02 13:51:02.470315892 -0400
742 @@ -30,6 +30,13 @@
743 #include <array>
744 #include <thread>
745
746 +#if BOOST_ASIO_HAS_CO_AWAIT
747 +#include <boost/asio/awaitable.hpp>
748 +#include <boost/asio/co_spawn.hpp>
749 +#include <boost/asio/use_awaitable.hpp>
750 +#endif
751 +
752 +
753 namespace boost {
754 namespace beast {
755
756 @@ -258,7 +265,7 @@
757 {
758 string_view s_;
759 net::ip::tcp::socket socket_;
760 -
761 +
762 public:
763 session(
764 string_view s,
765 @@ -1297,6 +1304,52 @@
766
767 //--------------------------------------------------------------------------
768
769 +#if BOOST_ASIO_HAS_CO_AWAIT
770 + void testAwaitableCompilation(
771 + basic_stream<net::ip::tcp>& stream,
772 + net::mutable_buffer outbuf,
773 + net::const_buffer inbuf,
774 + net::ip::tcp::resolver::results_type resolve_results)
775 + {
776 + static_assert(std::is_same_v<
777 + net::awaitable<std::size_t>, decltype(
778 + stream.async_read_some(outbuf, net::use_awaitable))>);
779 +
780 + static_assert(std::is_same_v<
781 + net::awaitable<std::size_t>, decltype(
782 + stream.async_write_some(inbuf, net::use_awaitable))>);
783 +
784 + static_assert(std::is_same_v<
785 + net::awaitable<net::ip::tcp::resolver::results_type::const_iterator>, decltype(
786 + stream.async_connect(
787 + resolve_results.begin(),
788 + resolve_results.end(),
789 + net::use_awaitable))>);
790 +
791 + static_assert(std::is_same_v<
792 + net::awaitable<net::ip::tcp::endpoint>, decltype(
793 + stream.async_connect(
794 + resolve_results,
795 + net::use_awaitable))>);
796 +
797 + static_assert(std::is_same_v<
798 + net::awaitable<void>, decltype(
799 + stream.async_connect(
800 + resolve_results.begin()->endpoint(),
801 + net::use_awaitable))>);
802 +
803 + auto comparison_function = [](error_code&, net::ip::tcp::endpoint) { return true; };
804 +
805 + static_assert(std::is_same_v<
806 + net::awaitable<net::ip::tcp::resolver::results_type::const_iterator>, decltype(
807 + stream.async_connect(
808 + resolve_results.begin(),
809 + resolve_results.end(),
810 + comparison_function,
811 + net::use_awaitable))>);
812 + }
813 +#endif
814 +
815 void
816 run()
817 {
818 @@ -1307,6 +1360,11 @@
819 testMembers();
820 testJavadocs();
821 testIssue1589();
822 +
823 +#if BOOST_ASIO_HAS_CO_AWAIT
824 + // test for compilation success only
825 + boost::ignore_unused(&basic_stream_test::testAwaitableCompilation);
826 +#endif
827 }
828 };
829
830 diff -aruN a/libs/beast/test/beast/core/buffered_read_stream.cpp b/libs/beast/test/beast/core/buffered_read_stream.cpp
831 --- a/libs/beast/test/beast/core/buffered_read_stream.cpp 2020-04-22 09:34:50.000000000 -0400
832 +++ b/libs/beast/test/beast/core/buffered_read_stream.cpp 2020-05-02 13:51:02.470315892 -0400
833 @@ -21,6 +21,9 @@
834 #include <boost/asio/spawn.hpp>
835 #include <boost/asio/strand.hpp>
836 #include <boost/optional.hpp>
837 +#if BOOST_ASIO_HAS_CO_AWAIT
838 +#include <boost/asio/use_awaitable.hpp>
839 +#endif
840
841 namespace boost {
842 namespace beast {
843 @@ -211,6 +214,22 @@
844 }
845 };
846
847 +#if BOOST_ASIO_HAS_CO_AWAIT
848 + void testAwaitableCompiles(
849 + buffered_read_stream<test::stream, flat_buffer>& stream,
850 + net::mutable_buffer rxbuf,
851 + net::const_buffer txbuf)
852 + {
853 + static_assert(std::is_same_v<
854 + net::awaitable<std::size_t>, decltype(
855 + stream.async_read_some(rxbuf, net::use_awaitable))>);
856 +
857 + static_assert(std::is_same_v<
858 + net::awaitable<std::size_t>, decltype(
859 + stream.async_write_some(txbuf, net::use_awaitable))>);
860 + }
861 +#endif
862 +
863 void run() override
864 {
865 testSpecialMembers();
866 @@ -221,6 +240,10 @@
867 });
868
869 testAsyncLoop();
870 +
871 +#if BOOST_ASIO_HAS_CO_AWAIT
872 + boost::ignore_unused(&buffered_read_stream_test::testAwaitableCompiles);
873 +#endif
874 }
875 };
876
877 diff -aruN a/libs/beast/test/beast/core/detect_ssl.cpp b/libs/beast/test/beast/core/detect_ssl.cpp
878 --- a/libs/beast/test/beast/core/detect_ssl.cpp 2020-04-22 09:34:50.000000000 -0400
879 +++ b/libs/beast/test/beast/core/detect_ssl.cpp 2020-05-02 13:51:02.470315892 -0400
880 @@ -16,6 +16,11 @@
881 #include <boost/beast/core/flat_buffer.hpp>
882 #include <boost/beast/core/string.hpp>
883 #include <boost/core/exchange.hpp>
884 +#if BOOST_ASIO_HAS_CO_AWAIT
885 +#include <boost/asio/awaitable.hpp>
886 +#include <boost/asio/co_spawn.hpp>
887 +#include <boost/asio/use_awaitable.hpp>
888 +#endif
889 namespace boost {
890 namespace beast {
891
892 @@ -166,12 +171,25 @@
893 }
894 }
895
896 +#if BOOST_ASIO_HAS_CO_AWAIT
897 + void testAwaitableCompiles(test::stream& stream, flat_buffer& b)
898 + {
899 + static_assert(
900 + std::is_same_v<
901 + net::awaitable<bool>, decltype(
902 + async_detect_ssl(stream, b, net::use_awaitable))>);
903 + }
904 +#endif
905 +
906 void
907 run() override
908 {
909 testDetect();
910 testRead();
911 testAsyncRead();
912 +#if BOOST_ASIO_HAS_CO_AWAIT
913 + boost::ignore_unused(&detect_ssl_test::testAwaitableCompiles);
914 +#endif
915 }
916 };
917
918 diff -aruN a/libs/beast/test/beast/core/flat_stream.cpp b/libs/beast/test/beast/core/flat_stream.cpp
919 --- a/libs/beast/test/beast/core/flat_stream.cpp 2020-04-22 09:34:50.000000000 -0400
920 +++ b/libs/beast/test/beast/core/flat_stream.cpp 2020-05-02 13:51:02.471315902 -0400
921 @@ -17,6 +17,9 @@
922 #include <boost/beast/core/role.hpp>
923 #include <initializer_list>
924 #include <vector>
925 +#if BOOST_ASIO_HAS_CO_AWAIT
926 +#include <boost/asio/use_awaitable.hpp>
927 +#endif
928
929 namespace boost {
930 namespace beast {
931 @@ -208,11 +211,30 @@
932 check({1,2,3,4}, 3, 3, true);
933 }
934
935 +#if BOOST_ASIO_HAS_CO_AWAIT
936 + void testAwaitableCompiles(
937 + flat_stream<test::stream>& stream,
938 + net::mutable_buffer rxbuf,
939 + net::const_buffer txbuf)
940 + {
941 + static_assert(std::is_same_v<
942 + net::awaitable<std::size_t>, decltype(
943 + stream.async_read_some(rxbuf, net::use_awaitable))>);
944 +
945 + static_assert(std::is_same_v<
946 + net::awaitable<std::size_t>, decltype(
947 + stream.async_write_some(txbuf, net::use_awaitable))>);
948 + }
949 +#endif
950 +
951 void
952 run() override
953 {
954 testMembers();
955 testSplit();
956 +#if BOOST_ASIO_HAS_CO_AWAIT
957 + boost::ignore_unused(&flat_stream_test::testAwaitableCompiles);
958 +#endif
959 }
960 };
961
962 diff -aruN a/libs/beast/test/beast/core/stream_traits.cpp b/libs/beast/test/beast/core/stream_traits.cpp
963 --- a/libs/beast/test/beast/core/stream_traits.cpp 2020-04-22 09:34:50.000000000 -0400
964 +++ b/libs/beast/test/beast/core/stream_traits.cpp 2020-05-02 13:51:02.471315902 -0400
965 @@ -214,14 +214,14 @@
966 struct async_read_stream
967 {
968 net::io_context::executor_type get_executor() noexcept;
969 - template<class MutableBufferSequence, class ReadHandler>
970 + template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
971 void async_read_some(MutableBufferSequence const&, ReadHandler&&);
972 };
973
974 struct async_write_stream
975 {
976 net::io_context::executor_type get_executor() noexcept;
977 - template<class ConstBufferSequence, class WriteHandler>
978 + template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
979 void async_write_some(ConstBufferSequence const&, WriteHandler&&);
980 };
981
982 @@ -232,9 +232,9 @@
983 struct async_stream : async_read_stream, async_write_stream
984 {
985 net::io_context::executor_type get_executor() noexcept;
986 - template<class MutableBufferSequence, class ReadHandler>
987 + template<class MutableBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
988 void async_read_some(MutableBufferSequence const&, ReadHandler&&);
989 - template<class ConstBufferSequence, class WriteHandler>
990 + template<class ConstBufferSequence, BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
991 void async_write_some(ConstBufferSequence const&, WriteHandler&&);
992 };
993
994 diff -aruN a/libs/beast/test/beast/http/CMakeLists.txt b/libs/beast/test/beast/http/CMakeLists.txt
995 --- a/libs/beast/test/beast/http/CMakeLists.txt 2020-04-22 09:34:50.000000000 -0400
996 +++ b/libs/beast/test/beast/http/CMakeLists.txt 2020-05-02 13:51:02.472315914 -0400
997 @@ -26,6 +26,7 @@
998 empty_body.cpp
999 error.cpp
1000 field.cpp
1001 + field_compiles.cpp
1002 fields.cpp
1003 file_body.cpp
1004 message.cpp
1005 diff -aruN a/libs/beast/test/beast/http/field_compiles.cpp b/libs/beast/test/beast/http/field_compiles.cpp
1006 --- a/libs/beast/test/beast/http/field_compiles.cpp 1969-12-31 19:00:00.000000000 -0500
1007 +++ b/libs/beast/test/beast/http/field_compiles.cpp 2020-05-02 13:51:02.473315924 -0400
1008 @@ -0,0 +1,11 @@
1009 +//
1010 +// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
1011 +//
1012 +// Distributed under the Boost Software License, Version 1.0. (See accompanying
1013 +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
1014 +//
1015 +// Official repository: https://github.com/boostorg/beast
1016 +//
1017 +
1018 +// Test that header file is self-contained.
1019 +#include <boost/beast/http/field.hpp>
1020 diff -aruN a/libs/beast/test/beast/http/Jamfile b/libs/beast/test/beast/http/Jamfile
1021 --- a/libs/beast/test/beast/http/Jamfile 2020-04-22 09:34:50.000000000 -0400
1022 +++ b/libs/beast/test/beast/http/Jamfile 2020-05-02 13:51:02.472315914 -0400
1023 @@ -16,6 +16,7 @@
1024 dynamic_body.cpp
1025 error.cpp
1026 field.cpp
1027 + field_compiles.cpp
1028 fields.cpp
1029 file_body.cpp
1030 message.cpp
1031 diff -aruN a/libs/beast/test/beast/http/read.cpp b/libs/beast/test/beast/http/read.cpp
1032 --- a/libs/beast/test/beast/http/read.cpp 2020-04-22 09:34:50.000000000 -0400
1033 +++ b/libs/beast/test/beast/http/read.cpp 2020-05-02 13:51:02.472315914 -0400
1034 @@ -25,6 +25,9 @@
1035 #include <boost/asio/strand.hpp>
1036 #include <boost/asio/ip/tcp.hpp>
1037 #include <atomic>
1038 +#if BOOST_ASIO_HAS_CO_AWAIT
1039 +#include <boost/asio/use_awaitable.hpp>
1040 +#endif
1041
1042 namespace boost {
1043 namespace beast {
1044 @@ -529,6 +532,49 @@
1045 }
1046 }
1047
1048 +#if BOOST_ASIO_HAS_CO_AWAIT
1049 + void testAwaitableCompiles(
1050 + test::stream& stream,
1051 + flat_buffer& dynbuf,
1052 + parser<true, string_body>& request_parser,
1053 + request<http::string_body>& request,
1054 + parser<false, string_body>& response_parser,
1055 + response<http::string_body>& response)
1056 + {
1057 + static_assert(std::is_same_v<
1058 + net::awaitable<std::size_t>, decltype(
1059 + http::async_read(stream, dynbuf, request, net::use_awaitable))>);
1060 +
1061 + static_assert(std::is_same_v<
1062 + net::awaitable<std::size_t>, decltype(
1063 + http::async_read(stream, dynbuf, request_parser, net::use_awaitable))>);
1064 +
1065 + static_assert(std::is_same_v<
1066 + net::awaitable<std::size_t>, decltype(
1067 + http::async_read(stream, dynbuf, response, net::use_awaitable))>);
1068 +
1069 + static_assert(std::is_same_v<
1070 + net::awaitable<std::size_t>, decltype(
1071 + http::async_read(stream, dynbuf, response_parser, net::use_awaitable))>);
1072 +
1073 + static_assert(std::is_same_v<
1074 + net::awaitable<std::size_t>, decltype(
1075 + http::async_read_some(stream, dynbuf, request_parser, net::use_awaitable))>);
1076 +
1077 + static_assert(std::is_same_v<
1078 + net::awaitable<std::size_t>, decltype(
1079 + http::async_read_some(stream, dynbuf, response_parser, net::use_awaitable))>);
1080 +
1081 + static_assert(std::is_same_v<
1082 + net::awaitable<std::size_t>, decltype(
1083 + http::async_read_header(stream, dynbuf, request_parser, net::use_awaitable))>);
1084 +
1085 + static_assert(std::is_same_v<
1086 + net::awaitable<std::size_t>, decltype(
1087 + http::async_read_header(stream, dynbuf, response_parser, net::use_awaitable))>);
1088 + }
1089 +#endif
1090 +
1091 void
1092 run() override
1093 {
1094 @@ -552,6 +598,9 @@
1095 testRegression430();
1096 testReadGrind();
1097 testAsioHandlerInvoke();
1098 +#if BOOST_ASIO_HAS_CO_AWAIT
1099 + boost::ignore_unused(&read_test::testAwaitableCompiles);
1100 +#endif
1101 }
1102 };
1103
1104 diff -aruN a/libs/beast/test/beast/http/write.cpp b/libs/beast/test/beast/http/write.cpp
1105 --- a/libs/beast/test/beast/http/write.cpp 2020-04-22 09:34:50.000000000 -0400
1106 +++ b/libs/beast/test/beast/http/write.cpp 2020-05-02 13:51:02.473315924 -0400
1107 @@ -26,6 +26,9 @@
1108 #include <boost/asio/strand.hpp>
1109 #include <sstream>
1110 #include <string>
1111 +#if BOOST_ASIO_HAS_CO_AWAIT
1112 +#include <boost/asio/use_awaitable.hpp>
1113 +#endif
1114
1115 namespace boost {
1116 namespace beast {
1117 @@ -994,6 +997,59 @@
1118 }
1119 }
1120
1121 +#if BOOST_ASIO_HAS_CO_AWAIT
1122 + void testAwaitableCompiles(
1123 + test::stream& stream,
1124 + serializer<true, string_body>& request_serializer,
1125 + request<string_body>& req,
1126 + request<string_body> const& creq,
1127 + serializer<false, string_body>& response_serializer,
1128 + response<string_body>& resp,
1129 + response<string_body> const& cresp)
1130 + {
1131 + static_assert(std::is_same_v<
1132 + net::awaitable<std::size_t>, decltype(
1133 + http::async_write(stream, request_serializer, net::use_awaitable))>);
1134 +
1135 + static_assert(std::is_same_v<
1136 + net::awaitable<std::size_t>, decltype(
1137 + http::async_write(stream, response_serializer, net::use_awaitable))>);
1138 +
1139 + static_assert(std::is_same_v<
1140 + net::awaitable<std::size_t>, decltype(
1141 + http::async_write(stream, req, net::use_awaitable))>);
1142 +
1143 + static_assert(std::is_same_v<
1144 + net::awaitable<std::size_t>, decltype(
1145 + http::async_write(stream, creq, net::use_awaitable))>);
1146 +
1147 + static_assert(std::is_same_v<
1148 + net::awaitable<std::size_t>, decltype(
1149 + http::async_write(stream, resp, net::use_awaitable))>);
1150 +
1151 + static_assert(std::is_same_v<
1152 + net::awaitable<std::size_t>, decltype(
1153 + http::async_write(stream, cresp, net::use_awaitable))>);
1154 +
1155 + static_assert(std::is_same_v<
1156 + net::awaitable<std::size_t>, decltype(
1157 + http::async_write_some(stream, request_serializer, net::use_awaitable))>);
1158 +
1159 + static_assert(std::is_same_v<
1160 + net::awaitable<std::size_t>, decltype(
1161 + http::async_write_some(stream, response_serializer, net::use_awaitable))>);
1162 +
1163 + static_assert(std::is_same_v<
1164 + net::awaitable<std::size_t>, decltype(
1165 + http::async_write_header(stream, request_serializer, net::use_awaitable))>);
1166 +
1167 + static_assert(std::is_same_v<
1168 + net::awaitable<std::size_t>, decltype(
1169 + http::async_write_header(stream, response_serializer, net::use_awaitable))>);
1170 + }
1171 +#endif
1172 +
1173 +
1174 void
1175 run() override
1176 {
1177 @@ -1017,6 +1073,9 @@
1178 });
1179 testAsioHandlerInvoke();
1180 testBodyWriters();
1181 +#if BOOST_ASIO_HAS_CO_AWAIT
1182 + boost::ignore_unused(&write_test::testAwaitableCompiles);
1183 +#endif
1184 }
1185 };
1186
1187 diff -aruN a/libs/beast/test/beast/websocket/accept.cpp b/libs/beast/test/beast/websocket/accept.cpp
1188 --- a/libs/beast/test/beast/websocket/accept.cpp 2020-04-22 09:34:50.000000000 -0400
1189 +++ b/libs/beast/test/beast/websocket/accept.cpp 2020-05-02 13:51:02.473315924 -0400
1190 @@ -14,7 +14,9 @@
1191 #include <boost/beast/_experimental/test/tcp.hpp>
1192 #include <boost/beast/_experimental/unit_test/suite.hpp>
1193 #include "test.hpp"
1194 -
1195 +#if BOOST_ASIO_HAS_CO_AWAIT
1196 +#include <boost/asio/use_awaitable.hpp>
1197 +#endif
1198 namespace boost {
1199 namespace beast {
1200 namespace websocket {
1201 @@ -810,6 +812,27 @@
1202 }
1203 }
1204
1205 +#if BOOST_ASIO_HAS_CO_AWAIT
1206 + void testAwaitableCompiles(
1207 + stream<net::ip::tcp::socket>& s,
1208 + http::request<http::empty_body>& req,
1209 + net::mutable_buffer buf
1210 + )
1211 + {
1212 + static_assert(std::is_same_v<
1213 + net::awaitable<void>, decltype(
1214 + s.async_accept(net::use_awaitable))>);
1215 +
1216 + static_assert(std::is_same_v<
1217 + net::awaitable<void>, decltype(
1218 + s.async_accept(req, net::use_awaitable))>);
1219 +
1220 + static_assert(std::is_same_v<
1221 + net::awaitable<void>, decltype(
1222 + s.async_accept(buf, net::use_awaitable))>);
1223 + }
1224 +#endif
1225 +
1226 void
1227 run() override
1228 {
1229 @@ -820,6 +843,9 @@
1230 testInvalidInputs();
1231 testEndOfStream();
1232 testAsync();
1233 +#if BOOST_ASIO_HAS_CO_AWAIT
1234 + boost::ignore_unused(&accept_test::testAwaitableCompiles);
1235 +#endif
1236 }
1237 };
1238
1239 diff -aruN a/libs/beast/test/beast/websocket/close.cpp b/libs/beast/test/beast/websocket/close.cpp
1240 --- a/libs/beast/test/beast/websocket/close.cpp 2020-04-22 09:34:50.000000000 -0400
1241 +++ b/libs/beast/test/beast/websocket/close.cpp 2020-05-02 13:51:02.473315924 -0400
1242 @@ -16,6 +16,9 @@
1243
1244 #include <boost/asio/io_context.hpp>
1245 #include <boost/asio/strand.hpp>
1246 +#if BOOST_ASIO_HAS_CO_AWAIT
1247 +#include <boost/asio/use_awaitable.hpp>
1248 +#endif
1249
1250 namespace boost {
1251 namespace beast {
1252 @@ -735,6 +738,15 @@
1253 }
1254 };
1255
1256 +#if BOOST_ASIO_HAS_CO_AWAIT
1257 + void testAwaitableCompiles(stream<test::stream>& s, close_reason cr )
1258 + {
1259 + static_assert(std::is_same_v<
1260 + net::awaitable<void>, decltype(
1261 + s.async_close(cr, net::use_awaitable))>);
1262 + }
1263 +#endif
1264 +
1265 void
1266 run() override
1267 {
1268 @@ -742,6 +754,9 @@
1269 testTimeout();
1270 testSuspend();
1271 testMoveOnly();
1272 +#if BOOST_ASIO_HAS_CO_AWAIT
1273 + boost::ignore_unused(&close_test::testAwaitableCompiles);
1274 +#endif
1275 }
1276 };
1277
1278 diff -aruN a/libs/beast/test/beast/websocket/handshake.cpp b/libs/beast/test/beast/websocket/handshake.cpp
1279 --- a/libs/beast/test/beast/websocket/handshake.cpp 2020-04-22 09:34:50.000000000 -0400
1280 +++ b/libs/beast/test/beast/websocket/handshake.cpp 2020-05-02 13:51:02.473315924 -0400
1281 @@ -18,6 +18,9 @@
1282 #include <boost/asio/io_context.hpp>
1283 #include <boost/asio/strand.hpp>
1284 #include <thread>
1285 +#if BOOST_ASIO_HAS_CO_AWAIT
1286 +#include <boost/asio/use_awaitable.hpp>
1287 +#endif
1288
1289 namespace boost {
1290 namespace beast {
1291 @@ -704,6 +707,23 @@
1292 }
1293 }
1294
1295 +#if BOOST_ASIO_HAS_CO_AWAIT
1296 + void testAwaitableCompiles(
1297 + stream<test::stream>& s,
1298 + std::string host,
1299 + std::string port,
1300 + response_type& resp)
1301 + {
1302 + static_assert(std::is_same_v<
1303 + net::awaitable<void>, decltype(
1304 + s.async_handshake(host, port, net::use_awaitable))>);
1305 +
1306 + static_assert(std::is_same_v<
1307 + net::awaitable<void>, decltype(
1308 + s.async_handshake(resp, host, port, net::use_awaitable))>);
1309 + }
1310 +#endif
1311 +
1312 void
1313 run() override
1314 {
1315 @@ -714,6 +734,9 @@
1316 testMoveOnly();
1317 testAsync();
1318 testIssue1460();
1319 +#if BOOST_ASIO_HAS_CO_AWAIT
1320 + boost::ignore_unused(&handshake_test::testAwaitableCompiles);
1321 +#endif
1322 }
1323 };
1324
1325 diff -aruN a/libs/beast/test/beast/websocket/ping.cpp b/libs/beast/test/beast/websocket/ping.cpp
1326 --- a/libs/beast/test/beast/websocket/ping.cpp 2020-04-22 09:34:50.000000000 -0400
1327 +++ b/libs/beast/test/beast/websocket/ping.cpp 2020-05-02 13:51:02.474315935 -0400
1328 @@ -18,6 +18,10 @@
1329 #include <boost/asio/io_context.hpp>
1330 #include <boost/asio/strand.hpp>
1331
1332 +#if BOOST_ASIO_HAS_CO_AWAIT
1333 +#include <boost/asio/use_awaitable.hpp>
1334 +#endif
1335 +
1336 namespace boost {
1337 namespace beast {
1338 namespace websocket {
1339 @@ -483,12 +487,30 @@
1340 }
1341 };
1342
1343 +#if BOOST_ASIO_HAS_CO_AWAIT
1344 + void testAwaitableCompiles(
1345 + stream<test::stream>& s,
1346 + ping_data& pdat)
1347 + {
1348 + static_assert(std::is_same_v<
1349 + net::awaitable<void>, decltype(
1350 + s.async_ping(pdat, net::use_awaitable))>);
1351 +
1352 + static_assert(std::is_same_v<
1353 + net::awaitable<void>, decltype(
1354 + s.async_pong(pdat, net::use_awaitable))>);
1355 + }
1356 +#endif
1357 +
1358 void
1359 run() override
1360 {
1361 testPing();
1362 testSuspend();
1363 testMoveOnly();
1364 +#if BOOST_ASIO_HAS_CO_AWAIT
1365 + boost::ignore_unused(&ping_test::testAwaitableCompiles);
1366 +#endif
1367 }
1368 };
1369
1370 diff -aruN a/libs/beast/test/beast/websocket/read2.cpp b/libs/beast/test/beast/websocket/read2.cpp
1371 --- a/libs/beast/test/beast/websocket/read2.cpp 2020-04-22 09:34:50.000000000 -0400
1372 +++ b/libs/beast/test/beast/websocket/read2.cpp 2020-05-02 13:51:02.474315935 -0400
1373 @@ -14,6 +14,10 @@
1374
1375 #include <boost/asio/write.hpp>
1376
1377 +#if BOOST_ASIO_HAS_CO_AWAIT
1378 +#include <boost/asio/use_awaitable.hpp>
1379 +#endif
1380 +
1381 #include <boost/config/workaround.hpp>
1382 #if BOOST_WORKAROUND(BOOST_GCC, < 80200)
1383 #define BOOST_BEAST_SYMBOL_HIDDEN __attribute__ ((visibility("hidden")))
1384 @@ -673,10 +677,34 @@
1385 }
1386 }
1387
1388 +#if BOOST_ASIO_HAS_CO_AWAIT
1389 + void testAwaitableCompiles(
1390 + stream<test::stream>& s,
1391 + flat_buffer& dynbuf,
1392 + net::mutable_buffer buf,
1393 + std::size_t limit)
1394 + {
1395 + static_assert(std::is_same_v<
1396 + net::awaitable<std::size_t>, decltype(
1397 + s.async_read(dynbuf, net::use_awaitable))>);
1398 +
1399 + static_assert(std::is_same_v<
1400 + net::awaitable<std::size_t>, decltype(
1401 + s.async_read_some(buf, net::use_awaitable))>);
1402 +
1403 + static_assert(std::is_same_v<
1404 + net::awaitable<std::size_t>, decltype(
1405 + s.async_read_some(dynbuf, limit, net::use_awaitable))>);
1406 + }
1407 +#endif
1408 +
1409 void
1410 run() override
1411 {
1412 testRead();
1413 +#if BOOST_ASIO_HAS_CO_AWAIT
1414 + boost::ignore_unused(&read2_test::testAwaitableCompiles);
1415 +#endif
1416 }
1417 };
1418
1419 diff -aruN a/libs/beast/test/beast/websocket/write.cpp b/libs/beast/test/beast/websocket/write.cpp
1420 --- a/libs/beast/test/beast/websocket/write.cpp 2020-04-22 09:34:50.000000000 -0400
1421 +++ b/libs/beast/test/beast/websocket/write.cpp 2020-05-02 13:51:02.474315935 -0400
1422 @@ -13,6 +13,10 @@
1423 #include <boost/asio/io_context.hpp>
1424 #include <boost/asio/strand.hpp>
1425
1426 +#if BOOST_ASIO_HAS_CO_AWAIT
1427 +#include <boost/asio/use_awaitable.hpp>
1428 +#endif
1429 +
1430 #include "test.hpp"
1431
1432 namespace boost {
1433 @@ -716,6 +720,22 @@
1434 BEAST_EXPECT(n1 < n0 + s.size());
1435 }
1436
1437 +#if BOOST_ASIO_HAS_CO_AWAIT
1438 + void testAwaitableCompiles(
1439 + stream<test::stream>& s,
1440 + net::mutable_buffer buf,
1441 + bool fin)
1442 + {
1443 + static_assert(std::is_same_v<
1444 + net::awaitable<std::size_t>, decltype(
1445 + s.async_write(buf, net::use_awaitable))>);
1446 +
1447 + static_assert(std::is_same_v<
1448 + net::awaitable<std::size_t>, decltype(
1449 + s.async_write_some(fin, buf, net::use_awaitable))>);
1450 + }
1451 +#endif
1452 +
1453 void
1454 run() override
1455 {
1456 @@ -726,6 +746,9 @@
1457 testMoveOnly();
1458 testIssue300();
1459 testIssue1666();
1460 +#if BOOST_ASIO_HAS_CO_AWAIT
1461 + boost::ignore_unused(&write_test::testAwaitableCompiles);
1462 +#endif
1463 }
1464 };
1465