@@ -370,6 +370,13 @@ size_t http_parser_execute (http_parser *parser,
370
370
uint64_t index = parser -> index ;
371
371
uint64_t nread = parser -> nread ;
372
372
373
+ /* technically we could combine all of these (except for url_mark) into one
374
+ variable, saving stack space, but it seems more clear to have them
375
+ separated. */
376
+ const char * header_field_mark = 0 ;
377
+ const char * header_value_mark = 0 ;
378
+ const char * url_mark = 0 ;
379
+
373
380
/* We're in an error state. Don't bother doing anything. */
374
381
if (HTTP_PARSER_ERRNO (parser ) != HPE_OK ) {
375
382
return 0 ;
@@ -396,12 +403,6 @@ size_t http_parser_execute (http_parser *parser,
396
403
}
397
404
}
398
405
399
- /* technically we could combine all of these (except for url_mark) into one
400
- variable, saving stack space, but it seems more clear to have them
401
- separated. */
402
- const char * header_field_mark = 0 ;
403
- const char * header_value_mark = 0 ;
404
- const char * url_mark = 0 ;
405
406
406
407
if (state == s_header_field )
407
408
header_field_mark = data ;
@@ -690,12 +691,13 @@ size_t http_parser_execute (http_parser *parser,
690
691
691
692
case s_req_method :
692
693
{
694
+ const char * matcher ;
693
695
if (ch == '\0' ) {
694
696
SET_ERRNO (HPE_INVALID_METHOD );
695
697
goto error ;
696
698
}
697
699
698
- const char * matcher = method_strings [parser -> method ];
700
+ matcher = method_strings [parser -> method ];
699
701
if (ch == ' ' && matcher [index ] == '\0' ) {
700
702
state = s_req_spaces_before_url ;
701
703
} else if (ch == matcher [index ]) {
0 commit comments