@@ -347,15 +347,12 @@ bool make_http_soap_request(
347
347
int use_proxy = 0 ;
348
348
int use_ssl ;
349
349
zend_string * http_body ;
350
- char * content_type , * http_version ;
351
350
bool http_close ;
352
351
zend_string * http_headers ;
353
- char * connection ;
354
352
bool http_1_1 ;
355
353
int http_status ;
356
354
bool content_type_xml = false;
357
355
zend_long redirect_max = 20 ;
358
- char * content_encoding ;
359
356
char * http_msg = NULL ;
360
357
bool old_allow_url_fopen ;
361
358
php_stream_context * context = NULL ;
@@ -957,7 +954,7 @@ bool make_http_soap_request(
957
954
/* Check to see what HTTP status was sent */
958
955
http_1_1 = false;
959
956
http_status = 0 ;
960
- http_version = get_http_header_value (http_headers , "HTTP/" );
957
+ char * http_version = get_http_header_value (http_headers , "HTTP/" );
961
958
if (http_version ) {
962
959
char * tmp ;
963
960
@@ -1086,16 +1083,16 @@ bool make_http_soap_request(
1086
1083
if (http_1_1 ) {
1087
1084
http_close = false;
1088
1085
if (use_proxy && !use_ssl ) {
1089
- connection = get_http_header_value (http_headers , "Proxy-Connection:" );
1090
- if (connection ) {
1091
- if (strncasecmp (connection , "close" , sizeof ("close" )- 1 ) == 0 ) {
1086
+ char * proxy_connection = get_http_header_value (http_headers , "Proxy-Connection:" );
1087
+ if (proxy_connection ) {
1088
+ if (strncasecmp (proxy_connection , "close" , sizeof ("close" )- 1 ) == 0 ) {
1092
1089
http_close = true;
1093
1090
}
1094
- efree (connection );
1091
+ efree (proxy_connection );
1095
1092
}
1096
1093
}
1097
1094
if (!http_close ) {
1098
- connection = get_http_header_value (http_headers , "Connection:" );
1095
+ char * connection = get_http_header_value (http_headers , "Connection:" );
1099
1096
if (connection ) {
1100
1097
if (strncasecmp (connection , "close" , sizeof ("close" )- 1 ) == 0 ) {
1101
1098
http_close = true;
@@ -1106,16 +1103,16 @@ bool make_http_soap_request(
1106
1103
} else {
1107
1104
http_close = true;
1108
1105
if (use_proxy && !use_ssl ) {
1109
- connection = get_http_header_value (http_headers , "Proxy-Connection:" );
1110
- if (connection ) {
1111
- if (strncasecmp (connection , "Keep-Alive" , sizeof ("Keep-Alive" )- 1 ) == 0 ) {
1106
+ char * proxy_connection = get_http_header_value (http_headers , "Proxy-Connection:" );
1107
+ if (proxy_connection ) {
1108
+ if (strncasecmp (proxy_connection , "Keep-Alive" , sizeof ("Keep-Alive" )- 1 ) == 0 ) {
1112
1109
http_close = false;
1113
1110
}
1114
- efree (connection );
1111
+ efree (proxy_connection );
1115
1112
}
1116
1113
}
1117
1114
if (http_close ) {
1118
- connection = get_http_header_value (http_headers , "Connection:" );
1115
+ char * connection = get_http_header_value (http_headers , "Connection:" );
1119
1116
if (connection ) {
1120
1117
if (strncasecmp (connection , "Keep-Alive" , sizeof ("Keep-Alive" )- 1 ) == 0 ) {
1121
1118
http_close = false;
@@ -1278,7 +1275,7 @@ bool make_http_soap_request(
1278
1275
smart_str_free (& soap_headers_z );
1279
1276
1280
1277
/* Check and see if the server even sent a xml document */
1281
- content_type = get_http_header_value (http_headers , "Content-Type:" );
1278
+ char * content_type = get_http_header_value (http_headers , "Content-Type:" );
1282
1279
if (content_type ) {
1283
1280
char * pos = NULL ;
1284
1281
int cmplen ;
@@ -1308,7 +1305,7 @@ bool make_http_soap_request(
1308
1305
}
1309
1306
1310
1307
/* Decompress response */
1311
- content_encoding = get_http_header_value (http_headers , "Content-Encoding:" );
1308
+ char * content_encoding = get_http_header_value (http_headers , "Content-Encoding:" );
1312
1309
if (content_encoding ) {
1313
1310
zval retval ;
1314
1311
zval params [1 ];
@@ -1455,32 +1452,31 @@ static char *get_http_header_value(zend_string *headers, char *type)
1455
1452
static zend_string * get_http_body (php_stream * stream , bool close , zend_string * headers )
1456
1453
{
1457
1454
zend_string * http_buf = NULL ;
1458
- char * header ;
1459
1455
bool header_close = close ;
1460
1456
bool header_chunked = false;
1461
1457
int header_length = 0 ;
1462
1458
size_t http_buf_size = 0 ;
1463
1459
1464
1460
if (!close ) {
1465
- header = get_http_header_value (headers , "Connection:" );
1466
- if (header ) {
1467
- if (!strncasecmp (header , "close" , sizeof ("close" )- 1 )) {
1461
+ char * connection = get_http_header_value (headers , "Connection:" );
1462
+ if (connection ) {
1463
+ if (!strncasecmp (connection , "close" , sizeof ("close" )- 1 )) {
1468
1464
header_close = true;
1469
1465
}
1470
- efree (header );
1466
+ efree (connection );
1471
1467
}
1472
1468
}
1473
- header = get_http_header_value (headers , "Transfer-Encoding:" );
1474
- if (header ) {
1475
- if (!strncasecmp (header , "chunked" , sizeof ("chunked" )- 1 )) {
1469
+ char * transfer_encoding = get_http_header_value (headers , "Transfer-Encoding:" );
1470
+ if (transfer_encoding ) {
1471
+ if (!strncasecmp (transfer_encoding , "chunked" , sizeof ("chunked" )- 1 )) {
1476
1472
header_chunked = true;
1477
1473
}
1478
- efree (header );
1474
+ efree (transfer_encoding );
1479
1475
}
1480
- header = get_http_header_value (headers , "Content-Length:" );
1481
- if (header ) {
1482
- header_length = atoi (header );
1483
- efree (header );
1476
+ char * content_length = get_http_header_value (headers , "Content-Length:" );
1477
+ if (content_length ) {
1478
+ header_length = atoi (content_length );
1479
+ efree (content_length );
1484
1480
if (!header_length && !header_chunked ) {
1485
1481
/* Empty response */
1486
1482
return ZSTR_EMPTY_ALLOC ();
0 commit comments