@@ -506,9 +506,9 @@ int make_http_soap_request(zval *this_ptr,
506506 zend_string_equals (orig -> host , phpurl -> host ) &&
507507 orig -> port == phpurl -> port ))) {
508508 } else {
509+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
509510 php_stream_close (stream );
510511 convert_to_null (Z_CLIENT_HTTPURL_P (this_ptr ));
511- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
512512 convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
513513 stream = NULL ;
514514 use_proxy = 0 ;
@@ -517,9 +517,9 @@ int make_http_soap_request(zval *this_ptr,
517517
518518 /* Check if keep-alive connection is still opened */
519519 if (stream != NULL && php_stream_eof (stream )) {
520+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
520521 php_stream_close (stream );
521522 convert_to_null (Z_CLIENT_HTTPURL_P (this_ptr ));
522- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
523523 convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
524524 stream = NULL ;
525525 use_proxy = 0 ;
@@ -528,9 +528,7 @@ int make_http_soap_request(zval *this_ptr,
528528 if (!stream ) {
529529 stream = http_connect (this_ptr , phpurl , use_ssl , context , & use_proxy );
530530 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 ));
534532 ZVAL_LONG (Z_CLIENT_USE_PROXY_P (this_ptr ), use_proxy );
535533 } else {
536534 php_url_free (phpurl );
@@ -686,9 +684,9 @@ int make_http_soap_request(zval *this_ptr,
686684
687685 if (UNEXPECTED (php_random_bytes_throw (& nonce , sizeof (nonce )) != SUCCESS )) {
688686 ZEND_ASSERT (EG (exception ));
687+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
689688 php_stream_close (stream );
690689 convert_to_null (Z_CLIENT_HTTPURL_P (this_ptr ));
691- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
692690 convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
693691 smart_str_free (& soap_headers_z );
694692 smart_str_free (& soap_headers );
@@ -904,9 +902,9 @@ int make_http_soap_request(zval *this_ptr,
904902 if (request != buf ) {
905903 zend_string_release_ex (request , 0 );
906904 }
905+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
907906 php_stream_close (stream );
908907 convert_to_null (Z_CLIENT_HTTPURL_P (this_ptr ));
909- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
910908 convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
911909 add_soap_fault (this_ptr , "HTTP" , "Failed Sending HTTP SOAP request" , NULL , NULL , SOAP_GLOBAL (lang_en ));
912910 smart_str_free (& soap_headers_z );
@@ -929,8 +927,8 @@ int make_http_soap_request(zval *this_ptr,
929927 if (request != buf ) {
930928 zend_string_release_ex (request , 0 );
931929 }
930+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
932931 php_stream_close (stream );
933- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
934932 convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
935933 add_soap_fault (this_ptr , "HTTP" , "Error Fetching http headers" , NULL , NULL , SOAP_GLOBAL (lang_en ));
936934 smart_str_free (& soap_headers_z );
@@ -982,11 +980,11 @@ int make_http_soap_request(zval *this_ptr,
982980 if (request != buf ) {
983981 zend_string_release_ex (request , 0 );
984982 }
983+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
985984 php_stream_close (stream );
986985 if (http_headers ) {
987986 zend_string_release_ex (http_headers , 0 );
988987 }
989- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
990988 convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
991989 if (http_msg ) {
992990 efree (http_msg );
@@ -1117,9 +1115,9 @@ int make_http_soap_request(zval *this_ptr,
11171115 if (request != buf ) {
11181116 zend_string_release_ex (request , 0 );
11191117 }
1118+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
11201119 php_stream_close (stream );
11211120 zend_string_release_ex (http_headers , 0 );
1122- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
11231121 convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
11241122 add_soap_fault (this_ptr , "HTTP" , "Error Fetching http body, No Content-Length, connection closed or chunked data" , NULL , NULL , SOAP_GLOBAL (lang_en ));
11251123 if (http_msg ) {
@@ -1134,8 +1132,8 @@ int make_http_soap_request(zval *this_ptr,
11341132 }
11351133
11361134 if (http_close ) {
1135+ ZVAL_NULL (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
11371136 php_stream_close (stream );
1138- convert_to_null (Z_CLIENT_HTTPSOCKET_P (this_ptr ));
11391137 convert_to_null (Z_CLIENT_USE_PROXY_P (this_ptr ));
11401138 stream = NULL ;
11411139 }
0 commit comments