- need php_stream_open_wrapper_*ex* to pass a stream context
authorMichael Wallner <mike@php.net>
Mon, 20 Feb 2006 16:06:21 +0000 (16:06 +0000)
committerMichael Wallner <mike@php.net>
Mon, 20 Feb 2006 16:06:21 +0000 (16:06 +0000)
http_api.c
http_functions.c
http_request_object.c
php_http_send_api.h

index 285c030836bc8ef2c6c3b1d80b06c19967d6b802..e3ea4dc0499d85f097ebdf80307a5b8e8cbb7114 100644 (file)
@@ -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); \
index b1e2256c6ab72dc129a2454ee39786c7776d10e9..8ce961fdac10ccdf666076eb2ad5bd7cda2db923 100644 (file)
@@ -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)) {
index 8c4bc0ef0a8edf7510fb5adcf3119540e7989e20..affde1bae2fc7cc88e2e4d2e6bc391085b7c074c 100644 (file)
@@ -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);
index 579ea352f7e7d61ca83d8deb47e63caa9e001962..fa76b0104535e6462aa37b95c414d60930840402 100644 (file)
@@ -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);