@ -731,6 +731,7 @@ reexecute:
if ( ch = = CR | | ch = = LF )
if ( ch = = CR | | ch = = LF )
break ;
break ;
parser - > flags = 0 ;
parser - > flags = 0 ;
parser - > extra_flags = 0 ;
parser - > content_length = ULLONG_MAX ;
parser - > content_length = ULLONG_MAX ;
if ( ch = = ' H ' ) {
if ( ch = = ' H ' ) {
@ -768,6 +769,7 @@ reexecute:
if ( ch = = CR | | ch = = LF )
if ( ch = = CR | | ch = = LF )
break ;
break ;
parser - > flags = 0 ;
parser - > flags = 0 ;
parser - > extra_flags = 0 ;
parser - > content_length = ULLONG_MAX ;
parser - > content_length = ULLONG_MAX ;
if ( ch = = ' H ' ) {
if ( ch = = ' H ' ) {
@ -925,6 +927,7 @@ reexecute:
if ( ch = = CR | | ch = = LF )
if ( ch = = CR | | ch = = LF )
break ;
break ;
parser - > flags = 0 ;
parser - > flags = 0 ;
parser - > extra_flags = 0 ;
parser - > content_length = ULLONG_MAX ;
parser - > content_length = ULLONG_MAX ;
if ( UNLIKELY ( ! IS_ALPHA ( ch ) ) ) {
if ( UNLIKELY ( ! IS_ALPHA ( ch ) ) ) {
@ -1338,7 +1341,7 @@ reexecute:
parser - > header_state = h_general ;
parser - > header_state = h_general ;
} else if ( parser - > index = = sizeof ( TRANSFER_ENCODING ) - 2 ) {
} else if ( parser - > index = = sizeof ( TRANSFER_ENCODING ) - 2 ) {
parser - > header_state = h_transfer_encoding ;
parser - > header_state = h_transfer_encoding ;
parser - > flags | = F_TRANSFER_ENCODING ;
parser - > extra_ flags | = F_TRANSFER_ENCODING > > 8 ;
}
}
break ;
break ;
@ -1800,7 +1803,7 @@ reexecute:
/* Cannot us transfer-encoding and a content-length header together
/* Cannot us transfer-encoding and a content-length header together
per the HTTP specification . ( RFC 7230 Section 3.3 .3 ) */
per the HTTP specification . ( RFC 7230 Section 3.3 .3 ) */
if ( ( parser - > flags & F_TRANSFER_ENCODING ) & &
if ( ( parser - > extra_ flags & ( F_TRANSFER_ENCODING > > 8 ) ) & &
( parser - > flags & F_CONTENTLENGTH ) ) {
( parser - > flags & F_CONTENTLENGTH ) ) {
/* Allow it for lenient parsing as long as `Transfer-Encoding` is
/* Allow it for lenient parsing as long as `Transfer-Encoding` is
* not ` chunked `
* not ` chunked `
@ -1886,7 +1889,7 @@ reexecute:
/* chunked encoding - ignore Content-Length header,
/* chunked encoding - ignore Content-Length header,
* prepare for a chunk */
* prepare for a chunk */
UPDATE_STATE ( s_chunk_size_start ) ;
UPDATE_STATE ( s_chunk_size_start ) ;
} else if ( parser - > flags & F_TRANSFER_ENCODING ) {
} else if ( parser - > extra_ flags & ( F_TRANSFER_ENCODING > > 8 ) ) {
if ( parser - > type = = HTTP_REQUEST & & ! lenient ) {
if ( parser - > type = = HTTP_REQUEST & & ! lenient ) {
/* RFC 7230 3.3.3 */
/* RFC 7230 3.3.3 */
@ -2162,7 +2165,7 @@ http_message_needs_eof (const http_parser *parser)
}
}
/* RFC 7230 3.3.3, see `s_headers_almost_done` */
/* RFC 7230 3.3.3, see `s_headers_almost_done` */
if ( ( parser - > flags & F_TRANSFER_ENCODING ) & &
if ( ( parser - > extra_ flags & ( F_TRANSFER_ENCODING > > 8 ) ) & &
( parser - > flags & F_CHUNKED ) = = 0 ) {
( parser - > flags & F_CHUNKED ) = = 0 ) {
return 1 ;
return 1 ;
}
}