@@ -237,7 +237,7 @@ PHP_MINFO_FUNCTION(curl)
237237
238238 d = curl_version_info (CURLVERSION_NOW );
239239 php_info_print_table_start ();
240- php_info_print_table_row (2 , "cURL support" , "enabled" );
240+ php_info_print_table_row (2 , "cURL support" , "enabled" );
241241 php_info_print_table_row (2 , "cURL Information" , d -> version );
242242 snprintf (str , sizeof (str ), "%d" , d -> age );
243243 php_info_print_table_row (2 , "Age" , str );
@@ -483,6 +483,7 @@ static HashTable *curl_get_gc(zend_object *object, zval **table, int *n)
483483 zend_get_gc_buffer_add_fcc (gc_buffer , & curl -> handlers .prereq );
484484 }
485485#endif
486+
486487#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
487488 if (ZEND_FCC_INITIALIZED (curl -> handlers .sshhostkey )) {
488489 zend_get_gc_buffer_add_fcc (gc_buffer , & curl -> handlers .sshhostkey );
@@ -685,8 +686,8 @@ static int curl_prereqfunction(void *clientp, char *conn_primary_ip, char *conn_
685686 // gets called. Return CURL_PREREQFUNC_OK immediately in this case to avoid
686687 // zend_call_known_fcc() with an uninitialized FCC.
687688 if (!ZEND_FCC_INITIALIZED (ch -> handlers .prereq )) {
688- return rval ;
689- }
689+ return rval ;
690+ }
690691
691692#if PHP_CURL_DEBUG
692693 fprintf (stderr , "curl_prereqfunction() called\n" );
@@ -881,42 +882,42 @@ static int curl_debug(CURL *handle, curl_infotype type, char *data, size_t size,
881882{
882883 php_curl * ch = (php_curl * )clientp ;
883884
884- #if PHP_CURL_DEBUG
885- fprintf (stderr , "curl_debug() called\n" );
886- fprintf (stderr , "type = %d, data = %s\n" , type , data );
887- #endif
885+ #if PHP_CURL_DEBUG
886+ fprintf (stderr , "curl_debug() called\n" );
887+ fprintf (stderr , "type = %d, data = %s\n" , type , data );
888+ #endif
888889
889890 // Implicitly store the headers for compatibility with CURLINFO_HEADER_OUT
890891 // used as a Curl option. Previously, setting CURLINFO_HEADER_OUT set curl_debug
891892 // as the CURLOPT_DEBUGFUNCTION and stored the debug data when type is set to
892893 // CURLINFO_HEADER_OUT. For backward compatibility, we now store the headers
893894 // but also call the user-callback function if available.
894- if (type == CURLINFO_HEADER_OUT ) {
895- if (ch -> header .str ) {
896- zend_string_release_ex (ch -> header .str , 0 );
897- }
898- ch -> header .str = zend_string_init (data , size , 0 );
899- }
895+ if (type == CURLINFO_HEADER_OUT ) {
896+ if (ch -> header .str ) {
897+ zend_string_release_ex (ch -> header .str , 0 );
898+ }
899+ ch -> header .str = zend_string_init (data , size , 0 );
900+ }
900901
901- if (!ZEND_FCC_INITIALIZED (ch -> handlers .debug )) {
902- return 0 ;
903- }
902+ if (!ZEND_FCC_INITIALIZED (ch -> handlers .debug )) {
903+ return 0 ;
904+ }
904905
905- zval args [3 ];
906+ zval args [3 ];
906907
907- GC_ADDREF (& ch -> std );
908- ZVAL_OBJ (& args [0 ], & ch -> std );
909- ZVAL_LONG (& args [1 ], type );
910- ZVAL_STRINGL (& args [2 ], data , size );
908+ GC_ADDREF (& ch -> std );
909+ ZVAL_OBJ (& args [0 ], & ch -> std );
910+ ZVAL_LONG (& args [1 ], type );
911+ ZVAL_STRINGL (& args [2 ], data , size );
911912
912- ch -> in_callback = true;
913- zend_call_known_fcc (& ch -> handlers .debug , NULL , /* param_count */ 3 , args , /* named_params */ NULL );
914- ch -> in_callback = false;
913+ ch -> in_callback = true;
914+ zend_call_known_fcc (& ch -> handlers .debug , NULL , /* param_count */ 3 , args , /* named_params */ NULL );
915+ ch -> in_callback = false;
915916
916- zval_ptr_dtor (& args [0 ]);
917- zval_ptr_dtor (& args [2 ]);
917+ zval_ptr_dtor (& args [0 ]);
918+ zval_ptr_dtor (& args [2 ]);
918919
919- return 0 ;
920+ return 0 ;
920921}
921922/* }}} */
922923
@@ -1753,7 +1754,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
17531754 case CURLOPT_DNS_SHUFFLE_ADDRESSES :
17541755 case CURLOPT_HAPROXYPROTOCOL :
17551756 case CURLOPT_DISALLOW_USERNAME_IN_URL :
1756- #if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
1757+ #if LIBCURL_VERSION_NUM >= 0x073e00 /* Available since 7.62.0 */
17571758 case CURLOPT_UPKEEP_INTERVAL_MS :
17581759 case CURLOPT_UPLOAD_BUFFERSIZE :
17591760#endif
@@ -1917,7 +1918,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
19171918 case CURLOPT_DNS_LOCAL_IP6 :
19181919 case CURLOPT_XOAUTH2_BEARER :
19191920 case CURLOPT_UNIX_SOCKET_PATH :
1920- #if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
1921+ #if LIBCURL_VERSION_NUM >= 0x073e00 /* Available since 7.62.0 */
19211922 case CURLOPT_DOH_URL :
19221923#endif
19231924#if LIBCURL_VERSION_NUM >= 0x074a00 /* Available since 7.74.0 */
@@ -2222,9 +2223,9 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
22222223
22232224 case CURLINFO_HEADER_OUT :
22242225 if (ZEND_FCC_INITIALIZED (ch -> handlers .debug )) {
2225- zend_value_error ("CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set" );
2226- return FAILURE ;
2227- }
2226+ zend_value_error ("CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set" );
2227+ return FAILURE ;
2228+ }
22282229
22292230 if (zend_is_true (zvalue )) {
22302231 curl_easy_setopt (ch -> cp , CURLOPT_DEBUGFUNCTION , curl_debug );
@@ -2931,11 +2932,13 @@ static void _php_curl_reset_handlers(php_curl *ch)
29312932 if (ZEND_FCC_INITIALIZED (ch -> handlers .debug )) {
29322933 zend_fcc_dtor (& ch -> handlers .debug );
29332934 }
2935+
29342936#if LIBCURL_VERSION_NUM >= 0x075000 /* Available since 7.80.0 */
29352937 if (ZEND_FCC_INITIALIZED (ch -> handlers .prereq )) {
29362938 zend_fcc_dtor (& ch -> handlers .prereq );
29372939 }
29382940#endif
2941+
29392942#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
29402943 if (ZEND_FCC_INITIALIZED (ch -> handlers .sshhostkey )) {
29412944 zend_fcc_dtor (& ch -> handlers .sshhostkey );
@@ -3042,7 +3045,7 @@ PHP_FUNCTION(curl_pause)
30423045}
30433046/* }}} */
30443047
3045- #if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
3048+ #if LIBCURL_VERSION_NUM >= 0x073e00 /* Available since 7.62.0 */
30463049/* {{{ perform connection upkeep checks */
30473050PHP_FUNCTION (curl_upkeep )
30483051{
@@ -3061,5 +3064,5 @@ PHP_FUNCTION(curl_upkeep)
30613064
30623065 RETURN_BOOL (error == CURLE_OK );
30633066}
3064- /*}}} */
3067+ /* }}} */
30653068#endif
0 commit comments