Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / beast / doc / html / beast / ref / boost__beast__http__basic_parser / put.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>http::basic_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&#160;1.&#160;Boost.Beast">
8 <link rel="up" href="../boost__beast__http__basic_parser.html" title="http::basic_parser">
9 <link rel="prev" href="operator_eq0.html" title="http::basic_parser::operator=">
10 <link rel="next" href="put_eof.html" title="http::basic_parser::put_eof">
11 </head>
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>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="operator_eq0.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__beast__http__basic_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>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h5 class="title">
27 <a name="beast.ref.boost__beast__http__basic_parser.put"></a><a class="link" href="put.html" title="http::basic_parser::put">http::basic_parser::put</a>
28 </h5></div></div></div>
29 <p>
30           <a class="indexterm" name="idm45873502254464"></a>
31 Write a buffer sequence to the parser.
32         </p>
33 <h6>
34 <a name="beast.ref.boost__beast__http__basic_parser.put.h0"></a>
35           <span class="phrase"><a name="beast.ref.boost__beast__http__basic_parser.put.synopsis"></a></span><a class="link" href="put.html#beast.ref.boost__beast__http__basic_parser.put.synopsis">Synopsis</a>
36         </h6>
37 <pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span>
38     <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">&gt;</span>
39 <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span>
40 <span class="identifier">put</span><span class="special">(</span>
41     <span class="identifier">ConstBufferSequence</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">buffers</span><span class="special">,</span>
42     <span class="identifier">error_code</span><span class="special">&amp;</span> <span class="identifier">ec</span><span class="special">);</span>
43 </pre>
44 <h6>
45 <a name="beast.ref.boost__beast__http__basic_parser.put.h1"></a>
46           <span class="phrase"><a name="beast.ref.boost__beast__http__basic_parser.put.description"></a></span><a class="link" href="put.html#beast.ref.boost__beast__http__basic_parser.put.description">Description</a>
47         </h6>
48 <p>
49           This function attempts to incrementally parse the HTTP message data stored
50           in the caller provided buffers. Upon success, a positive return value indicates
51           that the parser made forward progress, consuming that number of bytes.
52           In some cases there may be an insufficient number of octets in the input
53           buffer in order to make forward progress. This is indicated by the code
54           <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>.
55           When this happens, the caller should place additional bytes into the buffer
56           sequence and call <a class="link" href="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>
57           is special. When this error is returned, a subsequent call to <a class="link" href="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
58           have been updated. Otherwise, upon error the parser may not be restarted.
59         </p>
60 <h6>
61 <a name="beast.ref.boost__beast__http__basic_parser.put.h2"></a>
62           <span class="phrase"><a name="beast.ref.boost__beast__http__basic_parser.put.parameters"></a></span><a class="link" href="put.html#beast.ref.boost__beast__http__basic_parser.put.parameters">Parameters</a>
63         </h6>
64 <div class="informaltable"><table class="table">
65 <colgroup>
66 <col>
67 <col>
68 </colgroup>
69 <thead><tr>
70 <th>
71                   <p>
72                     Name
73                   </p>
74                 </th>
75 <th>
76                   <p>
77                     Description
78                   </p>
79                 </th>
80 </tr></thead>
81 <tbody>
82 <tr>
83 <td>
84                   <p>
85                     <code class="computeroutput"><span class="identifier">buffers</span></code>
86                   </p>
87                 </td>
88 <td>
89                   <p>
90                     An object meeting the requirements of <span class="emphasis"><em>ConstBufferSequence</em></span>
91                     that represents the next chunk of message data. If the length
92                     of this buffer sequence is one, the implementation will not allocate
93                     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
94                     provided as one way to meet this requirement
95                   </p>
96                 </td>
97 </tr>
98 <tr>
99 <td>
100                   <p>
101                     <code class="computeroutput"><span class="identifier">ec</span></code>
102                   </p>
103                 </td>
104 <td>
105                   <p>
106                     Set to the error, if any occurred.
107                   </p>
108                 </td>
109 </tr>
110 </tbody>
111 </table></div>
112 <h6>
113 <a name="beast.ref.boost__beast__http__basic_parser.put.h3"></a>
114           <span class="phrase"><a name="beast.ref.boost__beast__http__basic_parser.put.return_value"></a></span><a class="link" href="put.html#beast.ref.boost__beast__http__basic_parser.put.return_value">Return
115           Value</a>
116         </h6>
117 <p>
118           The number of octets consumed in the buffer sequence. The caller should
119           remove these octets even if the error is set.
120         </p>
121 </div>
122 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
123 <td align="left"></td>
124 <td align="right"><div class="copyright-footer">Copyright &#169; 2016-2019 Vinnie
125       Falco<p>
126         Distributed under the Boost Software License, Version 1.0. (See accompanying
127         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>)
128       </p>
129 </div></td>
130 </tr></table>
131 <hr>
132 <div class="spirit-nav">
133 <a accesskey="p" href="operator_eq0.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__beast__http__basic_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>
134 </div>
135 </body>
136 </html>