mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 12:57:31 +02:00
Fix warning in basic_parser.cpp
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
Version 57:
|
Version 57:
|
||||||
|
|
||||||
* Fix message.hpp javadocs
|
* Fix message.hpp javadocs
|
||||||
|
* Fix warning in basic_parser.cpp
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -220,14 +220,10 @@ public:
|
|||||||
for(std::size_t i = 1;
|
for(std::size_t i = 1;
|
||||||
i < s.size() - 1; ++i)
|
i < s.size() - 1; ++i)
|
||||||
{
|
{
|
||||||
auto const b1 =
|
|
||||||
buffer(s.data(), i);
|
|
||||||
auto const b2 = buffer(
|
|
||||||
s.data() + i, s.size() - i);
|
|
||||||
test_parser<true> p;
|
test_parser<true> p;
|
||||||
p.eager(true);
|
p.eager(true);
|
||||||
error_code ec;
|
error_code ec;
|
||||||
p.put(b1, ec);
|
p.put(buffer(s.data(), i), ec);
|
||||||
BEAST_EXPECTS(ec == error::need_more, ec.message());
|
BEAST_EXPECTS(ec == error::need_more, ec.message());
|
||||||
ec = {};
|
ec = {};
|
||||||
p.put(boost::asio::buffer(s.data(), s.size()), ec);
|
p.put(boost::asio::buffer(s.data(), s.size()), ec);
|
||||||
@ -943,26 +939,32 @@ public:
|
|||||||
|
|
||||||
// https://github.com/vinniefalco/Beast/issues/430
|
// https://github.com/vinniefalco/Beast/issues/430
|
||||||
void
|
void
|
||||||
testRegression430()
|
testIssue430()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
test_parser<false> p;
|
test_parser<false> p;
|
||||||
p.eager(true);
|
p.eager(true);
|
||||||
put(p,
|
put(p,
|
||||||
"HTTP/1.1 200 OK\r\n" "Transfer-Encoding: chunked\r\n" "Content-Type: application/octet-stream\r\n" "\r\n"
|
"HTTP/1.1 200 OK\r\n"
|
||||||
"4\r\nabcd\r\n"
|
"Transfer-Encoding: chunked\r\n"
|
||||||
"0\r\n\r\n"
|
"Content-Type: application/octet-stream\r\n"
|
||||||
|
"\r\n"
|
||||||
|
"4\r\nabcd\r\n"
|
||||||
|
"0\r\n\r\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
test_parser<false> p;
|
test_parser<false> p;
|
||||||
p.eager(true);
|
p.eager(true);
|
||||||
put(p,
|
put(p,
|
||||||
"HTTP/1.1 200 OK\r\n" "Transfer-Encoding: chunked\r\n" "Content-Type: application/octet-stream\r\n" "\r\n"
|
"HTTP/1.1 200 OK\r\n"
|
||||||
"4\r\nabcd");
|
"Transfer-Encoding: chunked\r\n"
|
||||||
|
"Content-Type: application/octet-stream\r\n"
|
||||||
|
"\r\n"
|
||||||
|
"4\r\nabcd");
|
||||||
put(p,
|
put(p,
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"0\r\n\r\n"
|
"0\r\n\r\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -971,7 +973,7 @@ public:
|
|||||||
|
|
||||||
// https://github.com/vinniefalco/Beast/issues/452
|
// https://github.com/vinniefalco/Beast/issues/452
|
||||||
void
|
void
|
||||||
testRegression452()
|
testIssue452()
|
||||||
{
|
{
|
||||||
error_code ec;
|
error_code ec;
|
||||||
test_parser<true> p;
|
test_parser<true> p;
|
||||||
@ -1008,8 +1010,6 @@ public:
|
|||||||
continue;
|
continue;
|
||||||
used = p.put(buffer(
|
used = p.put(buffer(
|
||||||
s.data() + n, s.size() - n), ec);
|
s.data() + n, s.size() - n), ec);
|
||||||
if(ec == error::need_more)
|
|
||||||
continue;
|
|
||||||
if(! BEAST_EXPECTS(! ec, ec.message()))
|
if(! BEAST_EXPECTS(! ec, ec.message()))
|
||||||
continue;
|
continue;
|
||||||
if(! BEAST_EXPECT(used == s.size() -n))
|
if(! BEAST_EXPECT(used == s.size() -n))
|
||||||
@ -1070,8 +1070,8 @@ public:
|
|||||||
testUpgradeField();
|
testUpgradeField();
|
||||||
testBody();
|
testBody();
|
||||||
testSplit();
|
testSplit();
|
||||||
testRegression430();
|
testIssue430();
|
||||||
testRegression452();
|
testIssue452();
|
||||||
testBufGrind();
|
testBufGrind();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user