- less custom macro cruft
[m6w6/ext-http] / php_http_message_parser.c
index 634a7648642d6a2b3991cbfbf6f717b779430ade..cc29c288b8521a7605a3d4c7d5a7c37918e4d336 100644 (file)
@@ -6,7 +6,7 @@
     | modification, are permitted provided that the conditions mentioned |
     | in the accompanying LICENSE file are met.                          |
     +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2011, Michael Wallner <mike@php.net>            |
+    | Copyright (c) 2004-2013, Michael Wallner <mike@php.net>            |
     +--------------------------------------------------------------------+
 */
 
@@ -393,11 +393,11 @@ PHP_HTTP_API php_http_message_parser_state_t php_http_message_parser_parse(php_h
                                                len = dec_len;
                                        }
 
-                                       php_stream_write(php_http_message_body_stream(&(*message)->body), str, len);
+                                       php_stream_write(php_http_message_body_stream((*message)->body), str, len);
 
                                        /* keep track */
                                        MAKE_STD_ZVAL(zcl);
-                                       ZVAL_LONG(zcl, php_http_message_body_size(&(*message)->body));
+                                       ZVAL_LONG(zcl, php_http_message_body_size((*message)->body));
                                        zend_hash_update(&(*message)->hdrs, "Content-Length", sizeof("Content-Length"), &zcl, sizeof(zval *), NULL);
                                }
 
@@ -458,7 +458,7 @@ PHP_HTTP_API php_http_message_parser_state_t php_http_message_parser_parse(php_h
                                len = dec_len;
 
                                if (php_http_encoding_stream_done(parser->dechunk)) {
-                                       cut = buffer->used - PHP_HTTP_BUFFER_LEN(parser->dechunk->ctx);
+                                       cut = buffer->used - PHP_HTTP_BUFFER(parser->dechunk->ctx)->used;
                                        php_http_message_parser_state_push(parser, 2, PHP_HTTP_MESSAGE_PARSER_STATE_BODY_DONE, PHP_HTTP_MESSAGE_PARSER_STATE_BODY);
                                } else {
                                        cut = buffer->used;