fix warning
[m6w6/ext-http] / php_http_message.c
index 6adc557a99897bf1434bf0cce0bc2e9f222c6aae..0ffdd9e5002572110231e9fd768554a332934af1 100644 (file)
@@ -6,7 +6,7 @@
     | modification, are permitted provided that the conditions mentioned |
     | in the accompanying LICENSE file are met.                          |
     +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2013, Michael Wallner <mike@php.net>            |
+    | Copyright (c) 2004-2014, Michael Wallner <mike@php.net>            |
     +--------------------------------------------------------------------+
 */
 
@@ -784,7 +784,7 @@ STATUS php_http_message_object_set_body(php_http_message_object_t *msg_obj, zval
 
 STATUS php_http_message_object_init_body_object(php_http_message_object_t *obj)
 {
-       TSRMLS_FETCH_FROM_CTX(obj);
+       TSRMLS_FETCH_FROM_CTX(obj->message->ts);
 
        php_http_message_body_addref(obj->message->body);
        return php_http_new(NULL, php_http_message_body_class_entry, (php_http_new_t) php_http_message_body_object_new_ex, NULL, obj->message->body, (void *) &obj->body TSRMLS_CC);
@@ -1808,7 +1808,9 @@ ZEND_BEGIN_ARG_INFO_EX(ai_HttpMessage_count, 0, 0, 0)
 ZEND_END_ARG_INFO();
 static PHP_METHOD(HttpMessage, count)
 {
-       if (SUCCESS == zend_parse_parameters_none()) {
+       long count_mode = -1;
+
+       if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &count_mode)) {
                long i = 0;
                php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);