X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_header_parser.c;h=e14b44333b1efe44b23b6f05fe2ba65f14bd3d11;hb=d01985309a42186e0c3ac1e8dd6e2d4a094d30c9;hp=65c0b24296bd8f6ddda1dcf2a23b87019d873b23;hpb=03f11ce599fa5a89148d588caf6ccec7f939e9d4;p=m6w6%2Fext-http 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)) {