X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_response_object.c;h=84e979c7610992381283cf730836765a6d2dace6;hp=423b7b7054f8081c4c661146790093917e455faf;hb=d83edb65a0097de2d5baa1a9fd9dbcebed34cc79;hpb=a673ef718611fe1a7c8a4c61b2f4c97fc06efc2d diff --git a/http_response_object.c b/http_response_object.c index 423b7b7..84e979c 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -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)); }