Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / beast / doc / html / beast / ref / boost__beast__http__parser / put.html
1 <html>
2 <head>
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&#160;1.&#160;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">
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="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>
24 </div>
25 <div class="section">
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>
29 <p>
30           (Inherited from <code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">basic_parser</span></code>)
31         </p>
32 <p>
33           <a class="indexterm" name="idm45873493193024"></a>
34 Write a buffer sequence to the parser.
35         </p>
36 <h6>
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>
39         </h6>
40 <pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</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">&gt;</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">&amp;</span> <span class="identifier">buffers</span><span class="special">,</span>
45     <span class="identifier">error_code</span><span class="special">&amp;</span> <span class="identifier">ec</span><span class="special">);</span>
46 </pre>
47 <h6>
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>
50         </h6>
51 <p>
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.
62         </p>
63 <h6>
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>
66         </h6>
67 <div class="informaltable"><table class="table">
68 <colgroup>
69 <col>
70 <col>
71 </colgroup>
72 <thead><tr>
73 <th>
74                   <p>
75                     Name
76                   </p>
77                 </th>
78 <th>
79                   <p>
80                     Description
81                   </p>
82                 </th>
83 </tr></thead>
84 <tbody>
85 <tr>
86 <td>
87                   <p>
88                     <code class="computeroutput"><span class="identifier">buffers</span></code>
89                   </p>
90                 </td>
91 <td>
92                   <p>
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
98                   </p>
99                 </td>
100 </tr>
101 <tr>
102 <td>
103                   <p>
104                     <code class="computeroutput"><span class="identifier">ec</span></code>
105                   </p>
106                 </td>
107 <td>
108                   <p>
109                     Set to the error, if any occurred.
110                   </p>
111                 </td>
112 </tr>
113 </tbody>
114 </table></div>
115 <h6>
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
118           Value</a>
119         </h6>
120 <p>
121           The number of octets consumed in the buffer sequence. The caller should
122           remove these octets even if the error is set.
123         </p>
124 </div>
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 &#169; 2016-2019 Vinnie
128       Falco<p>
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>)
131       </p>
132 </div></td>
133 </tr></table>
134 <hr>
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>
137 </div>
138 </body>
139 </html>