cvs: php-src(PHP_5_3) /ext/standard http_fopen_wrapper.c
| From: | Jani Taskinen | Date: | Tue, 05 May 2009 00:16:21 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/standard http_fopen_wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-57542@lists.php.net to get a copy of this message | ||
jani Tue May 5 00:16:21 2009 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/standard http_fopen_wrapper.c
Log:
- Sync with HEAD
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http_fopen_wrapper.c?r1=1.99.2.12.2.9.2.13&r2=1.99.2.12.2.9.2.14&diff_format=u
Index: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.9.2.13
php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.9.2.14
--- php-src/ext/standard/http_fopen_wrapper.c:1.99.2.12.2.9.2.13 Thu Apr 16 10:16:27 2009
+++ php-src/ext/standard/http_fopen_wrapper.c Tue May 5 00:16:21 2009
@@ -19,7 +19,7 @@
| Sara Golemon <pollita@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.9.2.13 2009/04/16 10:16:27 dmitry Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.9.2.14 2009/05/05 00:16:21 jani Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -84,7 +84,7 @@
#define HTTP_WRAPPER_HEADER_INIT 1
#define HTTP_WRAPPER_REDIRECTED 2
-php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int
options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC
TSRMLS_DC)
+php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, char *mode, int
options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC
TSRMLS_DC) /* {{{ */
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -233,9 +233,8 @@
}
}
- if (stream == NULL) {
+ if (stream == NULL)
goto out;
- }
/* avoid buffering issues while reading header */
if (options & STREAM_WILL_CAST)
@@ -327,6 +326,7 @@
strlcat(scratch, " HTTP/1.0\r\n", scratch_len);
}
+
/* send it */
php_stream_write(stream, scratch, strlen(scratch));
@@ -403,7 +403,7 @@
strcat(scratch, ":");
strcat(scratch, resource->pass);
- tmp = php_base64_encode((unsigned char*)scratch, strlen(scratch), NULL);
+ tmp = (char*)php_base64_encode((unsigned char*)scratch, strlen(scratch), NULL);
if (snprintf(scratch, scratch_len, "Authorization: Basic %s\r\n", tmp) > 0) {
php_stream_write(stream, scratch, strlen(scratch));
@@ -705,7 +705,7 @@
unsigned char *s, *e; \
int l; \
l = php_url_decode(val, strlen(val)); \
- s = val; e = s + l; \
+ s = (unsigned char*)val; e = s + l; \
while (s < e) { \
if (iscntrl(*s)) { \
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s",
new_path); \
@@ -769,22 +769,22 @@
return stream;
}
+/* }}} */
-php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, char *mode, int
options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, char *mode, int
options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
{
return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context,
PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_CC TSRMLS_CC);
}
+/* }}} */
-static int php_stream_http_stream_stat(php_stream_wrapper *wrapper,
- php_stream *stream,
- php_stream_statbuf *ssb
- TSRMLS_DC)
+static int php_stream_http_stream_stat(php_stream_wrapper *wrapper, php_stream *stream,
php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
{
/* one day, we could fill in the details based on Date: and Content-Length:
* headers. For now, we return with a failure code to prevent the underlying
* file's details from being used instead. */
return -1;
}
+/* }}} */
static php_stream_wrapper_ops http_stream_wops = {
php_stream_url_wrap_http,