@@ -506,9 +506,9 @@ int make_http_soap_request(zval *this_ptr,
506
506
zend_string_equals (orig -> host , phpurl -> host ) &&
507
507
orig -> port == phpurl -> port ))) {
508
508
} else {
509
+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
509
510
php_stream_close (stream );
510
511
convert_to_null (Z_CLIENT_HTTPURL_P (this_ptr ));
511
- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
512
512
convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
513
513
stream = NULL ;
514
514
use_proxy = 0 ;
@@ -517,9 +517,9 @@ int make_http_soap_request(zval *this_ptr,
517
517
518
518
/* Check if keep-alive connection is still opened */
519
519
if (stream != NULL && php_stream_eof (stream )) {
520
+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
520
521
php_stream_close (stream );
521
522
convert_to_null (Z_CLIENT_HTTPURL_P (this_ptr ));
522
- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
523
523
convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
524
524
stream = NULL ;
525
525
use_proxy = 0 ;
@@ -528,9 +528,7 @@ int make_http_soap_request(zval *this_ptr,
528
528
if (!stream ) {
529
529
stream = http_connect (this_ptr , phpurl , use_ssl , context , & use_proxy );
530
530
if (stream ) {
531
- php_stream_auto_cleanup (stream );
532
- ZVAL_RES (Z_CLIENT_HTTPSOCKET_P (this_ptr ), stream -> res );
533
- GC_ADDREF (stream -> res );
531
+ php_stream_to_zval (stream , Z_CLIENT_HTTPSOCKET_P (this_ptr ));
534
532
ZVAL_LONG (Z_CLIENT_USE_PROXY_P (this_ptr ), use_proxy );
535
533
} else {
536
534
php_url_free (phpurl );
@@ -686,9 +684,9 @@ int make_http_soap_request(zval *this_ptr,
686
684
687
685
if (UNEXPECTED (php_random_bytes_throw (& nonce , sizeof (nonce )) != SUCCESS )) {
688
686
ZEND_ASSERT (EG (exception ));
687
+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
689
688
php_stream_close (stream );
690
689
convert_to_null (Z_CLIENT_HTTPURL_P (this_ptr ));
691
- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
692
690
convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
693
691
smart_str_free (& soap_headers_z );
694
692
smart_str_free (& soap_headers );
@@ -904,9 +902,9 @@ int make_http_soap_request(zval *this_ptr,
904
902
if (request != buf ) {
905
903
zend_string_release_ex (request , 0 );
906
904
}
905
+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
907
906
php_stream_close (stream );
908
907
convert_to_null (Z_CLIENT_HTTPURL_P (this_ptr ));
909
- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
910
908
convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
911
909
add_soap_fault (this_ptr , "HTTP" , "Failed Sending HTTP SOAP request" , NULL , NULL , SOAP_GLOBAL (lang_en ));
912
910
smart_str_free (& soap_headers_z );
@@ -929,8 +927,8 @@ int make_http_soap_request(zval *this_ptr,
929
927
if (request != buf ) {
930
928
zend_string_release_ex (request , 0 );
931
929
}
930
+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
932
931
php_stream_close (stream );
933
- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
934
932
convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
935
933
add_soap_fault (this_ptr , "HTTP" , "Error Fetching http headers" , NULL , NULL , SOAP_GLOBAL (lang_en ));
936
934
smart_str_free (& soap_headers_z );
@@ -982,11 +980,11 @@ int make_http_soap_request(zval *this_ptr,
982
980
if (request != buf ) {
983
981
zend_string_release_ex (request , 0 );
984
982
}
983
+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
985
984
php_stream_close (stream );
986
985
if (http_headers ) {
987
986
zend_string_release_ex (http_headers , 0 );
988
987
}
989
- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
990
988
convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
991
989
if (http_msg ) {
992
990
efree (http_msg );
@@ -1117,9 +1115,9 @@ int make_http_soap_request(zval *this_ptr,
1117
1115
if (request != buf ) {
1118
1116
zend_string_release_ex (request , 0 );
1119
1117
}
1118
+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
1120
1119
php_stream_close (stream );
1121
1120
zend_string_release_ex (http_headers , 0 );
1122
- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
1123
1121
convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
1124
1122
add_soap_fault (this_ptr , "HTTP" , "Error Fetching http body, No Content-Length, connection closed or chunked data" , NULL , NULL , SOAP_GLOBAL (lang_en ));
1125
1123
if (http_msg ) {
@@ -1134,8 +1132,8 @@ int make_http_soap_request(zval *this_ptr,
1134
1132
}
1135
1133
1136
1134
if (http_close ) {
1135
+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
1137
1136
php_stream_close (stream );
1138
- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
1139
1137
convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
1140
1138
stream = NULL ;
1141
1139
}
0 commit comments