mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 21:07:26 +02:00
Support -fno-exceptions
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Version 226:
|
||||||
|
|
||||||
|
* Support -fno-exceptions
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 225:
|
Version 225:
|
||||||
|
|
||||||
* Tidy up an unused function
|
* Tidy up an unused function
|
||||||
|
@ -86,8 +86,8 @@ void stream::initiate_read(
|
|||||||
|
|
||||||
++in_->nread;
|
++in_->nread;
|
||||||
if(in_->op != nullptr)
|
if(in_->op != nullptr)
|
||||||
throw std::logic_error(
|
BOOST_THROW_EXCEPTION(
|
||||||
"in_->op != nullptr");
|
std::logic_error{"in_->op != nullptr"});
|
||||||
|
|
||||||
// test failure
|
// test failure
|
||||||
error_code ec;
|
error_code ec;
|
||||||
|
@ -674,7 +674,9 @@ struct basic_parser_base
|
|||||||
buf.resize(0);
|
buf.resize(0);
|
||||||
buf.append(first, token_last);
|
buf.append(first, token_last);
|
||||||
BOOST_ASSERT(! buf.empty());
|
BOOST_ASSERT(! buf.empty());
|
||||||
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
try
|
try
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
@ -719,11 +721,13 @@ struct basic_parser_base
|
|||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
catch(std::length_error const&)
|
catch(std::length_error const&)
|
||||||
{
|
{
|
||||||
ec = error::header_limit;
|
ec = error::header_limit;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1048,6 +1048,7 @@ set_chunked_impl(bool value)
|
|||||||
// filter "chunked"
|
// filter "chunked"
|
||||||
if(it == end())
|
if(it == end())
|
||||||
return;
|
return;
|
||||||
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
static_string<max_static_buffer> buf;
|
static_string<max_static_buffer> buf;
|
||||||
@ -1062,6 +1063,7 @@ set_chunked_impl(bool value)
|
|||||||
erase(field::transfer_encoding);
|
erase(field::transfer_encoding);
|
||||||
}
|
}
|
||||||
catch(std::length_error const&)
|
catch(std::length_error const&)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef BOOST_BEAST_HTTP_NO_FIELDS_BASIC_STRING_ALLOCATOR
|
#ifdef BOOST_BEAST_HTTP_NO_FIELDS_BASIC_STRING_ALLOCATOR
|
||||||
// Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56437
|
// Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56437
|
||||||
@ -1108,6 +1110,7 @@ set_keep_alive_impl(
|
|||||||
{
|
{
|
||||||
// VFALCO What about Proxy-Connection ?
|
// VFALCO What about Proxy-Connection ?
|
||||||
auto const value = (*this)[field::connection];
|
auto const value = (*this)[field::connection];
|
||||||
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
static_string<max_static_buffer> buf;
|
static_string<max_static_buffer> buf;
|
||||||
@ -1119,6 +1122,7 @@ set_keep_alive_impl(
|
|||||||
set(field::connection, buf);
|
set(field::connection, buf);
|
||||||
}
|
}
|
||||||
catch(std::length_error const&)
|
catch(std::length_error const&)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef BOOST_BEAST_HTTP_NO_FIELDS_BASIC_STRING_ALLOCATOR
|
#ifdef BOOST_BEAST_HTTP_NO_FIELDS_BASIC_STRING_ALLOCATOR
|
||||||
// Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56437
|
// Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56437
|
||||||
|
@ -350,18 +350,11 @@ private:
|
|||||||
}
|
}
|
||||||
used_ = true;
|
used_ = true;
|
||||||
|
|
||||||
try
|
m_.target(target);
|
||||||
{
|
if(method != verb::unknown)
|
||||||
m_.target(target);
|
m_.method(method);
|
||||||
if(method != verb::unknown)
|
else
|
||||||
m_.method(method);
|
m_.method_string(method_str);
|
||||||
else
|
|
||||||
m_.method_string(method_str);
|
|
||||||
}
|
|
||||||
catch(std::bad_alloc const&)
|
|
||||||
{
|
|
||||||
ec = error::bad_alloc;
|
|
||||||
}
|
|
||||||
m_.version(version);
|
m_.version(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,14 +402,7 @@ private:
|
|||||||
|
|
||||||
m_.result(code);
|
m_.result(code);
|
||||||
m_.version(version);
|
m_.version(version);
|
||||||
try
|
m_.reason(reason);
|
||||||
{
|
|
||||||
m_.reason(reason);
|
|
||||||
}
|
|
||||||
catch(std::bad_alloc const&)
|
|
||||||
{
|
|
||||||
ec = error::bad_alloc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -443,16 +429,9 @@ private:
|
|||||||
field name,
|
field name,
|
||||||
string_view name_string,
|
string_view name_string,
|
||||||
string_view value,
|
string_view value,
|
||||||
error_code& ec) override
|
error_code&) override
|
||||||
{
|
{
|
||||||
try
|
m_.insert(name, name_string, value);
|
||||||
{
|
|
||||||
m_.insert(name, name_string, value);
|
|
||||||
}
|
|
||||||
catch(std::bad_alloc const&)
|
|
||||||
{
|
|
||||||
ec = error::bad_alloc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user