2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_HTTP_READ_HPP
11 #define BOOST_BEAST_HTTP_READ_HPP
13 #include <boost/beast/core/detail/config.hpp>
14 #include <boost/beast/core/error.hpp>
15 #include <boost/beast/core/stream_traits.hpp>
16 #include <boost/beast/http/basic_parser.hpp>
17 #include <boost/beast/http/message.hpp>
18 #include <boost/asio/async_result.hpp>
24 //------------------------------------------------------------------------------
26 /** Read part of a message from a stream using a parser.
28 This function is used to read part of a message from a stream into an
29 instance of @ref basic_parser. The call will block until one of the
30 following conditions is true:
32 @li A call to @ref basic_parser::put with a non-empty buffer sequence
37 This operation is implemented in terms of one or more calls to the stream's
38 `read_some` function. The implementation may read additional bytes from
39 the stream that lie past the end of the message being read. These additional
40 bytes are stored in the dynamic buffer, which must be preserved for
43 If the end of file error is received while reading from the stream, then
44 the error returned from this function will be:
46 @li @ref error::end_of_stream if no bytes were parsed, or
48 @li @ref error::partial_message if any bytes were parsed but the
49 message was incomplete, otherwise:
51 @li A successful result. The next attempt to read will return
52 @ref error::end_of_stream
54 @param stream The stream from which the data is to be read. The type must
55 meet the <em>SyncReadStream</em> requirements.
57 @param buffer Storage for additional bytes read by the implementation from
58 the stream. This is both an input and an output parameter; on entry, the
59 parser will be presented with any remaining data in the dynamic buffer's
60 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
63 @param parser The parser to use.
65 @return The number of bytes transferred from the stream.
67 @throws system_error Thrown on failure.
69 @note The function returns the total number of bytes transferred from the
70 stream. This may be zero for the case where there is sufficient pre-existing
71 message data in the dynamic buffer.
79 SyncReadStream& stream,
80 DynamicBuffer& buffer,
81 basic_parser<isRequest>& parser);
83 /** Read part of a message from a stream using a parser.
85 This function is used to read part of a message from a stream into an
86 instance of @ref basic_parser. The call will block until one of the
87 following conditions is true:
89 @li A call to @ref basic_parser::put with a non-empty buffer sequence
94 This operation is implemented in terms of one or more calls to the stream's
95 `read_some` function. The implementation may read additional bytes from
96 the stream that lie past the end of the message being read. These additional
97 bytes are stored in the dynamic buffer, which must be preserved for
100 If the end of file error is received while reading from the stream, then
101 the error returned from this function will be:
103 @li @ref error::end_of_stream if no bytes were parsed, or
105 @li @ref error::partial_message if any bytes were parsed but the
106 message was incomplete, otherwise:
108 @li A successful result. The next attempt to read will return
109 @ref error::end_of_stream
111 @param stream The stream from which the data is to be read. The type must
112 support the <em>SyncReadStream</em> requirements.
114 @param buffer Storage for additional bytes read by the implementation from
115 the stream. This is both an input and an output parameter; on entry, the
116 parser will be presented with any remaining data in the dynamic buffer's
117 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
120 @param parser The parser to use.
122 @param ec Set to the error, if any occurred.
124 @return The number of bytes transferred from the stream.
126 @note The function returns the total number of bytes transferred from the
127 stream. This may be zero for the case where there is sufficient pre-existing
128 message data in the dynamic buffer.
131 class SyncReadStream,
136 SyncReadStream& stream,
137 DynamicBuffer& buffer,
138 basic_parser<isRequest>& parser,
141 /** Read part of a message asynchronously from a stream using a parser.
143 This function is used to asynchronously read part of a message from
144 a stream into an instance of @ref basic_parser. The function call
145 always returns immediately. The asynchronous operation will continue
146 until one of the following conditions is true:
148 @li A call to @ref basic_parser::put with a non-empty buffer sequence
153 This operation is implemented in terms of zero or more calls to the
154 next layer's `async_read_some` function, and is known as a <em>composed
155 operation</em>. The program must ensure that the stream performs no other
156 reads until this operation completes. The implementation may read additional
157 bytes from the stream that lie past the end of the message being read.
158 These additional bytes are stored in the dynamic buffer, which must be
159 preserved for subsequent reads.
161 If the end of file error is received while reading from the stream, then
162 the error returned from this function will be:
164 @li @ref error::end_of_stream if no bytes were parsed, or
166 @li @ref error::partial_message if any bytes were parsed but the
167 message was incomplete, otherwise:
169 @li A successful result. The next attempt to read will return
170 @ref error::end_of_stream
172 @param stream The stream from which the data is to be read. The type
173 must meet the <em>AsyncReadStream</em> requirements.
175 @param buffer Storage for additional bytes read by the implementation from
176 the stream. This is both an input and an output parameter; on entry, the
177 parser will be presented with any remaining data in the dynamic buffer's
178 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
179 requirements. The object must remain valid at least until the handler
180 is called; ownership is not transferred.
182 @param parser The parser to use. The object must remain valid at least until
183 the handler is called; ownership is not transferred.
185 @param handler The completion handler to invoke when the operation
186 completes. The implementation takes ownership of the handler by
187 performing a decay-copy. The equivalent function signature of
191 error_code const& error, // result of operation
192 std::size_t bytes_transferred // the total number of bytes transferred from the stream
195 Regardless of whether the asynchronous operation completes
196 immediately or not, the handler will not be invoked from within
197 this function. Invocation of the handler will be performed in a
198 manner equivalent to using `net::post`.
200 @note The completion handler will receive as a parameter the total number
201 of bytes transferred from the stream. This may be zero for the case where
202 there is sufficient pre-existing message data in the dynamic buffer.
205 class AsyncReadStream,
208 BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
209 net::default_completion_token_t<
210 executor_type<AsyncReadStream>>>
211 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
213 AsyncReadStream& stream,
214 DynamicBuffer& buffer,
215 basic_parser<isRequest>& parser,
216 ReadHandler&& handler =
217 net::default_completion_token_t<
218 executor_type<AsyncReadStream>>{});
220 //------------------------------------------------------------------------------
222 /** Read a complete message header from a stream using a parser.
224 This function is used to read a complete message header from a stream
225 into an instance of @ref basic_parser. The call will block until one of the
226 following conditions is true:
228 @li @ref basic_parser::is_header_done returns `true`
232 This operation is implemented in terms of one or more calls to the stream's
233 `read_some` function. The implementation may read additional bytes from
234 the stream that lie past the end of the message being read. These additional
235 bytes are stored in the dynamic buffer, which must be preserved for
238 If the end of file error is received while reading from the stream, then
239 the error returned from this function will be:
241 @li @ref error::end_of_stream if no bytes were parsed, or
243 @li @ref error::partial_message if any bytes were parsed but the
244 message was incomplete, otherwise:
246 @li A successful result. The next attempt to read will return
247 @ref error::end_of_stream
249 @param stream The stream from which the data is to be read. The type must
250 meet the <em>SyncReadStream</em> requirements.
252 @param buffer Storage for additional bytes read by the implementation from
253 the stream. This is both an input and an output parameter; on entry, the
254 parser will be presented with any remaining data in the dynamic buffer's
255 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
258 @param parser The parser to use.
260 @return The number of bytes transferred from the stream.
262 @throws system_error Thrown on failure.
264 @note The function returns the total number of bytes transferred from the
265 stream. This may be zero for the case where there is sufficient pre-existing
266 message data in the dynamic buffer. The implementation will call
267 @ref basic_parser::eager with the value `false` on the parser passed in.
270 class SyncReadStream,
275 SyncReadStream& stream,
276 DynamicBuffer& buffer,
277 basic_parser<isRequest>& parser);
279 /** Read a complete message header from a stream using a parser.
281 This function is used to read a complete message header from a stream
282 into an instance of @ref basic_parser. The call will block until one of the
283 following conditions is true:
285 @li @ref basic_parser::is_header_done returns `true`
289 This operation is implemented in terms of one or more calls to the stream's
290 `read_some` function. The implementation may read additional bytes from
291 the stream that lie past the end of the message being read. These additional
292 bytes are stored in the dynamic buffer, which must be preserved for
295 If the end of file error is received while reading from the stream, then
296 the error returned from this function will be:
298 @li @ref error::end_of_stream if no bytes were parsed, or
300 @li @ref error::partial_message if any bytes were parsed but the
301 message was incomplete, otherwise:
303 @li A successful result. The next attempt to read will return
304 @ref error::end_of_stream
306 @param stream The stream from which the data is to be read. The type must
307 meet the <em>SyncReadStream</em> requirements.
309 @param buffer Storage for additional bytes read by the implementation from
310 the stream. This is both an input and an output parameter; on entry, the
311 parser will be presented with any remaining data in the dynamic buffer's
312 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
315 @param parser The parser to use.
317 @param ec Set to the error, if any occurred.
319 @return The number of bytes transferred from the stream.
321 @note The function returns the total number of bytes transferred from the
322 stream. This may be zero for the case where there is sufficient pre-existing
323 message data in the dynamic buffer. The implementation will call
324 @ref basic_parser::eager with the value `false` on the parser passed in.
327 class SyncReadStream,
332 SyncReadStream& stream,
333 DynamicBuffer& buffer,
334 basic_parser<isRequest>& parser,
337 /** Read a complete message header asynchronously from a stream using a parser.
339 This function is used to asynchronously read a complete message header from
340 a stream into an instance of @ref basic_parser. The function call always
341 returns immediately. The asynchronous operation will continue until one of
342 the following conditions is true:
344 @li @ref basic_parser::is_header_done returns `true`
348 This operation is implemented in terms of zero or more calls to the
349 next layer's `async_read_some` function, and is known as a <em>composed
350 operation</em>. The program must ensure that the stream performs no other
351 reads until this operation completes. The implementation may read additional
352 bytes from the stream that lie past the end of the message being read.
353 These additional bytes are stored in the dynamic buffer, which must be
354 preserved for subsequent reads.
356 If the end of file error is received while reading from the stream, then
357 the error returned from this function will be:
359 @li @ref error::end_of_stream if no bytes were parsed, or
361 @li @ref error::partial_message if any bytes were parsed but the
362 message was incomplete, otherwise:
364 @li A successful result. The next attempt to read will return
365 @ref error::end_of_stream
367 @param stream The stream from which the data is to be read. The type
368 must meet the <em>AsyncReadStream</em> requirements.
370 @param buffer Storage for additional bytes read by the implementation from
371 the stream. This is both an input and an output parameter; on entry, the
372 parser will be presented with any remaining data in the dynamic buffer's
373 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
374 requirements. The object must remain valid at least until the handler
375 is called; ownership is not transferred.
377 @param parser The parser to use. The object must remain valid at least until
378 the handler is called; ownership is not transferred.
380 @param handler The completion handler to invoke when the operation
381 completes. The implementation takes ownership of the handler by
382 performing a decay-copy. The equivalent function signature of
386 error_code const& error, // result of operation
387 std::size_t bytes_transferred // the total number of bytes transferred from the stream
390 Regardless of whether the asynchronous operation completes
391 immediately or not, the handler will not be invoked from within
392 this function. Invocation of the handler will be performed in a
393 manner equivalent to using `net::post`.
395 @note The completion handler will receive as a parameter the total number
396 of bytes transferred from the stream. This may be zero for the case where
397 there is sufficient pre-existing message data in the dynamic buffer. The
398 implementation will call @ref basic_parser::eager with the value `false`
399 on the parser passed in.
402 class AsyncReadStream,
405 BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
406 net::default_completion_token_t<
407 executor_type<AsyncReadStream>>>
408 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
410 AsyncReadStream& stream,
411 DynamicBuffer& buffer,
412 basic_parser<isRequest>& parser,
413 ReadHandler&& handler =
414 net::default_completion_token_t<
415 executor_type<AsyncReadStream>>{});
417 //------------------------------------------------------------------------------
419 /** Read a complete message from a stream using a parser.
421 This function is used to read a complete message from a stream into an
422 instance of @ref basic_parser. The call will block until one of the
423 following conditions is true:
425 @li @ref basic_parser::is_done returns `true`
429 This operation is implemented in terms of one or more calls to the stream's
430 `read_some` function. The implementation may read additional bytes from
431 the stream that lie past the end of the message being read. These additional
432 bytes are stored in the dynamic buffer, which must be preserved for
435 If the end of file error is received while reading from the stream, then
436 the error returned from this function will be:
438 @li @ref error::end_of_stream if no bytes were parsed, or
440 @li @ref error::partial_message if any bytes were parsed but the
441 message was incomplete, otherwise:
443 @li A successful result. The next attempt to read will return
444 @ref error::end_of_stream
446 @param stream The stream from which the data is to be read. The type must
447 meet the <em>SyncReadStream</em> requirements.
449 @param buffer Storage for additional bytes read by the implementation from
450 the stream. This is both an input and an output parameter; on entry, the
451 parser will be presented with any remaining data in the dynamic buffer's
452 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
455 @param parser The parser to use.
457 @return The number of bytes transferred from the stream.
459 @throws system_error Thrown on failure.
461 @note The function returns the total number of bytes transferred from the
462 stream. This may be zero for the case where there is sufficient pre-existing
463 message data in the dynamic buffer. The implementation will call
464 @ref basic_parser::eager with the value `true` on the parser passed in.
467 class SyncReadStream,
472 SyncReadStream& stream,
473 DynamicBuffer& buffer,
474 basic_parser<isRequest>& parser);
476 /** Read a complete message from a stream using a parser.
478 This function is used to read a complete message from a stream into an
479 instance of @ref basic_parser. The call will block until one of the
480 following conditions is true:
482 @li @ref basic_parser::is_done returns `true`
486 This operation is implemented in terms of one or more calls to the stream's
487 `read_some` function. The implementation may read additional bytes from
488 the stream that lie past the end of the message being read. These additional
489 bytes are stored in the dynamic buffer, which must be preserved for
492 If the end of file error is received while reading from the stream, then
493 the error returned from this function will be:
495 @li @ref error::end_of_stream if no bytes were parsed, or
497 @li @ref error::partial_message if any bytes were parsed but the
498 message was incomplete, otherwise:
500 @li A successful result. The next attempt to read will return
501 @ref error::end_of_stream
503 @param stream The stream from which the data is to be read. The type must
504 meet the <em>SyncReadStream</em> requirements.
506 @param buffer Storage for additional bytes read by the implementation from
507 the stream. This is both an input and an output parameter; on entry, the
508 parser will be presented with any remaining data in the dynamic buffer's
509 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
512 @param parser The parser to use.
514 @param ec Set to the error, if any occurred.
516 @return The number of bytes transferred from the stream.
518 @note The function returns the total number of bytes transferred from the
519 stream. This may be zero for the case where there is sufficient pre-existing
520 message data in the dynamic buffer. The implementation will call
521 @ref basic_parser::eager with the value `true` on the parser passed in.
524 class SyncReadStream,
529 SyncReadStream& stream,
530 DynamicBuffer& buffer,
531 basic_parser<isRequest>& parser,
534 /** Read a complete message asynchronously from a stream using a parser.
536 This function is used to asynchronously read a complete message from a
537 stream into an instance of @ref basic_parser. The function call always
538 returns immediately. The asynchronous operation will continue until one
539 of the following conditions is true:
541 @li @ref basic_parser::is_done returns `true`
545 This operation is implemented in terms of zero or more calls to the
546 next layer's `async_read_some` function, and is known as a <em>composed
547 operation</em>. The program must ensure that the stream performs no other
548 reads until this operation completes. The implementation may read additional
549 bytes from the stream that lie past the end of the message being read.
550 These additional bytes are stored in the dynamic buffer, which must be
551 preserved for subsequent reads.
553 If the end of file error is received while reading from the stream, then
554 the error returned from this function will be:
556 @li @ref error::end_of_stream if no bytes were parsed, or
558 @li @ref error::partial_message if any bytes were parsed but the
559 message was incomplete, otherwise:
561 @li A successful result. The next attempt to read will return
562 @ref error::end_of_stream
564 @param stream The stream from which the data is to be read. The type
565 must meet the <em>AsyncReadStream</em> requirements.
567 @param buffer Storage for additional bytes read by the implementation from
568 the stream. This is both an input and an output parameter; on entry, the
569 parser will be presented with any remaining data in the dynamic buffer's
570 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
571 requirements. The object must remain valid at least until the handler
572 is called; ownership is not transferred.
574 @param parser The parser to use. The object must remain valid at least until
575 the handler is called; ownership is not transferred.
577 @param handler The completion handler to invoke when the operation
578 completes. The implementation takes ownership of the handler by
579 performing a decay-copy. The equivalent function signature of
583 error_code const& error, // result of operation
584 std::size_t bytes_transferred // the total number of bytes transferred from the stream
587 Regardless of whether the asynchronous operation completes
588 immediately or not, the handler will not be invoked from within
589 this function. Invocation of the handler will be performed in a
590 manner equivalent to using `net::post`.
592 @note The completion handler will receive as a parameter the total number
593 of bytes transferred from the stream. This may be zero for the case where
594 there is sufficient pre-existing message data in the dynamic buffer. The
595 implementation will call @ref basic_parser::eager with the value `true`
596 on the parser passed in.
599 class AsyncReadStream,
602 BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
603 net::default_completion_token_t<
604 executor_type<AsyncReadStream>>>
605 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
607 AsyncReadStream& stream,
608 DynamicBuffer& buffer,
609 basic_parser<isRequest>& parser,
610 ReadHandler&& handler =
611 net::default_completion_token_t<
612 executor_type<AsyncReadStream>>{});
614 //------------------------------------------------------------------------------
616 /** Read a complete message from a stream.
618 This function is used to read a complete message from a stream into an
619 instance of @ref message. The call will block until one of the following
622 @li The entire message is read in.
626 This operation is implemented in terms of one or more calls to the stream's
627 `read_some` function. The implementation may read additional bytes from
628 the stream that lie past the end of the message being read. These additional
629 bytes are stored in the dynamic buffer, which must be preserved for
632 If the end of file error is received while reading from the stream, then
633 the error returned from this function will be:
635 @li @ref error::end_of_stream if no bytes were parsed, or
637 @li @ref error::partial_message if any bytes were parsed but the
638 message was incomplete, otherwise:
640 @li A successful result. The next attempt to read will return
641 @ref error::end_of_stream
643 @param stream The stream from which the data is to be read. The type must
644 meet the <em>SyncReadStream</em> requirements.
646 @param buffer Storage for additional bytes read by the implementation from
647 the stream. This is both an input and an output parameter; on entry, the
648 parser will be presented with any remaining data in the dynamic buffer's
649 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
652 @param msg The container in which to store the message contents. This
653 message container should not have previous contents, otherwise the behavior
654 is undefined. The type must be meet the <em>MoveAssignable</em> and
655 <em>MoveConstructible</em> requirements.
657 @return The number of bytes transferred from the stream.
659 @throws system_error Thrown on failure.
661 @note The function returns the total number of bytes transferred from the
662 stream. This may be zero for the case where there is sufficient pre-existing
663 message data in the dynamic buffer. The implementation will call
664 @ref basic_parser::eager with the value `true` on the parser passed in.
667 class SyncReadStream,
669 bool isRequest, class Body, class Allocator>
672 SyncReadStream& stream,
673 DynamicBuffer& buffer,
674 message<isRequest, Body, basic_fields<Allocator>>& msg);
676 /** Read a complete message from a stream.
678 This function is used to read a complete message from a stream into an
679 instance of @ref message. The call will block until one of the following
682 @li The entire message is read in.
686 This operation is implemented in terms of one or more calls to the stream's
687 `read_some` function. The implementation may read additional bytes from
688 the stream that lie past the end of the message being read. These additional
689 bytes are stored in the dynamic buffer, which must be preserved for
692 If the end of file error is received while reading from the stream, then
693 the error returned from this function will be:
695 @li @ref error::end_of_stream if no bytes were parsed, or
697 @li @ref error::partial_message if any bytes were parsed but the
698 message was incomplete, otherwise:
700 @li A successful result. The next attempt to read will return
701 @ref error::end_of_stream
703 @param stream The stream from which the data is to be read. The type must
704 meet the <em>SyncReadStream</em> requirements.
706 @param buffer Storage for additional bytes read by the implementation from
707 the stream. This is both an input and an output parameter; on entry, the
708 parser will be presented with any remaining data in the dynamic buffer's
709 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
712 @param msg The container in which to store the message contents. This
713 message container should not have previous contents, otherwise the behavior
714 is undefined. The type must be meet the <em>MoveAssignable</em> and
715 <em>MoveConstructible</em> requirements.
717 @param ec Set to the error, if any occurred.
719 @return The number of bytes transferred from the stream.
721 @note The function returns the total number of bytes transferred from the
722 stream. This may be zero for the case where there is sufficient pre-existing
723 message data in the dynamic buffer. The implementation will call
724 @ref basic_parser::eager with the value `true` on the parser passed in.
727 class SyncReadStream,
729 bool isRequest, class Body, class Allocator>
732 SyncReadStream& stream,
733 DynamicBuffer& buffer,
734 message<isRequest, Body, basic_fields<Allocator>>& msg,
737 /** Read a complete message asynchronously from a stream.
739 This function is used to asynchronously read a complete message from a
740 stream into an instance of @ref message. The function call always returns
741 immediately. The asynchronous operation will continue until one of the
742 following conditions is true:
744 @li The entire message is read in.
748 This operation is implemented in terms of zero or more calls to the
749 next layer's `async_read_some` function, and is known as a <em>composed
750 operation</em>. The program must ensure that the stream performs no other
751 reads until this operation completes. The implementation may read additional
752 bytes from the stream that lie past the end of the message being read.
753 These additional bytes are stored in the dynamic buffer, which must be
754 preserved for subsequent reads.
756 If the end of file error is received while reading from the stream, then
757 the error returned from this function will be:
759 @li @ref error::end_of_stream if no bytes were parsed, or
761 @li @ref error::partial_message if any bytes were parsed but the
762 message was incomplete, otherwise:
764 @li A successful result. The next attempt to read will return
765 @ref error::end_of_stream
767 @param stream The stream from which the data is to be read. The type
768 must meet the <em>AsyncReadStream</em> requirements.
770 @param buffer Storage for additional bytes read by the implementation from
771 the stream. This is both an input and an output parameter; on entry, the
772 parser will be presented with any remaining data in the dynamic buffer's
773 readable bytes sequence first. The type must meet the <em>DynamicBuffer</em>
774 requirements. The object must remain valid at least until the handler
775 is called; ownership is not transferred.
777 @param msg The container in which to store the message contents. This
778 message container should not have previous contents, otherwise the behavior
779 is undefined. The type must be meet the <em>MoveAssignable</em> and
780 <em>MoveConstructible</em> requirements. The object must remain valid
781 at least until the handler is called; ownership is not transferred.
783 @param handler The completion handler to invoke when the operation
784 completes. The implementation takes ownership of the handler by
785 performing a decay-copy. The equivalent function signature of
789 error_code const& error, // result of operation
790 std::size_t bytes_transferred // the total number of bytes transferred from the stream
793 Regardless of whether the asynchronous operation completes
794 immediately or not, the handler will not be invoked from within
795 this function. Invocation of the handler will be performed in a
796 manner equivalent to using `net::post`.
798 @note The completion handler will receive as a parameter the total number
799 of bytes transferred from the stream. This may be zero for the case where
800 there is sufficient pre-existing message data in the dynamic buffer. The
801 implementation will call @ref basic_parser::eager with the value `true`
802 on the parser passed in.
805 class AsyncReadStream,
807 bool isRequest, class Body, class Allocator,
808 BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
809 net::default_completion_token_t<
810 executor_type<AsyncReadStream>>>
811 BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
813 AsyncReadStream& stream,
814 DynamicBuffer& buffer,
815 message<isRequest, Body, basic_fields<Allocator>>& msg,
816 ReadHandler&& handler =
817 net::default_completion_token_t<
818 executor_type<AsyncReadStream>>{});
824 #include <boost/beast/http/impl/read.hpp>