X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_header_parser.c;h=e14b44333b1efe44b23b6f05fe2ba65f14bd3d11;hp=65c0b24296bd8f6ddda1dcf2a23b87019d873b23;hb=49c4716aa5a97b2ae94491e74f5ff5c13c0ddee3;hpb=b0c4cca568d6704c5d2aa3c3f0ec99f96fa3c44e diff --git a/php_http_header_parser.c b/php_http_header_parser.c index 65c0b24..e14b443 100644 --- a/php_http_header_parser.c +++ b/php_http_header_parser.c @@ -94,8 +94,11 @@ php_http_header_parser_state_t php_http_header_parser_parse(php_http_header_pars { while (buffer->used || !php_http_header_parser_states[php_http_header_parser_state_is(parser)].need_data) { #if 0 - const char *state[] = {"START", "KEY", "VALUE", "HEADER_DONE", "DONE"}; - fprintf(stderr, "#HP: %s (avail:%zu, num:%d)\n", php_http_header_parser_state_is(parser) < 0 ? "FAILURE" : state[php_http_header_parser_state_is(parser)], buffer->used, headers?zend_hash_num_elements(headers):0); + const char *state[] = {"START", "KEY", "VALUE", "VALUE_EX", "HEADER_DONE", "DONE"}; + int num_headers = headers ? zend_hash_num_elements(headers) : 0; + fprintf(stderr, "#HP: (%d) %s (avail:%zu, num:%d)\n", php_http_header_parser_state_is(parser), + php_http_header_parser_state_is(parser) < 0 ? "FAILURE" : state[php_http_header_parser_state_is(parser)], + buffer->used, num_headers); _dpf(0, buffer->data, buffer->used); #endif switch (php_http_header_parser_state_pop(parser)) {