Added source-location to all ecs.

Closes #2475.
This commit is contained in:
Klemens authored and Klemens Morgenstern committed 2022-12-20 13:16:39 +08:00
1 parent ce99605ef9
commit 860bfbdeab
8 files changed
+117 -103

No files matched your search

@@ -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 = {};
@@ -249,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)))
@@ -264,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;
@@ -313,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))
@@ -321,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++);
@@ -350,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))
@@ -358,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++);
@@ -383,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';
@@ -439,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;
}
}
@@ -481,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);
@@ -542,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(;;)
@@ -552,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);
@@ -578,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'))
@@ -591,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 =
@@ -614,7 +614,7 @@ parse_field(
buf.clear();
if (!buf.try_append(first, token_last))
{
ec = error::header_limit;
BOOST_BEAST_ASSIGN_EC(ec, error::header_limit);
return;
}
@@ -626,7 +626,7 @@ parse_field(
{
if(p + 1 > last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(! (*p == ' ' || *p == '\t'))
@@ -639,13 +639,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 = trim_back(token_last, first);
@@ -654,7 +654,7 @@ parse_field(
if (!buf.try_push_back(' ') ||
!buf.try_append(first, token_last))
{
ec = error::header_limit;
BOOST_BEAST_ASSIGN_EC(ec, error::header_limit);
return;
}
}
@@ -691,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 != ';')
@@ -704,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')
@@ -714,7 +714,7 @@ loop:
// ';'
if(*it != ';')
{
ec = error::bad_chunk_extension;
BOOST_BEAST_ASSIGN_EC(ec, error::bad_chunk_extension);
return;
}
semi:
@@ -724,7 +724,7 @@ semi:
{
if(it == last)
{
ec = error::need_more;
BOOST_BEAST_ASSIGN_EC(ec, error::need_more);
return;
}
if(*it != ' ' && *it != '\t')