阅读 boost http 服务器示例(请参阅http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/examples/cpp11_examples.html)并在 request_parser.cpp 文件中,我看到了 header_lws 状态。部分代码如下:
case header_line_start:
if (input == '\r')
{
state_ = expecting_newline_3;
return indeterminate;
}
else if (!req.headers.empty() && (input == ' ' || input == '\t'))
{
state_ = header_lws;
return indeterminate;
}
else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
{
return bad;
}
else
{
req.headers.push_back(header());
req.headers.back().name.push_back(input);
state_ = [header_name];
return indeterminate;
}
case header_lws:
if (input == '\r')
{
state_ = expecting_newline_2;
return indeterminate;
}
else if (input == ' ' || input == '\t')
{
return indeterminate;
}
else if (is_ctl(input))
{
return bad;
}
else
{
state_ = header_value;
req.headers.back().value.push_back(input);
return indeterminate;
}
在 boost http 服务器示例中,header_lws 状态是什么意思?