3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>http::parser::put</title>
5 <link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../index.html" title="Chapter 1. Boost.Beast">
8 <link rel="up" href="../boost__beast__http__parser.html" title="http::parser">
9 <link rel="prev" href="parser/overload5.html" title="http::parser::parser (5 of 5 overloads)">
10 <link rel="next" href="put_eof.html" title="http::parser::put_eof">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="parser/overload5.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__beast__http__parser.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="put_eof.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h5 class="title">
27 <a name="beast.ref.boost__beast__http__parser.put"></a><a class="link" href="put.html" title="http::parser::put">http::parser::put</a>
28 </h5></div></div></div>
30 (Inherited from <code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">basic_parser</span></code>)
33 <a class="indexterm" name="idm45873493193024"></a>
34 Write a buffer sequence to the parser.
37 <a name="beast.ref.boost__beast__http__parser.put.h0"></a>
38 <span class="phrase"><a name="beast.ref.boost__beast__http__parser.put.synopsis"></a></span><a class="link" href="put.html#beast.ref.boost__beast__http__parser.put.synopsis">Synopsis</a>
40 <pre class="programlisting"><span class="keyword">template</span><span class="special"><</span>
41 <span class="keyword">class</span> <a href="../../../../../../../doc/html/boost_asio/reference/ConstBufferSequence.html" target="_top"><span class="emphasis"><em>ConstBufferSequence</em></span></a><span class="special">></span>
42 <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span>
43 <span class="identifier">put</span><span class="special">(</span>
44 <span class="identifier">ConstBufferSequence</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">buffers</span><span class="special">,</span>
45 <span class="identifier">error_code</span><span class="special">&</span> <span class="identifier">ec</span><span class="special">);</span>
48 <a name="beast.ref.boost__beast__http__parser.put.h1"></a>
49 <span class="phrase"><a name="beast.ref.boost__beast__http__parser.put.description"></a></span><a class="link" href="put.html#beast.ref.boost__beast__http__parser.put.description">Description</a>
52 This function attempts to incrementally parse the HTTP message data stored
53 in the caller provided buffers. Upon success, a positive return value indicates
54 that the parser made forward progress, consuming that number of bytes.
55 In some cases there may be an insufficient number of octets in the input
56 buffer in order to make forward progress. This is indicated by the code
57 <a class="link" href="../boost__beast__http__error.html" title="http::error"><code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">need_more</span></code></a>.
58 When this happens, the caller should place additional bytes into the buffer
59 sequence and call <a class="link" href="../boost__beast__http__basic_parser/put.html" title="http::basic_parser::put"><code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">basic_parser</span><span class="special">::</span><span class="identifier">put</span></code></a> again. The error code <a class="link" href="../boost__beast__http__error.html" title="http::error"><code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">need_more</span></code></a>
60 is special. When this error is returned, a subsequent call to <a class="link" href="../boost__beast__http__basic_parser/put.html" title="http::basic_parser::put"><code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">basic_parser</span><span class="special">::</span><span class="identifier">put</span></code></a> may succeed if the buffers
61 have been updated. Otherwise, upon error the parser may not be restarted.
64 <a name="beast.ref.boost__beast__http__parser.put.h2"></a>
65 <span class="phrase"><a name="beast.ref.boost__beast__http__parser.put.parameters"></a></span><a class="link" href="put.html#beast.ref.boost__beast__http__parser.put.parameters">Parameters</a>
67 <div class="informaltable"><table class="table">
88 <code class="computeroutput"><span class="identifier">buffers</span></code>
93 An object meeting the requirements of <span class="emphasis"><em>ConstBufferSequence</em></span>
94 that represents the next chunk of message data. If the length
95 of this buffer sequence is one, the implementation will not allocate
96 additional memory. The class <a class="link" href="../boost__beast__basic_flat_buffer.html" title="basic_flat_buffer"><code class="computeroutput"><span class="identifier">basic_flat_buffer</span></code></a> is
97 provided as one way to meet this requirement
104 <code class="computeroutput"><span class="identifier">ec</span></code>
109 Set to the error, if any occurred.
116 <a name="beast.ref.boost__beast__http__parser.put.h3"></a>
117 <span class="phrase"><a name="beast.ref.boost__beast__http__parser.put.return_value"></a></span><a class="link" href="put.html#beast.ref.boost__beast__http__parser.put.return_value">Return
121 The number of octets consumed in the buffer sequence. The caller should
122 remove these octets even if the error is set.
125 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
126 <td align="left"></td>
127 <td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
129 Distributed under the Boost Software License, Version 1.0. (See accompanying
130 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
135 <div class="spirit-nav">
136 <a accesskey="p" href="parser/overload5.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__beast__http__parser.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="put_eof.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>