thread safety
[m6w6/ext-http] / php_http_header_parser.c
index 69a419191b2f14558cd77053217ab17d48a0d1ac..c48e7c6193d990d23197308dd74710e5978898d9 100644 (file)
@@ -15,7 +15,7 @@ static const php_http_header_parser_state_spec_t php_http_header_parser_states[]
 };
 
 
-PHP_HTTP_API php_http_header_parser_t *php_http_header_parser_init(php_http_header_parser_t *parser TSRMLS_CC)
+PHP_HTTP_API php_http_header_parser_t *php_http_header_parser_init(php_http_header_parser_t *parser TSRMLS_DC)
 {
        if (!parser) {
                parser = emalloc(sizeof(*parser));
@@ -177,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);
                                        }