Skip to content

Commit 21f43c0

Browse files
committed
use buffer_empty
1 parent 9796d87 commit 21f43c0

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

include/boost/http/body_write_stream.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class body_write_stream
157157
}
158158

159159
// Zero-sized buffer completes immediately
160-
if(capy::buffer_size(buffers) == 0)
160+
if(capy::buffer_empty(buffers))
161161
co_return {{}, 0};
162162

163163
std::size_t bytes = 0;
@@ -255,7 +255,7 @@ class body_write_stream
255255
co_return {cbs.error()};
256256
}
257257

258-
if(capy::buffer_size(*cbs) == 0)
258+
if(capy::buffer_empty(*cbs))
259259
{
260260
sr_.consume(0);
261261
continue;

include/boost/http/parser.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ capy::task<capy::io_result<std::size_t>>
669669
parser::
670670
read(Stream& stream, MB const& buffers)
671671
{
672-
if(capy::buffer_size(buffers) == 0)
672+
if(capy::buffer_empty(buffers))
673673
co_return {{}, 0};
674674

675675
std::size_t total = 0;
@@ -690,7 +690,7 @@ read(Stream& stream, MB const& buffers)
690690
total += copied;
691691
dest = capy::sans_prefix(dest, copied);
692692

693-
if(capy::buffer_size(dest) == 0)
693+
if(capy::buffer_empty(dest))
694694
co_return {{}, total};
695695
}
696696

src/detail/filter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ process(
6060
capy::remove_prefix(out, rs.out_bytes);
6161
capy::remove_prefix(in, rs.in_bytes);
6262

63-
if(capy::buffer_size(out) == 0)
63+
if(capy::buffer_empty(out))
6464
return rv;
6565

66-
if(capy::buffer_size(in) == 0 && rs.out_bytes < ob.size())
66+
if(capy::buffer_empty(in) && rs.out_bytes < ob.size())
6767
return rv;
6868
}
6969
}

src/parser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <boost/assert.hpp>
1818
#include <boost/capy/buffers/circular_dynamic_buffer.hpp>
1919
#include <boost/capy/buffers/buffer_copy.hpp>
20-
#include <boost/capy/buffers/flat_buffer.hpp>
20+
#include <boost/capy/buffers/flat_dynamic_buffer.hpp>
2121
#include <boost/capy/buffers/front.hpp>
2222
#include <boost/capy/buffers/slice.hpp>
2323
#include <boost/http/brotli/decode.hpp>
@@ -426,7 +426,7 @@ class parser_service
426426
/*
427427
| fb | cb0 | cb1 | C | T | f |
428428
429-
fb flat_buffer headers.max_size
429+
fb flat_dynamic_buffer headers.max_size
430430
cb0 circular_buffer min_buffer
431431
cb1 circular_buffer min_buffer
432432
C codec max_codec
@@ -545,7 +545,7 @@ class parser::impl
545545
std::size_t body_avail_;
546546
std::size_t nprepare_;
547547

548-
capy::flat_buffer fb_;
548+
capy::flat_dynamic_buffer fb_;
549549
capy::circular_dynamic_buffer cb0_;
550550
capy::circular_dynamic_buffer cb1_;
551551

test/unit/parser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <boost/http/response_parser.hpp>
1515

1616
#include <boost/capy/buffers/buffer_copy.hpp>
17-
#include <boost/capy/buffers/flat_buffer.hpp>
17+
#include <boost/capy/buffers/flat_dynamic_buffer.hpp>
1818
#include <boost/capy/buffers/make_buffer.hpp>
1919
#include <boost/capy/cond.hpp>
2020
#include <boost/capy/test/fuse.hpp>
@@ -88,9 +88,9 @@ This all speaks to DynamicBuffer as the correct API
8888
pr.set_body( capy::make_any( s ) ); // reference semantics
8989
9090
parser pr;
91-
capy::flat_buffer fb;
91+
capy::flat_dynamic_buffer fb;
9292
...
93-
pr.set_body( fb ); // flat_buffer&
93+
pr.set_body( fb ); // flat_dynamic_buffer&
9494
*/
9595
//------------------------------------------------
9696

0 commit comments

Comments
 (0)