Skip to content

Commit f4dbe23

Browse files
authored
ext/curl: Refactor cURL to only use FCC (#13291)
* ext/curl: Convert handlers.progress to just be a FCC * ext/curl: Convert handlers.sshhostkey to just be a FCC * ext/curl: Convert handlers.xferinfo to just be a FCC * ext/curl: Convert handlers.fnmatch to just be a FCC * ext/curl: Convert handlers.server_push to just be a FCC * ext/curl: Convert php_curl_write to just use FCC without a function name zval * ext/curl: Convert php_curl_read to just use FCC without a function name zval * ext/curl: Remove workaround for old libcurl * ext/curl: Create macros to codegen the handling of callable options
1 parent 0540a42 commit f4dbe23

18 files changed

+638
-410
lines changed

ext/curl/curl_private.h

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,38 +45,31 @@ PHP_MSHUTDOWN_FUNCTION(curl);
4545
PHP_MINFO_FUNCTION(curl);
4646

4747
typedef struct {
48-
zval func_name;
49-
zend_fcall_info_cache fci_cache;
48+
zend_fcall_info_cache fcc;
5049
FILE *fp;
5150
smart_str buf;
5251
int method;
5352
zval stream;
5453
} php_curl_write;
5554

5655
typedef struct {
57-
zval func_name;
58-
zend_fcall_info_cache fci_cache;
56+
zend_fcall_info_cache fcc;
5957
FILE *fp;
6058
zend_resource *res;
6159
int method;
6260
zval stream;
6361
} php_curl_read;
6462

65-
typedef struct {
66-
zval func_name;
67-
zend_fcall_info_cache fci_cache;
68-
} php_curl_callback;
69-
7063
typedef struct {
7164
php_curl_write *write;
7265
php_curl_write *write_header;
7366
php_curl_read *read;
7467
zval std_err;
75-
php_curl_callback *progress;
76-
php_curl_callback *xferinfo;
77-
php_curl_callback *fnmatch;
68+
zend_fcall_info_cache progress;
69+
zend_fcall_info_cache xferinfo;
70+
zend_fcall_info_cache fnmatch;
7871
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
79-
php_curl_callback *sshhostkey;
72+
zend_fcall_info_cache sshhostkey;
8073
#endif
8174
} php_curl_handlers;
8275

@@ -114,7 +107,7 @@ typedef struct {
114107
#define CURLOPT_SAFE_UPLOAD -1
115108

116109
typedef struct {
117-
php_curl_callback *server_push;
110+
zend_fcall_info_cache server_push;
118111
} php_curlm_handlers;
119112

120113
typedef struct {

0 commit comments

Comments
 (0)