mirror of
https://github.com/sogou/workflow.git
synced 2026-10-20 14:21:21 +08:00
add HttpMessage::is_header_complete()
This commit is contained in:
@@ -342,13 +342,11 @@ void ComplexHttpTask::check_response()
|
||||
resp->end_parsing();
|
||||
if (this->state == WFT_STATE_SYS_ERROR && this->error == ECONNRESET)
|
||||
{
|
||||
const http_parser_t *parser = resp->get_parser();
|
||||
|
||||
/* Servers can end the message by closing the connection. */
|
||||
if (http_parser_header_complete(parser) &&
|
||||
!http_parser_keep_alive(parser) &&
|
||||
!http_parser_chunked(parser) &&
|
||||
!http_parser_has_content_length(parser))
|
||||
if (resp->is_header_complete() &&
|
||||
!resp->is_keep_alive() &&
|
||||
!resp->is_chunked() &&
|
||||
!resp->has_content_length_header())
|
||||
{
|
||||
this->state = WFT_STATE_SUCCESS;
|
||||
this->error = 0;
|
||||
|
||||
@@ -93,6 +93,11 @@ public:
|
||||
this->parser) == 0;
|
||||
}
|
||||
|
||||
bool is_header_complete() const
|
||||
{
|
||||
return http_parser_header_complete(this->parser);
|
||||
}
|
||||
|
||||
bool has_connection_header() const
|
||||
{
|
||||
return http_parser_has_connection(this->parser);
|
||||
|
||||
Reference in New Issue
Block a user