- ditch warnings
[m6w6/ext-http] / http_response_object.c
index 423b7b7054f8081c4c661146790093917e455faf..84e979c7610992381283cf730836765a6d2dace6 100644 (file)
@@ -200,7 +200,7 @@ zend_function_entry http_response_object_fe[] = {
        HTTP_RESPONSE_ALIAS(getRequestHeaders, http_get_request_headers)
        HTTP_RESPONSE_ALIAS(getRequestBody, http_get_request_body)
 
-       {NULL, NULL, NULL}
+       EMPTY_FUNCTION_ENTRY
 };
 
 void _http_response_object_init(INIT_FUNC_ARGS)
@@ -707,9 +707,8 @@ PHP_METHOD(HttpResponse, setStream)
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &the_stream)) {
                RETURN_FALSE;
        }
-       zend_list_addref(Z_LVAL_P(the_stream));
-       php_stream_from_zval(the_real_stream, &the_stream);
        
+       php_stream_from_zval(the_real_stream, &the_stream);
        if (php_stream_stat(the_real_stream, &ssb)) {
                RETURN_FALSE;
        }
@@ -718,7 +717,8 @@ PHP_METHOD(HttpResponse, setStream)
                        (SUCCESS != UPD_STATIC_PROP(long, mode, SEND_RSRC))) {
                RETURN_FALSE;
        }
-
+       zend_list_addref(Z_LVAL_P(the_stream));
+       
        if (!(Z_LVAL_P(GET_STATIC_PROP(lastModified)) > 0)) {
                UPD_STATIC_PROP(long, lastModified, http_last_modified(the_real_stream, SEND_RSRC));
        }