forked from boostorg/beast
Rename to buffer_bytes
This commit is contained in:
1 parent
6ccdcdf51d
commit
9f2b0ce1db
62 files changed
+206
-258
No files matched your search
@@ -97,7 +97,7 @@ std::string string_from_buffers (ConstBufferSequence const& buffers)
|
||||
|
||||
// optimization: reserve all the space for the string first
|
||||
std::string result;
|
||||
result.reserve(beast::buffer_size(buffers)); // beast version of net::buffer_size
|
||||
result.reserve(beast::buffer_bytes(buffers)); // beast version of net::buffer_size
|
||||
|
||||
// iterate over each buffer in the sequence and append it to the string
|
||||
for(auto it = net::buffer_sequence_begin(buffers); // returns an iterator to beginning of the sequence
|
||||
|
||||
@@ -165,7 +165,7 @@ struct BodyReader
|
||||
// The specification requires this to indicate "no error"
|
||||
ec = {};
|
||||
|
||||
return buffer_size(buffers);
|
||||
return buffer_bytes(buffers);
|
||||
}
|
||||
|
||||
/** Called when the body is complete.
|
||||
|
||||
@@ -273,9 +273,9 @@ void fxx() {
|
||||
|
||||
// Manually emit a chunk by first writing the chunk-size header with the correct size
|
||||
net::write(sock, chunk_header{
|
||||
buffer_size(cb1) +
|
||||
buffer_size(cb2) +
|
||||
buffer_size(cb3)});
|
||||
buffer_bytes(cb1) +
|
||||
buffer_bytes(cb2) +
|
||||
buffer_bytes(cb3)});
|
||||
|
||||
// And then output the chunk body in three pieces ("chunk the chunk")
|
||||
net::write(sock, cb1);
|
||||
@@ -367,7 +367,7 @@ print_cxx14(message<isRequest, Body, Fields> const& m)
|
||||
{
|
||||
ec = {};
|
||||
std::cout << buffers(buffer);
|
||||
sr.consume(buffer_size(buffer));
|
||||
sr.consume(buffer_bytes(buffer));
|
||||
});
|
||||
}
|
||||
while(! ec && ! sr.is_done());
|
||||
@@ -394,7 +394,7 @@ struct lambda
|
||||
{
|
||||
ec = {};
|
||||
std::cout << buffers(buffer);
|
||||
sr.consume(buffer_size(buffer));
|
||||
sr.consume(buffer_bytes(buffer));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -435,7 +435,7 @@ split_print_cxx14(message<isRequest, Body, Fields> const& m)
|
||||
{
|
||||
ec = {};
|
||||
std::cout << buffers(buffer);
|
||||
sr.consume(buffer_size(buffer));
|
||||
sr.consume(buffer_bytes(buffer));
|
||||
});
|
||||
}
|
||||
while(! sr.is_header_done());
|
||||
@@ -449,7 +449,7 @@ split_print_cxx14(message<isRequest, Body, Fields> const& m)
|
||||
{
|
||||
ec = {};
|
||||
std::cout << buffers(buffer);
|
||||
sr.consume(buffer_size(buffer));
|
||||
sr.consume(buffer_bytes(buffer));
|
||||
});
|
||||
}
|
||||
while(! ec && ! sr.is_done());
|
||||
|
||||
@@ -97,7 +97,7 @@ snippets()
|
||||
// This will cause the message to be broken up into multiple frames.
|
||||
for(;;)
|
||||
{
|
||||
if(buffer_size(cb) > 512)
|
||||
if(buffer_bytes(cb) > 512)
|
||||
{
|
||||
// There are more than 512 bytes left to send, just
|
||||
// send the next 512 bytes. The value `false` informs
|
||||
|
||||
@@ -53,7 +53,7 @@ snippets()
|
||||
//[code_websocket_5_3
|
||||
|
||||
ws.auto_fragment(true);
|
||||
ws.write_buffer_size(16384);
|
||||
ws.write_buffer_bytes(16384);
|
||||
|
||||
//]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user