@@ -592,7 +592,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
592
592
ch -> in_callback = false;
593
593
if (!Z_ISUNDEF (retval )) {
594
594
_php_curl_verify_handlers (ch , /* reporterror */ true);
595
- /* TODO Check callback returns an int or something castable to int */
595
+ /* TODO Check callback returns an int or something castable to int */
596
596
length = zval_get_long (& retval );
597
597
}
598
598
@@ -625,7 +625,7 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
625
625
626
626
if (!Z_ISUNDEF (retval )) {
627
627
_php_curl_verify_handlers (ch , /* reporterror */ true);
628
- /* TODO Check callback returns an int or something castable to int */
628
+ /* TODO Check callback returns an int or something castable to int */
629
629
rval = zval_get_long (& retval );
630
630
}
631
631
zval_ptr_dtor (& argv [0 ]);
@@ -661,12 +661,12 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
661
661
ch -> in_callback = false;
662
662
663
663
if (!Z_ISUNDEF (retval )) {
664
- _php_curl_verify_handlers (ch , /* reporterror */ true);
665
- /* TODO Check callback returns an int or something castable to int */
666
- if (0 != zval_get_long (& retval )) {
667
- rval = 1 ;
668
- }
669
- }
664
+ _php_curl_verify_handlers (ch , /* reporterror */ true);
665
+ /* TODO Check callback returns an int or something castable to int */
666
+ if (0 != zval_get_long (& retval )) {
667
+ rval = 1 ;
668
+ }
669
+ }
670
670
671
671
zval_ptr_dtor (& args [0 ]);
672
672
return rval ;
@@ -699,12 +699,12 @@ static size_t curl_xferinfo(void *clientp, curl_off_t dltotal, curl_off_t dlnow,
699
699
ch -> in_callback = false;
700
700
701
701
if (!Z_ISUNDEF (retval )) {
702
- _php_curl_verify_handlers (ch , /* reporterror */ true);
703
- /* TODO Check callback returns an int or something castable to int */
704
- if (0 != zval_get_long (& retval )) {
705
- rval = 1 ;
706
- }
707
- }
702
+ _php_curl_verify_handlers (ch , /* reporterror */ true);
703
+ /* TODO Check callback returns an int or something castable to int */
704
+ if (0 != zval_get_long (& retval )) {
705
+ rval = 1 ;
706
+ }
707
+ }
708
708
709
709
zval_ptr_dtor (& argv [0 ]);
710
710
return rval ;
@@ -923,8 +923,8 @@ PHP_FUNCTION(curl_version)
923
923
/* Add an array of features */
924
924
{
925
925
struct feat {
926
- const char * name ;
927
- int bitmask ;
926
+ const char * name ;
927
+ int bitmask ;
928
928
};
929
929
930
930
unsigned int i ;
@@ -974,7 +974,7 @@ PHP_FUNCTION(curl_version)
974
974
#endif
975
975
};
976
976
977
- for (i = 0 ; i < sizeof (feats ) / sizeof (feats [0 ]); i ++ ) {
977
+ for (i = 0 ; i < sizeof (feats ) / sizeof (feats [0 ]); i ++ ) {
978
978
if (feats [i ].name ) {
979
979
add_assoc_bool (& feature_list , feats [i ].name , d -> features & feats [i ].bitmask ? true : false);
980
980
}
@@ -1202,8 +1202,6 @@ void _php_setup_easy_copy_handlers(php_curl *ch, php_curl *source)
1202
1202
if (ZEND_FCC_INITIALIZED (source -> handlers .write_header -> fcc )) {
1203
1203
zend_fcc_dup (& source -> handlers .write_header -> fcc , & source -> handlers .write_header -> fcc );
1204
1204
}
1205
- php_curl_copy_fcc_with_option (ch , CURLOPT_XFERINFODATA , & ch -> handlers .xferinfo , & source -> handlers .xferinfo );
1206
- php_curl_copy_fcc_with_option (ch , CURLOPT_XFERINFODATA , & ch -> handlers .xferinfo , & source -> handlers .xferinfo );
1207
1205
1208
1206
curl_easy_setopt (ch -> cp , CURLOPT_ERRORBUFFER , ch -> err .str );
1209
1207
curl_easy_setopt (ch -> cp , CURLOPT_FILE , (void * ) ch );
@@ -2140,7 +2138,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
2140
2138
case CURLOPT_ISSUERCERT :
2141
2139
case CURLOPT_SSH_KNOWNHOSTS :
2142
2140
{
2143
- zend_string * tmp_str ;
2141
+ zend_string * tmp_str ;
2144
2142
zend_string * str = zval_get_tmp_string (zvalue , & tmp_str );
2145
2143
zend_result ret ;
2146
2144
@@ -2701,12 +2699,15 @@ static void curl_free_obj(zend_object *object)
2701
2699
smart_str_free (& ch -> handlers .write -> buf );
2702
2700
if (ZEND_FCC_INITIALIZED (ch -> handlers .write -> fcc )) {
2703
2701
zend_fcc_dtor (& ch -> handlers .write -> fcc );
2702
+ ch -> handlers .write -> fcc = empty_fcall_info_cache ;
2704
2703
}
2705
2704
if (ZEND_FCC_INITIALIZED (ch -> handlers .write_header -> fcc )) {
2706
2705
zend_fcc_dtor (& ch -> handlers .write_header -> fcc );
2706
+ ch -> handlers .write_header -> fcc = empty_fcall_info_cache ;
2707
2707
}
2708
2708
if (ZEND_FCC_INITIALIZED (ch -> handlers .read -> fcc )) {
2709
2709
zend_fcc_dtor (& ch -> handlers .read -> fcc );
2710
+ ch -> handlers .read -> fcc = empty_fcall_info_cache ;
2710
2711
}
2711
2712
zval_ptr_dtor (& ch -> handlers .std_err );
2712
2713
if (ch -> header .str ) {
@@ -2723,16 +2724,20 @@ static void curl_free_obj(zend_object *object)
2723
2724
2724
2725
if (ZEND_FCC_INITIALIZED (ch -> handlers .progress )) {
2725
2726
zend_fcc_dtor (& ch -> handlers .progress );
2727
+ ch -> handlers .progress = empty_fcall_info_cache ;
2726
2728
}
2727
2729
if (ZEND_FCC_INITIALIZED (ch -> handlers .xferinfo )) {
2728
2730
zend_fcc_dtor (& ch -> handlers .xferinfo );
2731
+ ch -> handlers .xferinfo = empty_fcall_info_cache ;
2729
2732
}
2730
2733
if (ZEND_FCC_INITIALIZED (ch -> handlers .fnmatch )) {
2731
2734
zend_fcc_dtor (& ch -> handlers .fnmatch );
2735
+ ch -> handlers .fnmatch = empty_fcall_info_cache ;
2732
2736
}
2733
2737
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
2734
2738
if (ZEND_FCC_INITIALIZED (ch -> handlers .sshhostkey )) {
2735
2739
zend_fcc_dtor (& ch -> handlers .sshhostkey );
2740
+ ch -> handlers .sshhostkey = empty_fcall_info_cache ;
2736
2741
}
2737
2742
#endif
2738
2743
@@ -2799,20 +2804,23 @@ static void _php_curl_reset_handlers(php_curl *ch)
2799
2804
2800
2805
if (ZEND_FCC_INITIALIZED (ch -> handlers .progress )) {
2801
2806
zend_fcc_dtor (& ch -> handlers .progress );
2807
+ ch -> handlers .progress = empty_fcall_info_cache ;
2802
2808
}
2803
2809
2804
2810
if (ZEND_FCC_INITIALIZED (ch -> handlers .xferinfo )) {
2805
2811
zend_fcc_dtor (& ch -> handlers .xferinfo );
2806
- ch -> handlers .xferinfo . function_handler = NULL ;
2812
+ ch -> handlers .xferinfo = empty_fcall_info_cache ;
2807
2813
}
2808
2814
2809
2815
if (ZEND_FCC_INITIALIZED (ch -> handlers .fnmatch )) {
2810
2816
zend_fcc_dtor (& ch -> handlers .fnmatch );
2817
+ ch -> handlers .fnmatch = empty_fcall_info_cache ;
2811
2818
}
2812
2819
2813
2820
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
2814
2821
if (ZEND_FCC_INITIALIZED (ch -> handlers .sshhostkey )) {
2815
2822
zend_fcc_dtor (& ch -> handlers .sshhostkey );
2823
+ ch -> handlers .sshhostkey = empty_fcall_info_cache ;
2816
2824
}
2817
2825
#endif
2818
2826
}
0 commit comments