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