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