Skip to content

Commit

Permalink
Merge branch 'boostorg:develop' into zig-pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane authored May 11, 2024
2 parents b1d2f8d + 95f0cfb commit d0dd674
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 38 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,41 +338,41 @@ jobs:
os: windows-2019
cxxflags: "cxxflags=-D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1"
supported: true
# - description: msvc-14.3-cxx14-win32
# toolset: msvc-14.3
# cxxstd: "14"
# addrmd: 32
# os: windows-2022
# cxxflags: ""
# supported: true
# - description: msvc-14.3-cxx17-win32
# toolset: msvc-14.3
# cxxstd: "17"
# addrmd: 32
# os: windows-2022
# cxxflags: "cxxflags=-D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1"
# supported: true
- description: msvc-14.3-cxx14-win32
toolset: msvc-14.3
cxxstd: "14"
addrmd: 32
os: windows-2022
cxxflags: ""
supported: true
- description: msvc-14.3-cxx17-win32
toolset: msvc-14.3
cxxstd: "17"
addrmd: 32
os: windows-2022
cxxflags: "cxxflags=-D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1"
supported: true
- description: msvc-14.3-cxx20-win32
toolset: msvc-14.3
cxxstd: "20"
addrmd: 32
os: windows-2022
cxxflags: "cxxflags=-D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1"
supported: true
# - description: msvc-14.3-cxx14-win64
# toolset: msvc-14.3
# cxxstd: "14"
# addrmd: 64
# os: windows-2022
# cxxflags: ""
# supported: true
# - description: msvc-14.3-cxx17-win64
# toolset: msvc-14.3
# cxxstd: "17"
# addrmd: 64
# os: windows-2022
# cxxflags: "cxxflags=-D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1"
# supported: true
- description: msvc-14.3-cxx14-win64
toolset: msvc-14.3
cxxstd: "14"
addrmd: 64
os: windows-2022
cxxflags: ""
supported: true
- description: msvc-14.3-cxx17-win64
toolset: msvc-14.3
cxxstd: "17"
addrmd: 64
os: windows-2022
cxxflags: "cxxflags=-D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1"
supported: true
- description: msvc-14.3-cxx20-win64
toolset: msvc-14.3
cxxstd: "20"
Expand Down
8 changes: 4 additions & 4 deletions Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ lib mswsock ; # NT
lib ipv6 ; # HPUX
lib network ; # HAIKU

feature.feature boost.beast.allow-deprecated : on off : propagated composite ;
feature.compose <boost.beast.allow-deprecated>on : <define>BOOST_BEAST_ALLOW_DEPRECATED ;
feature.feature boost.beast.allow-deprecated : on off : propagated ;

feature.feature boost.beast.separate-compilation : on off : propagated composite ;
feature.compose <boost.beast.separate-compilation>on : <define>BOOST_BEAST_SEPARATE_COMPILATION ;
feature.feature boost.beast.separate-compilation : on off : propagated ;

variant beast_coverage
: debug
Expand Down Expand Up @@ -95,6 +93,8 @@ local defines =
<target-os>hpux:<library>ipv6
<target-os>qnxnto:<library>socket
<target-os>haiku:<library>network
<boost.beast.allow-deprecated>on:<define>BOOST_BEAST_ALLOW_DEPRECATED
<boost.beast.separate-compilation>on:<define>BOOST_BEAST_SEPARATE_COMPILATION
;

lib lib-asio
Expand Down
10 changes: 5 additions & 5 deletions include/boost/beast/_experimental/test/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ class basic_stream
@param context The `io_context` object that the stream will use to
dispatch handlers for any asynchronous operations.
*/
template <typename ExecutionContext>
explicit basic_stream(ExecutionContext& context,
typename std::enable_if<
std::is_convertible<ExecutionContext&, net::execution_context&>::value
>::type* = 0)
template <class ExecutionContext,
class = typename std::enable_if<
std::is_convertible<ExecutionContext&, net::execution_context&>::value>::type>
explicit
basic_stream(ExecutionContext& context)
: basic_stream(context.get_executor())
{
}
Expand Down
5 changes: 4 additions & 1 deletion include/boost/beast/http/impl/basic_parser.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,12 @@ parse_chunk_header(char const*& p0,
}
else
{
BOOST_ASSERT(n >= 5);
BOOST_ASSERT(n >= 3);
if(f_ & flagExpectCRLF)
{
BOOST_ASSERT(n >= 5);
BOOST_VERIFY(parse_crlf(p));
}
std::uint64_t size;
BOOST_VERIFY(parse_hex(p, size));
eol = find_eol(p, pend, ec);
Expand Down
37 changes: 37 additions & 0 deletions test/beast/http/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,42 @@ class parser_test
"\r\n");
}

void
testIssue2861()
{
// Partial parsing of the final chunk when
// the final chunk is the only chunk in the body.
error_code ec;
flat_buffer b;
response_parser<string_body> p;

ostream(b) <<
"HTTP/1.1 200 OK\r\n"
"Transfer-Encoding: chunked\r\n"
"\r\n";

auto used = p.put(b.data(), ec);
b.consume(used);
BEAST_EXPECT(! ec);
BEAST_EXPECT(! p.is_done());

ostream(b) << "0\r\n"; // needs an extra CRLF
used = p.put(b.data(), ec);
BEAST_EXPECT(used == 0);
BEAST_EXPECT(ec == error::need_more);

ostream(b) << "\r";
used = p.put(b.data(), ec);
BEAST_EXPECT(used == 0);
BEAST_EXPECT(ec == error::need_more);

ostream(b) << "\n";
used = p.put(b.data(), ec);
BEAST_EXPECT(used == 5);
BEAST_EXPECT(!ec);
BEAST_EXPECT(p.is_done());
}

void
run() override
{
Expand All @@ -425,6 +461,7 @@ class parser_test
testIssue818();
testIssue1187();
testIssue1880();
testIssue2861();
}
};

Expand Down

0 comments on commit d0dd674

Please sign in to comment.