From 1dbcba16c7ba9c580b12e9fdce49b6b2a190233b Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 20 Feb 2006 16:06:21 +0000 Subject: [PATCH] - need php_stream_open_wrapper_*ex* to pass a stream context --- http_api.c | 2 +- http_functions.c | 2 +- http_request_object.c | 2 +- php_http_send_api.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/http_api.c b/http_api.c index 285c030..e3ea4dc 100644 --- a/http_api.c +++ b/http_api.c @@ -116,7 +116,7 @@ void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC) #define HTTP_LOG_WRITE(file, type, msg) \ if (file && *file) { \ - php_stream *log = php_stream_open_wrapper(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT); \ + php_stream *log = php_stream_open_wrapper_ex(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); \ \ if (log) { \ php_stream_printf(log TSRMLS_CC, "%s\t[%s]\t%s\t<%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \ diff --git a/http_functions.c b/http_functions.c index b1e2256..8ce961f 100644 --- a/http_functions.c +++ b/http_functions.c @@ -1502,7 +1502,7 @@ PHP_FUNCTION(http_put_file) RETURN_FALSE; } - if (!(stream = php_stream_open_wrapper(file, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT))) { + if (!(stream = php_stream_open_wrapper_ex(file, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT))) { RETURN_FALSE; } if (php_stream_stat(stream, &ssb)) { diff --git a/http_request_object.c b/http_request_object.c index 8c4bc0e..affde1b 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -450,7 +450,7 @@ STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ case HTTP_PUT: { php_stream_statbuf ssb; - php_stream *stream = php_stream_open_wrapper(Z_STRVAL_P(GET_PROP(putFile)), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT); + php_stream *stream = php_stream_open_wrapper_ex(Z_STRVAL_P(GET_PROP(putFile)), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); if (stream && !php_stream_stat(stream, &ssb)) { obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 1); diff --git a/php_http_send_api.h b/php_http_send_api.h index 579ea35..fa76b01 100644 --- a/php_http_send_api.h +++ b/php_http_send_api.h @@ -61,8 +61,8 @@ PHP_HTTP_API STATUS _http_send_content_disposition(const char *filename, size_t #define http_send_ex(d, s, m, nc) _http_send_ex((d), (s), (m), (nc) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_ex(const void *data, size_t data_size, http_send_mode mode, zend_bool no_cache TSRMLS_DC); -#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT), 1, 0) -#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT), 1, (nc)) +#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper_ex(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT), 1, 0) +#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper_ex(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT), 1, (nc)) #define http_send_stream(s) http_send_stream_ex((s), 0, 0) #define http_send_stream_ex(s, c, nc) _http_send_stream_ex((s), (c), (nc) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_stream_ex(php_stream *s, zend_bool close_stream, zend_bool no_cache TSRMLS_DC); -- 2.30.2