Tidy up BEAST_NO_BIG_VARIANTS

This commit is contained in:
Vinnie Falco
2017-07-06 20:44:57 -07:00
parent 8ee911f632
commit bb0e86ac01
3 changed files with 10 additions and 10 deletions

View File

@@ -2,6 +2,8 @@ Version 75:
* Use file_body for valid requests, string_body otherwise. * Use file_body for valid requests, string_body otherwise.
* Construct buffer_prefix_view in-place * Construct buffer_prefix_view in-place
* Shrink serializer buffers using buffers_ref
* Tidy up BEAST_NO_BIG_VARIANTS
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@@ -146,7 +146,7 @@ next(error_code& ec, Visit&& visit)
if(! result) if(! result)
goto go_header_only_c; goto go_header_only_c;
more_ = result->second; more_ = result->second;
#if ! BEAST_NO_BIG_VARIANTS #ifndef BEAST_NO_BIG_VARIANTS
if(! more_) if(! more_)
{ {
// do it all in one buffer // do it all in one buffer
@@ -226,7 +226,7 @@ next(error_code& ec, Visit&& visit)
if(! result) if(! result)
goto go_final_c; goto go_final_c;
more_ = result->second; more_ = result->second;
#if ! BEAST_NO_BIG_VARIANTS #ifndef BEAST_NO_BIG_VARIANTS
if(! more_) if(! more_)
{ {
// do it all in one buffer // do it all in one buffer
@@ -279,7 +279,7 @@ next(error_code& ec, Visit&& visit)
visit(ec, boost::get<ch1_t>(v_)); visit(ec, boost::get<ch1_t>(v_));
break; break;
#if ! BEAST_NO_BIG_VARIANTS #ifndef BEAST_NO_BIG_VARIANTS
go_body_final_c: go_body_final_c:
s_ = do_body_final_c; s_ = do_body_final_c;
case do_body_final_c: case do_body_final_c:
@@ -423,7 +423,7 @@ consume(std::size_t n)
s_ = do_final_c; s_ = do_final_c;
break; break;
#if ! BEAST_NO_BIG_VARIANTS #ifndef BEAST_NO_BIG_VARIANTS
case do_body_final_c: case do_body_final_c:
{ {
auto& b = boost::get<ch2_t>(v_); auto& b = boost::get<ch2_t>(v_);

View File

@@ -21,9 +21,7 @@
#ifndef BEAST_NO_BIG_VARIANTS #ifndef BEAST_NO_BIG_VARIANTS
# if defined(BOOST_GCC) && BOOST_GCC < 50000 && BOOST_VERSION < 106400 # if defined(BOOST_GCC) && BOOST_GCC < 50000 && BOOST_VERSION < 106400
# define BEAST_NO_BIG_VARIANTS 1 # define BEAST_NO_BIG_VARIANTS
# else
# define BEAST_NO_BIG_VARIANTS 0
# endif # endif
#endif #endif
@@ -148,7 +146,7 @@ class serializer
do_header_c = 70, do_header_c = 70,
do_body_c = 80, do_body_c = 80,
do_final_c = 90, do_final_c = 90,
#if ! BEAST_NO_BIG_VARIANTS #ifndef BEAST_NO_BIG_VARIANTS
do_body_final_c = 100, do_body_final_c = 100,
do_all_c = 110, do_all_c = 110,
#endif #endif
@@ -186,7 +184,7 @@ class serializer
typename reader::const_buffers_type, // body typename reader::const_buffers_type, // body
boost::asio::const_buffers_1>>; // crlf boost::asio::const_buffers_1>>; // crlf
#if ! BEAST_NO_BIG_VARIANTS #ifndef BEAST_NO_BIG_VARIANTS
using ch2_t = consuming_buffers<buffer_cat_view< using ch2_t = consuming_buffers<buffer_cat_view<
detail::chunk_header, // chunk-header detail::chunk_header, // chunk-header
boost::asio::const_buffers_1, // chunk-ext boost::asio::const_buffers_1, // chunk-ext
@@ -219,7 +217,7 @@ class serializer
boost::optional<reader> rd_; boost::optional<reader> rd_;
boost::variant<boost::blank, boost::variant<boost::blank,
ch_t, cb0_t, cb1_t, ch0_t, ch1_t ch_t, cb0_t, cb1_t, ch0_t, ch1_t
#if ! BEAST_NO_BIG_VARIANTS #ifndef BEAST_NO_BIG_VARIANTS
,ch2_t, ch3_t ,ch2_t, ch3_t
#endif #endif
, ch4_t> v_; , ch4_t> v_;