forked from boostorg/beast
@@ -3,6 +3,7 @@ Version 51
|
|||||||
* Fix operator<< for header
|
* Fix operator<< for header
|
||||||
* Tidy up file_body
|
* Tidy up file_body
|
||||||
* Fix file_body::get() not setting the more flag correctly
|
* Fix file_body::get() not setting the more flag correctly
|
||||||
|
* Use BOOST_FALLTHROUGH
|
||||||
|
|
||||||
API Changes:
|
API Changes:
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#include <beast/http/error.hpp>
|
#include <beast/http/error.hpp>
|
||||||
#include <beast/http/rfc7230.hpp>
|
#include <beast/http/rfc7230.hpp>
|
||||||
#include <boost/asio/buffer.hpp>
|
#include <boost/asio/buffer.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@@ -114,7 +115,7 @@ loop:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
state_ = state::header;
|
state_ = state::header;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case state::header:
|
case state::header:
|
||||||
parse_header(p, n, ec);
|
parse_header(p, n, ec);
|
||||||
@@ -127,7 +128,7 @@ loop:
|
|||||||
if(ec)
|
if(ec)
|
||||||
goto done;
|
goto done;
|
||||||
state_ = state::body;
|
state_ = state::body;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case state::body:
|
case state::body:
|
||||||
parse_body(p, n, ec);
|
parse_body(p, n, ec);
|
||||||
@@ -140,7 +141,7 @@ loop:
|
|||||||
if(ec)
|
if(ec)
|
||||||
goto done;
|
goto done;
|
||||||
state_ = state::body_to_eof;
|
state_ = state::body_to_eof;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case state::body_to_eof:
|
case state::body_to_eof:
|
||||||
parse_body_to_eof(p, n, ec);
|
parse_body_to_eof(p, n, ec);
|
||||||
@@ -153,7 +154,7 @@ loop:
|
|||||||
if(ec)
|
if(ec)
|
||||||
goto done;
|
goto done;
|
||||||
state_ = state::chunk_header;
|
state_ = state::chunk_header;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case state::chunk_header:
|
case state::chunk_header:
|
||||||
parse_chunk_header(p, n, ec);
|
parse_chunk_header(p, n, ec);
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#include <boost/asio/handler_continuation_hook.hpp>
|
#include <boost/asio/handler_continuation_hook.hpp>
|
||||||
#include <boost/asio/handler_invoke_hook.hpp>
|
#include <boost/asio/handler_invoke_hook.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
|
|
||||||
@@ -139,7 +140,7 @@ operator()(error_code ec, std::size_t bytes_transferred)
|
|||||||
if(! ec || ec != http::error::need_more)
|
if(! ec || ec != http::error::need_more)
|
||||||
goto do_upcall;
|
goto do_upcall;
|
||||||
ec = {};
|
ec = {};
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
do_read:
|
do_read:
|
||||||
try
|
try
|
||||||
@@ -277,7 +278,7 @@ operator()(error_code ec)
|
|||||||
bind_handler(std::move(*this), ec));
|
bind_handler(std::move(*this), ec));
|
||||||
}
|
}
|
||||||
state_ = 2;
|
state_ = 2;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
do_read:
|
do_read:
|
||||||
return async_read_some(
|
return async_read_some(
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
#include <beast/http/error.hpp>
|
#include <beast/http/error.hpp>
|
||||||
#include <beast/http/status.hpp>
|
#include <beast/http/status.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
namespace beast {
|
namespace beast {
|
||||||
@@ -63,7 +64,7 @@ get(error_code& ec, Visit&& visit)
|
|||||||
if(m_.has_chunked())
|
if(m_.has_chunked())
|
||||||
goto go_init_c;
|
goto go_init_c;
|
||||||
s_ = do_init;
|
s_ = do_init;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
case do_init:
|
case do_init:
|
||||||
@@ -89,7 +90,7 @@ get(error_code& ec, Visit&& visit)
|
|||||||
frd_->get(),
|
frd_->get(),
|
||||||
result->first};
|
result->first};
|
||||||
s_ = do_header;
|
s_ = do_header;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
case do_header:
|
case do_header:
|
||||||
@@ -110,7 +111,7 @@ get(error_code& ec, Visit&& visit)
|
|||||||
if(ec)
|
if(ec)
|
||||||
return;
|
return;
|
||||||
s_ = do_body + 1;
|
s_ = do_body + 1;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case do_body + 1:
|
case do_body + 1:
|
||||||
{
|
{
|
||||||
@@ -122,7 +123,7 @@ get(error_code& ec, Visit&& visit)
|
|||||||
more_ = result->second;
|
more_ = result->second;
|
||||||
v_ = cb1_t{result->first};
|
v_ = cb1_t{result->first};
|
||||||
s_ = do_body + 2;
|
s_ = do_body + 2;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
case do_body + 2:
|
case do_body + 2:
|
||||||
@@ -167,7 +168,7 @@ get(error_code& ec, Visit&& visit)
|
|||||||
result->first,
|
result->first,
|
||||||
detail::chunk_crlf()};
|
detail::chunk_crlf()};
|
||||||
s_ = do_header_c;
|
s_ = do_header_c;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
case do_header_c:
|
case do_header_c:
|
||||||
@@ -188,7 +189,7 @@ get(error_code& ec, Visit&& visit)
|
|||||||
if(ec)
|
if(ec)
|
||||||
return;
|
return;
|
||||||
s_ = do_body_c + 1;
|
s_ = do_body_c + 1;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case do_body_c + 1:
|
case do_body_c + 1:
|
||||||
{
|
{
|
||||||
@@ -213,7 +214,7 @@ get(error_code& ec, Visit&& visit)
|
|||||||
result->first,
|
result->first,
|
||||||
detail::chunk_crlf()};
|
detail::chunk_crlf()};
|
||||||
s_ = do_body_c + 2;
|
s_ = do_body_c + 2;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
case do_body_c + 2:
|
case do_body_c + 2:
|
||||||
@@ -235,7 +236,7 @@ get(error_code& ec, Visit&& visit)
|
|||||||
}(),
|
}(),
|
||||||
detail::chunk_crlf()};
|
detail::chunk_crlf()};
|
||||||
s_ = do_final_c + 1;
|
s_ = do_final_c + 1;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case do_final_c + 1:
|
case do_final_c + 1:
|
||||||
visit(ec, boost::get<ch2_t>(v_));
|
visit(ec, boost::get<ch2_t>(v_));
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#ifndef BEAST_HTTP_IMPL_STATUS_IPP
|
#ifndef BEAST_HTTP_IMPL_STATUS_IPP
|
||||||
#define BEAST_HTTP_IMPL_STATUS_IPP
|
#define BEAST_HTTP_IMPL_STATUS_IPP
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
|
|
||||||
namespace beast {
|
namespace beast {
|
||||||
@@ -24,7 +25,7 @@ int_to_status(int v)
|
|||||||
case status::continue_:
|
case status::continue_:
|
||||||
case status::switching_protocols:
|
case status::switching_protocols:
|
||||||
case status::processing:
|
case status::processing:
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
// 2xx
|
// 2xx
|
||||||
case status::ok:
|
case status::ok:
|
||||||
@@ -37,7 +38,7 @@ int_to_status(int v)
|
|||||||
case status::multi_status:
|
case status::multi_status:
|
||||||
case status::already_reported:
|
case status::already_reported:
|
||||||
case status::im_used:
|
case status::im_used:
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
// 3xx
|
// 3xx
|
||||||
case status::multiple_choices:
|
case status::multiple_choices:
|
||||||
@@ -48,7 +49,7 @@ int_to_status(int v)
|
|||||||
case status::use_proxy:
|
case status::use_proxy:
|
||||||
case status::temporary_redirect:
|
case status::temporary_redirect:
|
||||||
case status::permanent_redirect:
|
case status::permanent_redirect:
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
// 4xx
|
// 4xx
|
||||||
case status::bad_request:
|
case status::bad_request:
|
||||||
@@ -80,7 +81,7 @@ int_to_status(int v)
|
|||||||
case status::connection_closed_without_response:
|
case status::connection_closed_without_response:
|
||||||
case status::unavailable_for_legal_reasons:
|
case status::unavailable_for_legal_reasons:
|
||||||
case status::client_closed_request:
|
case status::client_closed_request:
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
// 5xx
|
// 5xx
|
||||||
case status::internal_server_error:
|
case status::internal_server_error:
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#ifndef BEAST_HTTP_IMPL_VERB_IPP
|
#ifndef BEAST_HTTP_IMPL_VERB_IPP
|
||||||
#define BEAST_HTTP_IMPL_VERB_IPP
|
#define BEAST_HTTP_IMPL_VERB_IPP
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
@@ -155,7 +156,7 @@ string_to_verb(string_view v)
|
|||||||
return verb::connect;
|
return verb::connect;
|
||||||
if(eq(v, "PY"))
|
if(eq(v, "PY"))
|
||||||
return verb::copy;
|
return verb::copy;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -216,7 +217,7 @@ string_to_verb(string_view v)
|
|||||||
case 'O':
|
case 'O':
|
||||||
if(eq(v, "VE"))
|
if(eq(v, "VE"))
|
||||||
return verb::move;
|
return verb::move;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -260,7 +261,7 @@ string_to_verb(string_view v)
|
|||||||
return verb::purge;
|
return verb::purge;
|
||||||
if(eq(v, "T"))
|
if(eq(v, "T"))
|
||||||
return verb::put;
|
return verb::put;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#include <boost/asio/handler_continuation_hook.hpp>
|
#include <boost/asio/handler_continuation_hook.hpp>
|
||||||
#include <boost/asio/handler_invoke_hook.hpp>
|
#include <boost/asio/handler_invoke_hook.hpp>
|
||||||
#include <boost/asio/write.hpp>
|
#include <boost/asio/write.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
@@ -317,7 +318,7 @@ operator()(error_code ec,
|
|||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
state_ = 3;
|
state_ = 3;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#include <boost/asio/handler_alloc_hook.hpp>
|
#include <boost/asio/handler_alloc_hook.hpp>
|
||||||
#include <boost/asio/handler_continuation_hook.hpp>
|
#include <boost/asio/handler_continuation_hook.hpp>
|
||||||
#include <boost/asio/handler_invoke_hook.hpp>
|
#include <boost/asio/handler_invoke_hook.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -153,7 +154,7 @@ operator()(error_code ec, bool again)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
d.ws.wr_block_ = &d;
|
d.ws.wr_block_ = &d;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// send close frame
|
// send close frame
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include <boost/asio/handler_alloc_hook.hpp>
|
#include <boost/asio/handler_alloc_hook.hpp>
|
||||||
#include <boost/asio/handler_continuation_hook.hpp>
|
#include <boost/asio/handler_continuation_hook.hpp>
|
||||||
#include <boost/asio/handler_invoke_hook.hpp>
|
#include <boost/asio/handler_invoke_hook.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -152,7 +153,7 @@ operator()(error_code ec, bool again)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
d.ws.wr_block_ = &d;
|
d.ws.wr_block_ = &d;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// send ping frame
|
// send ping frame
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#include <boost/asio/handler_continuation_hook.hpp>
|
#include <boost/asio/handler_continuation_hook.hpp>
|
||||||
#include <boost/asio/handler_invoke_hook.hpp>
|
#include <boost/asio/handler_invoke_hook.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@@ -522,7 +523,7 @@ operator()(error_code ec,
|
|||||||
ec = boost::asio::error::operation_aborted;
|
ec = boost::asio::error::operation_aborted;
|
||||||
goto upcall;
|
goto upcall;
|
||||||
}
|
}
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#include <boost/asio/handler_continuation_hook.hpp>
|
#include <boost/asio/handler_continuation_hook.hpp>
|
||||||
#include <boost/asio/handler_invoke_hook.hpp>
|
#include <boost/asio/handler_invoke_hook.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -230,7 +231,7 @@ operator()(error_code ec,
|
|||||||
case do_nomask_nofrag:
|
case do_nomask_nofrag:
|
||||||
BOOST_ASSERT(! d.ws.wr_block_);
|
BOOST_ASSERT(! d.ws.wr_block_);
|
||||||
d.ws.wr_block_ = &d;
|
d.ws.wr_block_ = &d;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case do_nomask_nofrag + 1:
|
case do_nomask_nofrag + 1:
|
||||||
{
|
{
|
||||||
@@ -253,7 +254,7 @@ operator()(error_code ec,
|
|||||||
case do_nomask_frag:
|
case do_nomask_frag:
|
||||||
BOOST_ASSERT(! d.ws.wr_block_);
|
BOOST_ASSERT(! d.ws.wr_block_);
|
||||||
d.ws.wr_block_ = &d;
|
d.ws.wr_block_ = &d;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case do_nomask_frag + 1:
|
case do_nomask_frag + 1:
|
||||||
{
|
{
|
||||||
@@ -301,7 +302,7 @@ operator()(error_code ec,
|
|||||||
case do_mask_nofrag:
|
case do_mask_nofrag:
|
||||||
BOOST_ASSERT(! d.ws.wr_block_);
|
BOOST_ASSERT(! d.ws.wr_block_);
|
||||||
d.ws.wr_block_ = &d;
|
d.ws.wr_block_ = &d;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case do_mask_nofrag + 1:
|
case do_mask_nofrag + 1:
|
||||||
{
|
{
|
||||||
@@ -353,7 +354,7 @@ operator()(error_code ec,
|
|||||||
case do_mask_frag:
|
case do_mask_frag:
|
||||||
BOOST_ASSERT(! d.ws.wr_block_);
|
BOOST_ASSERT(! d.ws.wr_block_);
|
||||||
d.ws.wr_block_ = &d;
|
d.ws.wr_block_ = &d;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case do_mask_frag + 1:
|
case do_mask_frag + 1:
|
||||||
{
|
{
|
||||||
@@ -406,7 +407,7 @@ operator()(error_code ec,
|
|||||||
case do_deflate:
|
case do_deflate:
|
||||||
BOOST_ASSERT(! d.ws.wr_block_);
|
BOOST_ASSERT(! d.ws.wr_block_);
|
||||||
d.ws.wr_block_ = &d;
|
d.ws.wr_block_ = &d;
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
case do_deflate + 1:
|
case do_deflate + 1:
|
||||||
{
|
{
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
#include <beast/websocket/ssl.hpp>
|
#include <beast/websocket/ssl.hpp>
|
||||||
#include <beast/websocket/stream.hpp>
|
#include <beast/websocket/stream.hpp>
|
||||||
#include <boost/asio/ssl.hpp>
|
#include <boost/asio/ssl.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
@@ -234,7 +235,7 @@ private:
|
|||||||
case 2:
|
case 2:
|
||||||
if(ec)
|
if(ec)
|
||||||
return fail("async_handshake", ec);
|
return fail("async_handshake", ec);
|
||||||
// [[fallthrough]]
|
BOOST_FALLTHROUGH;
|
||||||
|
|
||||||
// WebSocket read
|
// WebSocket read
|
||||||
case 3:
|
case 3:
|
||||||
|
Reference in New Issue
Block a user