{
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)) {
/* advance message */
if (!old || old->type || zend_hash_num_elements(&old->hdrs)) {
- (*message) = php_http_message_init(NULL, 0, NULL TSRMLS_CC);
+ (*message) = php_http_message_init(NULL, 0, NULL);
(*message)->parent = old;
if (headers) {
(*headers) = &((*message)->hdrs);
}
if ((h_cl = php_http_message_header(*message, ZEND_STRL("Content-Length")))) {
Z_TRY_ADDREF_P(h_cl);
- zend_hash_str_update(&(*message)->hdrs, "X-Original-Content-Length", lenof("X-Original-Content-Length"), h_cl);
+ h_cl = zend_hash_str_update(&(*message)->hdrs, "X-Original-Content-Length", lenof("X-Original-Content-Length"), h_cl);
}
if ((h_cr = php_http_message_header(*message, ZEND_STRL("Content-Range")))) {
Z_TRY_ADDREF_P(h_cr);