You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1465 lines
49 KiB

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