1919#include "ext/uri/php_uri.h"
2020
2121static char * get_http_header_value_nodup (char * headers , char * type , size_t * len );
22- static char * get_http_header_value (char * headers , char * type );
23- static zend_string * get_http_body (php_stream * socketd , bool close , char * headers );
22+ static char * get_http_header_value (zend_string * headers , char * type );
23+ static zend_string * get_http_body (php_stream * socketd , bool close , zend_string * headers );
2424static zend_string * get_http_headers (php_stream * socketd );
2525
2626#define smart_str_append_const (str , const ) \
@@ -946,7 +946,7 @@ bool make_http_soap_request(
946946 /* Check to see what HTTP status was sent */
947947 http_1_1 = false;
948948 http_status = 0 ;
949- http_version = get_http_header_value (ZSTR_VAL ( http_headers ) , "HTTP/" );
949+ http_version = get_http_header_value (http_headers , "HTTP/" );
950950 if (http_version ) {
951951 char * tmp ;
952952
@@ -1070,7 +1070,7 @@ bool make_http_soap_request(
10701070 if (http_1_1 ) {
10711071 http_close = false;
10721072 if (use_proxy && !use_ssl ) {
1073- connection = get_http_header_value (ZSTR_VAL ( http_headers ) , "Proxy-Connection:" );
1073+ connection = get_http_header_value (http_headers , "Proxy-Connection:" );
10741074 if (connection ) {
10751075 if (strncasecmp (connection , "close" , sizeof ("close" )- 1 ) == 0 ) {
10761076 http_close = true;
@@ -1079,7 +1079,7 @@ bool make_http_soap_request(
10791079 }
10801080 }
10811081 if (http_close == false) {
1082- connection = get_http_header_value (ZSTR_VAL ( http_headers ) , "Connection:" );
1082+ connection = get_http_header_value (http_headers , "Connection:" );
10831083 if (connection ) {
10841084 if (strncasecmp (connection , "close" , sizeof ("close" )- 1 ) == 0 ) {
10851085 http_close = true;
@@ -1090,7 +1090,7 @@ bool make_http_soap_request(
10901090 } else {
10911091 http_close = true;
10921092 if (use_proxy && !use_ssl ) {
1093- connection = get_http_header_value (ZSTR_VAL ( http_headers ) , "Proxy-Connection:" );
1093+ connection = get_http_header_value (http_headers , "Proxy-Connection:" );
10941094 if (connection ) {
10951095 if (strncasecmp (connection , "Keep-Alive" , sizeof ("Keep-Alive" )- 1 ) == 0 ) {
10961096 http_close = false;
@@ -1099,7 +1099,7 @@ bool make_http_soap_request(
10991099 }
11001100 }
11011101 if (http_close == true) {
1102- connection = get_http_header_value (ZSTR_VAL ( http_headers ) , "Connection:" );
1102+ connection = get_http_header_value (http_headers , "Connection:" );
11031103 if (connection ) {
11041104 if (strncasecmp (connection , "Keep-Alive" , sizeof ("Keep-Alive" )- 1 ) == 0 ) {
11051105 http_close = false;
@@ -1110,7 +1110,7 @@ bool make_http_soap_request(
11101110 }
11111111
11121112
1113- http_body = get_http_body (stream , http_close , ZSTR_VAL ( http_headers ) );
1113+ http_body = get_http_body (stream , http_close , http_headers );
11141114 if (!http_body ) {
11151115 if (request != buf ) {
11161116 zend_string_release_ex (request , 0 );
@@ -1142,7 +1142,7 @@ bool make_http_soap_request(
11421142 if (http_status >= 300 && http_status < 400 ) {
11431143 char * loc ;
11441144
1145- if ((loc = get_http_header_value (ZSTR_VAL ( http_headers ) , "Location:" )) != NULL ) {
1145+ if ((loc = get_http_header_value (http_headers , "Location:" )) != NULL ) {
11461146 const php_uri_parser * uri_parser = php_uri_get_parser (uri_parser_class );
11471147 if (uri_parser == NULL ) {
11481148 efree (loc );
@@ -1195,7 +1195,7 @@ bool make_http_soap_request(
11951195 zval * digest = Z_CLIENT_DIGEST_P (this_ptr );
11961196 zval * login = Z_CLIENT_LOGIN_P (this_ptr );
11971197 zval * password = Z_CLIENT_PASSWORD_P (this_ptr );
1198- char * auth = get_http_header_value (ZSTR_VAL ( http_headers ) , "WWW-Authenticate:" );
1198+ char * auth = get_http_header_value (http_headers , "WWW-Authenticate:" );
11991199 if (auth && strstr (auth , "Digest" ) == auth && Z_TYPE_P (digest ) != IS_ARRAY
12001200 && Z_TYPE_P (login ) == IS_STRING && Z_TYPE_P (password ) == IS_STRING ) {
12011201 char * s ;
@@ -1265,7 +1265,7 @@ bool make_http_soap_request(
12651265 smart_str_free (& soap_headers_z );
12661266
12671267 /* Check and see if the server even sent a xml document */
1268- content_type = get_http_header_value (ZSTR_VAL ( http_headers ) , "Content-Type:" );
1268+ content_type = get_http_header_value (http_headers , "Content-Type:" );
12691269 if (content_type ) {
12701270 char * pos = NULL ;
12711271 int cmplen ;
@@ -1295,7 +1295,7 @@ bool make_http_soap_request(
12951295 }
12961296
12971297 /* Decompress response */
1298- content_encoding = get_http_header_value (ZSTR_VAL ( http_headers ) , "Content-Encoding:" );
1298+ content_encoding = get_http_header_value (http_headers , "Content-Encoding:" );
12991299 if (content_encoding ) {
13001300 zval retval ;
13011301 zval params [1 ];
@@ -1429,12 +1429,12 @@ static char *get_http_header_value_nodup(char *headers, char *type, size_t *len)
14291429 return NULL ;
14301430}
14311431
1432- static char * get_http_header_value (char * headers , char * type )
1432+ static char * get_http_header_value (zend_string * headers , char * type )
14331433{
14341434 size_t len ;
14351435 char * value ;
14361436
1437- value = get_http_header_value_nodup (headers , type , & len );
1437+ value = get_http_header_value_nodup (ZSTR_VAL ( headers ) , type , & len );
14381438
14391439 if (value ) {
14401440 return estrndup (value , len );
@@ -1443,7 +1443,7 @@ static char *get_http_header_value(char *headers, char *type)
14431443 return NULL ;
14441444}
14451445
1446- static zend_string * get_http_body (php_stream * stream , bool close , char * headers )
1446+ static zend_string * get_http_body (php_stream * stream , bool close , zend_string * headers )
14471447{
14481448 zend_string * http_buf = NULL ;
14491449 char * header ;
0 commit comments