X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_header_parser.c;h=1dcd97b58800c4f7a7c40d8398d70774b9d23125;hp=0dbaf848f9e72f02d59f55f27e87ef7c4ba79eee;hb=6cc24086f57aa1e8f4d6a2c12361635e7c24f60f;hpb=d926a12aeec96752456eddfbf9a04a002809a0d2 diff --git a/php_http_header_parser.c b/php_http_header_parser.c index 0dbaf84..1dcd97b 100644 --- a/php_http_header_parser.c +++ b/php_http_header_parser.c @@ -156,7 +156,7 @@ PHP_HTTP_API STATUS php_http_header_parser_parse(php_http_header_parser_t *parse if ((eol_str = php_http_locate_bin_eol(buffer->data, buffer->used, &eol_len))) { if (eol_str + eol_len - buffer->data < buffer->used) { - char *nextline = eol_str + eol_len; + const char *nextline = eol_str + eol_len; if (*nextline == '\t' || *nextline == ' ') { while (nextline < buffer->data + buffer->used && (*nextline == '\t' || *nextline == ' ')) { @@ -188,6 +188,10 @@ PHP_HTTP_API STATUS php_http_header_parser_parse(php_http_header_parser_t *parse if (parser->_key.str && parser->_val.str) { zval array, **exist; + if (!headers && callback_func) { + callback_func(callback_arg, &headers, NULL TSRMLS_CC); + } + INIT_PZVAL_ARRAY(&array, headers); php_http_pretty_key(parser->_key.str, parser->_key.len, 1, 1); if (SUCCESS == zend_symtable_find(headers, parser->_key.str, parser->_key.len + 1, (void *) &exist)) {