update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -140,7 +140,7 @@ find_eol(
}
if(*it != '\n')
{
ec = error::bad_line_ending;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_line_ending);
return nullptr;
}
ec = {};
@@ -154,8 +154,12 @@ find_eol(
bool
basic_parser_base::
parse_dec(char const* it, char const* last, std::uint64_t& v)
parse_dec(
string_view s,
std::uint64_t& v)
{
char const* it = s.data();
char const* last = it + s.size();
if(it == last)
return false;
std::uint64_t tmp = 0;
@@ -245,7 +249,7 @@ parse_token_to_eol(
{
if(p >= last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return p;
}
if(BOOST_UNLIKELY(! is_print(*p)))
@@ -260,12 +264,12 @@ found_control:
{
if(++p >= last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return last;
}
if(*p++ != '\n')
{
ec = error::bad_line_ending;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_line_ending);
return last;
}
token_last = p - 2;
@@ -309,7 +313,7 @@ parse_method(
{
if(it + 1 > last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(! detail::is_token_char(*it))
@@ -317,18 +321,18 @@ parse_method(
}
if(it + 1 > last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(*it != ' ')
{
ec = error::bad_method;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_method);
return;
}
if(it == first)
{
// cannot be empty
ec = error::bad_method;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_method);
return;
}
result = make_string(first, it++);
@@ -346,7 +350,7 @@ parse_target(
{
if(it + 1 > last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(! is_pathchar(*it))
@@ -354,18 +358,18 @@ parse_target(
}
if(it + 1 > last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(*it != ' ')
{
ec = error::bad_target;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_target);
return;
}
if(it == first)
{
// cannot be empty
ec = error::bad_target;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_target);
return;
}
result = make_string(first, it++);
@@ -379,48 +383,48 @@ parse_version(
{
if(it + 8 > last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(*it++ != 'H')
{
ec = error::bad_version;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_version);
return;
}
if(*it++ != 'T')
{
ec = error::bad_version;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_version);
return;
}
if(*it++ != 'T')
{
ec = error::bad_version;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_version);
return;
}
if(*it++ != 'P')
{
ec = error::bad_version;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_version);
return;
}
if(*it++ != '/')
{
ec = error::bad_version;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_version);
return;
}
if(! is_digit(*it))
{
ec = error::bad_version;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_version);
return;
}
result = 10 * (*it++ - '0');
if(*it++ != '.')
{
ec = error::bad_version;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_version);
return;
}
if(! is_digit(*it))
{
ec = error::bad_version;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_version);
return;
}
result += *it++ - '0';
@@ -435,30 +439,30 @@ parse_status(
// parse 3(digit) SP
if(it + 4 > last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(! is_digit(*it))
{
ec = error::bad_status;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_status);
return;
}
result = 100 * (*it++ - '0');
if(! is_digit(*it))
{
ec = error::bad_status;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_status);
return;
}
result += 10 * (*it++ - '0');
if(! is_digit(*it))
{
ec = error::bad_status;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_status);
return;
}
result += *it++ - '0';
if(*it++ != ' ')
{
ec = error::bad_status;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_status);
return;
}
}
@@ -477,7 +481,7 @@ parse_reason(
return;
if(! p)
{
ec = error::bad_reason;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_reason);
return;
}
result = make_string(first, token_last);
@@ -491,7 +495,7 @@ parse_field(
char const* last,
string_view& name,
string_view& value,
static_string<max_obs_fold>& buf,
beast::detail::char_buffer<max_obs_fold>& buf,
error_code& ec)
{
/* header-field = field-name ":" OWS field-value OWS
@@ -538,7 +542,7 @@ parse_field(
p, last, ranges1, sizeof(ranges1)-1);
if(! found && p >= last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
for(;;)
@@ -548,20 +552,20 @@ parse_field(
if(! is_token[static_cast<
unsigned char>(*p)])
{
ec = error::bad_field;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_field);
return;
}
++p;
if(p >= last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
}
if(p == first)
{
// empty name
ec = error::bad_field;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_field);
return;
}
name = make_string(first, p);
@@ -574,7 +578,7 @@ parse_field(
{
if(p + 1 > last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(! (*p == ' ' || *p == '\t'))
@@ -587,13 +591,13 @@ parse_field(
return;
if(! p)
{
ec = error::bad_value;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_value);
return;
}
// Look 1 char past the CRLF to handle obs-fold.
if(p + 1 > last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
token_last =
@@ -607,63 +611,60 @@ parse_field(
if(token_last != first)
break;
}
buf.resize(0);
buf.append(first, token_last);
BOOST_ASSERT(! buf.empty());
#ifndef BOOST_NO_EXCEPTIONS
try
#endif
buf.clear();
if (!buf.try_append(first, token_last))
{
for(;;)
{
// eat leading ' ' and '\t'
for(;;++p)
{
if(p + 1 > last)
{
ec = error::need_more;
return;
}
if(! (*p == ' ' || *p == '\t'))
break;
}
// parse to CRLF
first = p;
p = parse_token_to_eol(p, last, token_last, ec);
if(ec)
return;
if(! p)
{
ec = error::bad_value;
return;
}
// Look 1 char past the CRLF to handle obs-fold.
if(p + 1 > last)
{
ec = error::need_more;
return;
}
token_last = trim_back(token_last, first);
if(first != token_last)
{
buf.push_back(' ');
buf.append(first, token_last);
}
if(*p != ' ' && *p != '\t')
{
value = {buf.data(), buf.size()};
return;
}
++p;
}
}
#ifndef BOOST_NO_EXCEPTIONS
catch(std::length_error const&)
{
ec = error::header_limit;
BOOST_BEAST_ASSIGN_EC(ec, error::header_limit);
return;
}
#endif
BOOST_ASSERT(! buf.empty());
for(;;)
{
// eat leading ' ' and '\t'
for(;;++p)
{
if(p + 1 > last)
{
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(! (*p == ' ' || *p == '\t'))
break;
}
// parse to CRLF
first = p;
p = parse_token_to_eol(p, last, token_last, ec);
if(ec)
return;
if(! p)
{
BOOST_BEAST_ASSIGN_EC(ec, error::bad_value);
return;
}
// Look 1 char past the CRLF to handle obs-fold.
if(p + 1 > last)
{
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
token_last = trim_back(token_last, first);
if(first != token_last)
{
if (!buf.try_push_back(' ') ||
!buf.try_append(first, token_last))
{
BOOST_BEAST_ASSIGN_EC(ec, error::header_limit);
return;
}
}
if(*p != ' ' && *p != '\t')
{
value = {buf.data(), buf.size()};
return;
}
++p;
}
}
@@ -690,7 +691,7 @@ parse_chunk_extensions(
loop:
if(it == last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(*it != ' ' && *it != '\t' && *it != ';')
@@ -703,7 +704,7 @@ loop:
++it;
if(it == last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(*it != ' ' && *it != '\t')
@@ -713,7 +714,7 @@ loop:
// ';'
if(*it != ';')
{
ec = error::bad_chunk_extension;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_chunk_extension);
return;
}
semi:
@@ -723,7 +724,7 @@ semi:
{
if(it == last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(*it != ' ' && *it != '\t')