projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
add http\Header\Parser::stream()
[m6w6/ext-http]
/
php_http_message_body.c
diff --git
a/php_http_message_body.c
b/php_http_message_body.c
index 4be45ef0ce0b7d26d688e4811b5e271db7036d58..6129caff1a9bc4eb2e4af7171eb267f87f8ed196 100644
(file)
--- a/
php_http_message_body.c
+++ b/
php_http_message_body.c
@@
-100,7
+100,7
@@
void php_http_message_body_free(php_http_message_body_t **body_ptr)
TSRMLS_FETCH_FROM_CTX(body->ts);
/* NOFIXME: shows leakinfo in DEBUG mode */
zend_list_delete(body->stream_id);
TSRMLS_FETCH_FROM_CTX(body->ts);
/* NOFIXME: shows leakinfo in DEBUG mode */
zend_list_delete(body->stream_id);
-
S
TR_FREE(body->boundary);
+
P
TR_FREE(body->boundary);
efree(body);
}
*body_ptr = NULL;
efree(body);
}
*body_ptr = NULL;
@@
-482,9
+482,11
@@
static size_t splitbody(void *opaque, char *buf, size_t len TSRMLS_DC)
}
if (!first_boundary) {
}
if (!first_boundary) {
+ int st;
/* this is not the first boundary, read rest of this message */
php_http_buffer_append(&arg->buf, buf, real_boundary - buf);
/* this is not the first boundary, read rest of this message */
php_http_buffer_append(&arg->buf, buf, real_boundary - buf);
- php_http_message_parser_parse(arg->parser, &arg->buf, 0, &arg->parser->message);
+ st=php_http_message_parser_parse(arg->parser, &arg->buf, 0, &arg->parser->message);
+ //fprintf(stderr, "1 st=%d\n",st);
}
/* move after the boundary */
}
/* move after the boundary */
@@
-524,9
+526,11
@@
static size_t splitbody(void *opaque, char *buf, size_t len TSRMLS_DC)
/* let there be room for the next boundary */
if (len > arg->boundary_len) {
/* let there be room for the next boundary */
if (len > arg->boundary_len) {
+ int st;
consumed += len - arg->boundary_len;
php_http_buffer_append(&arg->buf, buf, len - arg->boundary_len);
consumed += len - arg->boundary_len;
php_http_buffer_append(&arg->buf, buf, len - arg->boundary_len);
- php_http_message_parser_parse(arg->parser, &arg->buf, 0, &arg->parser->message);
+ st=php_http_message_parser_parse(arg->parser, &arg->buf, 0, &arg->parser->message);
+ //fprintf(stderr, "2 st=%d\n", st);
}
arg->consumed += consumed;
}
arg->consumed += consumed;
@@
-557,7
+561,7
@@
php_http_message_t *php_http_message_body_split(php_http_message_body_t *body, c
php_http_buffer_free(&tmp);
php_http_message_parser_free(&arg.parser);
php_http_buffer_dtor(&arg.buf);
php_http_buffer_free(&tmp);
php_http_message_parser_free(&arg.parser);
php_http_buffer_dtor(&arg.buf);
-
S
TR_FREE(arg.boundary_str);
+
P
TR_FREE(arg.boundary_str);
return msg;
}
return msg;
}