cvs: php4 /ext/standard ftp_fopen_wrapper.c http_fopen_wrapper.c /main php_streams.h
| From: | Wez Furlong | Date: | Sun, 11 Aug 2002 14:29:01 +0000 |
| Subject: | cvs: php4 /ext/standard ftp_fopen_wrapper.c http_fopen_wrapper.c /main php_streams.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13262@lists.php.net to get a copy of this message | ||
wez Sun Aug 11 10:29:01 2002 EDT
Modified files:
/php4/ext/standard ftp_fopen_wrapper.c http_fopen_wrapper.c
/php4/main php_streams.h
Log:
Properly implement TSRM parameters to the new log_error
function... (Thanks Marcus!)
Add a convenience macro for importing a stream from a zval.
Index: php4/ext/standard/ftp_fopen_wrapper.c
diff -u php4/ext/standard/ftp_fopen_wrapper.c:1.25 php4/ext/standard/ftp_fopen_wrapper.c:1.26
--- php4/ext/standard/ftp_fopen_wrapper.c:1.25 Sun Aug 11 06:53:10 2002
+++ php4/ext/standard/ftp_fopen_wrapper.c Sun Aug 11 10:29:01 2002
@@ -17,7 +17,7 @@
| Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: ftp_fopen_wrapper.c,v 1.25 2002/08/11 10:53:10 wez Exp $ */
+/* $Id: ftp_fopen_wrapper.c,v 1.26 2002/08/11 14:29:01 wez Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -90,9 +90,10 @@
static php_stream_wrapper_ops ftp_stream_wops = {
php_stream_url_wrap_ftp,
- NULL,
+ NULL, /* stream_close */
php_stream_ftp_stream_stat,
- NULL
+ NULL, /* stat_url */
+ NULL /* opendir */
};
php_stream_wrapper php_stream_ftp_wrapper = {
@@ -117,7 +118,7 @@
size_t file_size = 0;
if (strchr(mode, 'a') || strchr(mode, '+')) {
- php_stream_wrapper_log_error(wrapper, options, "FTP does not support simultaneous read/write
connections.");
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP does not support simultaneous
read/write connections.");
return NULL;
}
@@ -319,7 +320,7 @@
php_stream_close(stream);
}
if (tmp_line[0] != '\0')
- php_stream_wrapper_log_error(wrapper, options, "FTP server reports %s", tmp_line);
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP server reports %s",
tmp_line);
return NULL;
}
/* }}} */
Index: php4/ext/standard/http_fopen_wrapper.c
diff -u php4/ext/standard/http_fopen_wrapper.c:1.38 php4/ext/standard/http_fopen_wrapper.c:1.39
--- php4/ext/standard/http_fopen_wrapper.c:1.38 Sun Aug 11 06:53:10 2002
+++ php4/ext/standard/http_fopen_wrapper.c Sun Aug 11 10:29:01 2002
@@ -18,7 +18,7 @@
| Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.38 2002/08/11 10:53:10 wez Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.39 2002/08/11 14:29:01 wez Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -87,7 +87,7 @@
size_t chunk_size = 0, file_size = 0;
if (strchr(mode, 'a') || strchr(mode, '+') || strchr(mode, 'w')) {
- php_stream_wrapper_log_error(wrapper, options, "HTTP wrapper does not writeable
connections.");
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP wrapper does not writeable
connections.");
return NULL;
}
@@ -118,7 +118,7 @@
#if HAVE_OPENSSL_EXT
if (use_ssl) {
if (php_stream_sock_ssl_activate(stream, 1) == FAILURE) {
- php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode");
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL
mode");
php_stream_close(stream);
stream = NULL;
goto out;
@@ -326,7 +326,7 @@
FREE_ZVAL(stream->wrapperdata);
}
} else {
- php_stream_wrapper_log_error(wrapper, options, "HTTP request failed! %s", tmp_line);
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed! %s",
tmp_line);
}
}
out:
@@ -367,9 +367,10 @@
static php_stream_wrapper_ops http_stream_wops = {
php_stream_url_wrap_http,
- NULL,
+ NULL, /* stream_close */
php_stream_http_stream_stat,
- NULL
+ NULL, /* stat_url */
+ NULL /* opendir */
};
php_stream_wrapper php_stream_http_wrapper = {
Index: php4/main/php_streams.h
diff -u php4/main/php_streams.h:1.35 php4/main/php_streams.h:1.36
--- php4/main/php_streams.h:1.35 Sun Aug 11 06:53:10 2002
+++ php4/main/php_streams.h Sun Aug 11 10:29:01 2002
@@ -226,6 +226,8 @@
# define php_stream_to_zval(stream, zval) { ZVAL_RESOURCE(zval, (stream)->rsrc_id); }
#endif
+#define php_stream_from_zval(stream, ppzval) ZEND_FETCH_RESOURCE((stream), php_stream *, (ppzval),
-1, "stream", php_file_le_stream())
+
#define PHP_STREAM_FREE_CALL_DTOR 1 /* call ops->close */
#define PHP_STREAM_FREE_RELEASE_STREAM 2 /* pefree(stream) */
#define PHP_STREAM_FREE_PRESERVE_HANDLE 4 /* tell ops->close to not close it's underlying
handle */