X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_header_parser.c;h=e6dca1ee938be43a889413f997cba449fe1293a3;hb=4d708279b6956fc95b253ddc88671fb2f0e5aa39;hp=07bcab5f930019e54c49bd7eb42ad3d4e93c5e34;hpb=c5c580f24e24e8032a0554a2e39e38c496144bc2;p=m6w6%2Fext-http diff --git a/php_http_header_parser.c b/php_http_header_parser.c index 07bcab5..e6dca1e 100644 --- a/php_http_header_parser.c +++ b/php_http_header_parser.c @@ -89,9 +89,8 @@ PHP_HTTP_API STATUS php_http_header_parser_parse(php_http_header_parser_t *parse 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-%p: %s (%d) %.*s…\n", parser, - php_http_header_parser_state_is(parser)<0?"FAILURE":state[php_http_header_parser_state_is(parser)], - zend_hash_num_elements(headers), MIN(16,buffer->used), buffer->data); + fprintf(stderr, "#HP: %s (%d)\n", php_http_header_parser_state_is(parser) < 0 ? "FAILURE" : state[php_http_header_parser_state_is(parser)], zend_hash_num_elements(headers)); + _dpf(0, buffer->data, buffer->used); #endif switch (php_http_header_parser_state_pop(parser)) { case PHP_HTTP_HEADER_PARSER_STATE_FAILURE: @@ -178,7 +177,7 @@ PHP_HTTP_API STATUS php_http_header_parser_parse(php_http_header_parser_t *parse php_http_pretty_key(parser->_key.str, parser->_key.len, 1, 1); if (SUCCESS == zend_hash_find(headers, parser->_key.str, parser->_key.len + 1, (void *) &exist)) { convert_to_array(*exist); - add_next_index_stringl(&array, parser->_val.str, parser->_val.len, 0); + add_next_index_stringl(*exist, parser->_val.str, parser->_val.len, 0); } else { add_assoc_stringl_ex(&array, parser->_key.str, parser->_key.len + 1, parser->_val.str, parser->_val.len, 0); }