summaryrefslogtreecommitdiff
path: root/ext/standard/http_fopen_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/http_fopen_wrapper.c')
-rw-r--r--ext/standard/http_fopen_wrapper.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index e1f8653c8d..032c6c7e36 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -111,7 +111,7 @@ static inline void strip_header(char *header_bag, char *lc_header_bag,
php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
const char *path, const char *mode, int options, char **opened_path,
- php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
+ php_stream_context *context, int redirect_max, int flags STREAMS_DC) /* {{{ */
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -149,7 +149,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
tmp_line[0] = '\0';
if (redirect_max < 1) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Redirection limit reached, aborting");
+ php_stream_wrapper_log_error(wrapper, options, "Redirection limit reached, aborting");
return NULL;
}
@@ -177,7 +177,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
/* Normal http request (possibly with proxy) */
if (strpbrk(mode, "awx+")) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP wrapper does not support writeable connections");
+ php_stream_wrapper_log_error(wrapper, options, "HTTP wrapper does not support writeable connections");
php_url_free(resource);
return NULL;
}
@@ -228,7 +228,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
}
if (errstr) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", errstr->val);
+ php_stream_wrapper_log_error(wrapper, options, "%s", errstr->val);
zend_string_release(errstr);
errstr = NULL;
}
@@ -310,7 +310,7 @@ finish:
smart_str_appendl(&header, "\r\n", sizeof("\r\n")-1);
if (php_stream_write(stream, header.s->val, header.s->len) != header.s->len) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot connect to HTTPS server through proxy");
+ php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy");
php_stream_close(stream);
stream = NULL;
}
@@ -331,9 +331,9 @@ finish:
/* enable SSL transport layer */
if (stream) {
- if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_ANY_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot connect to HTTPS server through proxy");
+ if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_ANY_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1) < 0) {
+ php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy");
php_stream_close(stream);
stream = NULL;
}
@@ -352,7 +352,7 @@ finish:
eol_detect = stream->flags & (PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
stream->flags &= ~(PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
- php_stream_context_set(stream, context TSRMLS_CC);
+ php_stream_context_set(stream, context);
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
@@ -389,7 +389,7 @@ finish:
/* Should we send the entire path in the request line, default to no. */
if (!request_fulluri && context &&
(tmpzval = php_stream_context_get_option(context, "http", "request_fulluri")) != NULL) {
- request_fulluri = zend_is_true(tmpzval TSRMLS_CC);
+ request_fulluri = zend_is_true(tmpzval);
}
if (request_fulluri) {
@@ -440,13 +440,13 @@ finish:
smart_str_0(&tmpstr);
/* Remove newlines and spaces from start and end. there's at least one extra \r\n at the end that needs to go. */
if (tmpstr.s) {
- tmp = php_trim(tmpstr.s->val, tmpstr.s->len, NULL, 0, NULL, 3 TSRMLS_CC);
+ tmp = php_trim(tmpstr.s->val, tmpstr.s->len, NULL, 0, NULL, 3);
smart_str_free(&tmpstr);
}
}
if (Z_TYPE_P(tmpzval) == IS_STRING && Z_STRLEN_P(tmpzval)) {
/* Remove newlines and spaces from start and end php_trim will estrndup() */
- tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC);
+ tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3);
}
if (tmp && tmp[0] != '\0') {
char *s;
@@ -602,7 +602,7 @@ finish:
ua[ua_len] = 0;
php_stream_write(stream, ua, ua_len);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot construct User-agent header");
+ php_error_docref(NULL, E_WARNING, "Cannot construct User-agent header");
}
if (ua) {
@@ -643,7 +643,7 @@ finish:
if (!(have_header & HTTP_HEADER_TYPE)) {
php_stream_write(stream, "Content-Type: application/x-www-form-urlencoded\r\n",
sizeof("Content-Type: application/x-www-form-urlencoded\r\n") - 1);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Content-type not specified assuming application/x-www-form-urlencoded");
+ php_error_docref(NULL, E_NOTICE, "Content-type not specified assuming application/x-www-form-urlencoded");
}
php_stream_write(stream, "\r\n", sizeof("\r\n")-1);
php_stream_write(stream, Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval));
@@ -653,12 +653,12 @@ finish:
location[0] = '\0';
- symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ symbol_table = zend_rebuild_symbol_table();
if (header_init) {
zval ztmp;
array_init(&ztmp);
- zend_set_local_var_str("http_response_header", sizeof("http_response_header")-1, &ztmp, 0 TSRMLS_CC);
+ zend_set_local_var_str("http_response_header", sizeof("http_response_header")-1, &ztmp, 0);
}
response_header = zend_hash_str_find_ind(&symbol_table->ht, "http_response_header", sizeof("http_response_header")-1);
@@ -676,7 +676,7 @@ finish:
response_code = 0;
}
if (context && NULL != (tmpzval = php_stream_context_get_option(context, "http", "ignore_errors"))) {
- ignore_errors = zend_is_true(tmpzval TSRMLS_CC);
+ ignore_errors = zend_is_true(tmpzval);
}
/* when we request only the header, don't fail even on error codes */
if ((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) {
@@ -712,7 +712,7 @@ finish:
zend_hash_next_index_insert(Z_ARRVAL_P(response_header), &http_response);
}
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed, unexpected end of socket!");
+ php_stream_wrapper_log_error(wrapper, options, "HTTP request failed, unexpected end of socket!");
goto out;
}
@@ -727,7 +727,7 @@ finish:
if (*e != '\n') {
do { /* partial header */
if (php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Failed to read HTTP headers");
+ php_stream_wrapper_log_error(wrapper, options, "Failed to read HTTP headers");
goto out;
}
e = http_header_line + http_header_line_length - 1;
@@ -763,10 +763,10 @@ finish:
zend_long decode = 1;
if (context && (tmpzval = php_stream_context_get_option(context, "http", "auto_decode")) != NULL) {
- decode = zend_is_true(tmpzval TSRMLS_CC);
+ decode = zend_is_true(tmpzval);
}
if (decode) {
- transfer_encoding = php_stream_filter_create("dechunk", NULL, php_stream_is_persistent(stream) TSRMLS_CC);
+ transfer_encoding = php_stream_filter_create("dechunk", NULL, php_stream_is_persistent(stream));
if (transfer_encoding) {
/* don't store transfer-encodeing header */
continue;
@@ -847,7 +847,7 @@ finish:
php_url_free(resource);
/* check for invalid redirection URLs */
if ((resource = php_url_parse(new_path)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path);
+ php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path);
goto out;
}
@@ -859,7 +859,7 @@ finish:
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); \
+ php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path); \
goto out; \
} \
s++; \
@@ -872,9 +872,9 @@ finish:
CHECK_FOR_CNTRL_CHARS(resource->pass)
CHECK_FOR_CNTRL_CHARS(resource->path)
}
- stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, HTTP_WRAPPER_REDIRECTED STREAMS_CC TSRMLS_CC);
+ stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, HTTP_WRAPPER_REDIRECTED STREAMS_CC);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed! %s", tmp_line);
+ php_stream_wrapper_log_error(wrapper, options, "HTTP request failed! %s", tmp_line);
}
}
out:
@@ -918,20 +918,20 @@ out:
php_stream_filter_append(&stream->readfilters, transfer_encoding);
}
} else if (transfer_encoding) {
- php_stream_filter_free(transfer_encoding TSRMLS_CC);
+ php_stream_filter_free(transfer_encoding);
}
return stream;
}
/* }}} */
-php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const 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, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_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);
+ return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_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) /* {{{ */
{
/* 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