@@ -86,11 +86,11 @@ static zend_object_handlers swoole_native_curl_exception_handlers;
86
86
static int le_curl;
87
87
static int le_curl_multi_handle;
88
88
89
- int _php_curl_get_le_curl () {
89
+ int swoole_curl_get_le_curl () {
90
90
return le_curl;
91
91
}
92
92
93
- int _php_curl_get_le_curl_multi () {
93
+ int swoole_curl_get_le_curl_multi () {
94
94
return le_curl_multi_handle;
95
95
}
96
96
@@ -112,7 +112,7 @@ int _php_curl_get_le_curl_multi() {
112
112
return ;
113
113
#endif
114
114
115
- php_curl *_php_curl_get_handle (zval *zid, bool exclusive, bool required) {
115
+ php_curl *swoole_curl_get_handle (zval *zid, bool exclusive, bool required) {
116
116
php_curl *ch;
117
117
#if PHP_VERSION_ID >= 80000
118
118
ch = Z_CURL_P (zid);
@@ -223,7 +223,7 @@ static int php_curl_option_url(http://github.com/php_curl%20*ch,%20const%20char%20*url,%20const%20size_t%20len)
223
223
}
224
224
/* }}} */
225
225
226
- void _php_curl_verify_handlers (php_curl *ch, int reporterror) /* {{{ */
226
+ void swoole_curl_verify_handlers (php_curl *ch, int reporterror) /* {{{ */
227
227
{
228
228
php_stream *stream;
229
229
@@ -329,9 +329,9 @@ void swoole_native_curl_minit(int module_number) {
329
329
zend_register_functions (NULL , swoole_native_curl_functions, NULL , MODULE_PERSISTENT);
330
330
331
331
#else
332
- le_curl = zend_register_list_destructors_ex (_php_curl_close , NULL , le_curl_name, module_number);
332
+ le_curl = zend_register_list_destructors_ex (swoole_curl_close , NULL , le_curl_name, module_number);
333
333
le_curl_multi_handle =
334
- zend_register_list_destructors_ex (_php_curl_multi_close , NULL , le_curl_multi_handle_name, module_number);
334
+ zend_register_list_destructors_ex (swoole_curl_multi_close , NULL , le_curl_multi_handle_name, module_number);
335
335
#endif
336
336
337
337
SW_INIT_CLASS_ENTRY_EX (swoole_native_curl_exception,
@@ -379,7 +379,7 @@ static zend_object *curl_clone_obj(zend_object *object) {
379
379
}
380
380
381
381
clone_ch->cp = cp;
382
- _php_setup_easy_copy_handlers (clone_ch, ch);
382
+ swoole_setup_easy_copy_handlers (clone_ch, ch);
383
383
384
384
postfields = &clone_ch->postfields ;
385
385
if (Z_TYPE_P (postfields) != IS_UNDEF) {
@@ -518,7 +518,7 @@ static size_t fn_write(char *data, size_t size, size_t nmemb, void *ctx) {
518
518
php_error_docref (NULL , E_WARNING, " Could not call the CURLOPT_WRITEFUNCTION" );
519
519
length = -1 ;
520
520
} else if (!Z_ISUNDEF (retval)) {
521
- _php_curl_verify_handlers (ch, 1 );
521
+ swoole_curl_verify_handlers (ch, 1 );
522
522
length = zval_get_long (&retval);
523
523
}
524
524
@@ -574,7 +574,7 @@ static int fn_fnmatch(void *ctx, const char *pattern, const char *string) {
574
574
if (error == FAILURE) {
575
575
php_error_docref (NULL , E_WARNING, " Cannot call the CURLOPT_FNMATCH_FUNCTION" );
576
576
} else if (!Z_ISUNDEF (retval)) {
577
- _php_curl_verify_handlers (ch, 1 );
577
+ swoole_curl_verify_handlers (ch, 1 );
578
578
rval = zval_get_long (&retval);
579
579
}
580
580
zval_ptr_dtor (&argv[0 ]);
@@ -643,7 +643,7 @@ static size_t fn_progress(void *clientp, double dltotal, double dlnow, double ul
643
643
if (error == FAILURE) {
644
644
php_error_docref (NULL , E_WARNING, " Cannot call the CURLOPT_PROGRESSFUNCTION" );
645
645
} else if (!Z_ISUNDEF (retval)) {
646
- _php_curl_verify_handlers (ch, 1 );
646
+ swoole_curl_verify_handlers (ch, 1 );
647
647
if (0 != zval_get_long (&retval)) {
648
648
rval = 1 ;
649
649
}
@@ -707,7 +707,7 @@ static size_t fn_read(char *data, size_t size, size_t nmemb, void *ctx) {
707
707
php_error_docref (NULL , E_WARNING, " Cannot call the CURLOPT_READFUNCTION" );
708
708
length = CURL_READFUNC_ABORT;
709
709
} else if (!Z_ISUNDEF (retval)) {
710
- _php_curl_verify_handlers (ch, 1 );
710
+ swoole_curl_verify_handlers (ch, 1 );
711
711
if (Z_TYPE (retval) == IS_STRING) {
712
712
length = MIN ((int ) (size * nmemb), Z_STRLEN (retval));
713
713
memcpy (data, Z_STRVAL (retval), length);
@@ -779,7 +779,7 @@ static size_t fn_write_header(char *data, size_t size, size_t nmemb, void *ctx)
779
779
php_error_docref (NULL , E_WARNING, " Could not call the CURLOPT_HEADERFUNCTION" );
780
780
length = -1 ;
781
781
} else if (!Z_ISUNDEF (retval)) {
782
- _php_curl_verify_handlers (ch, 1 );
782
+ swoole_curl_verify_handlers (ch, 1 );
783
783
length = zval_get_long (&retval);
784
784
}
785
785
zval_ptr_dtor (&argv[0 ]);
@@ -874,7 +874,7 @@ php_curl *init_curl_handle_into_zval(zval *curl) {
874
874
#if PHP_VERSION_ID >= 80000
875
875
void init_curl_handle (php_curl *ch)
876
876
#else
877
- php_curl *alloc_curl_handle ()
877
+ php_curl *swoole_curl_alloc_handle ()
878
878
#endif
879
879
{
880
880
#if PHP_VERSION_ID < 80000
@@ -1002,7 +1002,7 @@ PHP_FUNCTION(swoole_native_curl_init) {
1002
1002
#if PHP_VERSION_ID >= 80000
1003
1003
ch = init_curl_handle_into_zval (return_value);
1004
1004
#else
1005
- ch = alloc_curl_handle ();
1005
+ ch = swoole_curl_alloc_handle ();
1006
1006
#endif
1007
1007
1008
1008
ch->cp = cp;
@@ -1018,7 +1018,7 @@ PHP_FUNCTION(swoole_native_curl_init) {
1018
1018
#if PHP_VERSION_ID >= 80000
1019
1019
zval_ptr_dtor (return_value);
1020
1020
#else
1021
- _php_curl_close_ex (ch);
1021
+ swoole_curl_close_ex (ch);
1022
1022
#endif
1023
1023
RETURN_FALSE;
1024
1024
}
@@ -1031,7 +1031,7 @@ PHP_FUNCTION(swoole_native_curl_init) {
1031
1031
}
1032
1032
/* }}} */
1033
1033
1034
- void _php_setup_easy_copy_handlers (php_curl *ch, php_curl *source) {
1034
+ void swoole_setup_easy_copy_handlers (php_curl *ch, php_curl *source) {
1035
1035
if (!Z_ISUNDEF (source->handlers ->write ->stream )) {
1036
1036
Z_ADDREF (source->handlers ->write ->stream );
1037
1037
}
@@ -1360,7 +1360,7 @@ PHP_FUNCTION(swoole_native_curl_copy_handle) {
1360
1360
#endif
1361
1361
ZEND_PARSE_PARAMETERS_END ();
1362
1362
1363
- if ((ch = _php_curl_get_handle (zid)) == NULL ) {
1363
+ if ((ch = swoole_curl_get_handle (zid)) == NULL ) {
1364
1364
RETURN_FALSE;
1365
1365
}
1366
1366
@@ -1373,11 +1373,11 @@ PHP_FUNCTION(swoole_native_curl_copy_handle) {
1373
1373
#if PHP_VERSION_ID >= 80000
1374
1374
dupch = init_curl_handle_into_zval (return_value);
1375
1375
#else
1376
- dupch = alloc_curl_handle ();
1376
+ dupch = swoole_curl_alloc_handle ();
1377
1377
#endif
1378
1378
dupch->cp = cp;
1379
1379
1380
- _php_setup_easy_copy_handlers (dupch, ch);
1380
+ swoole_setup_easy_copy_handlers (dupch, ch);
1381
1381
1382
1382
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
1383
1383
postfields = &ch->postfields ;
@@ -1386,7 +1386,7 @@ PHP_FUNCTION(swoole_native_curl_copy_handle) {
1386
1386
#if PHP_VERSION_ID >= 80000
1387
1387
zval_ptr_dtor (return_value);
1388
1388
#else
1389
- _php_curl_close_ex (dupch);
1389
+ swoole_curl_close_ex (dupch);
1390
1390
#endif
1391
1391
php_error_docref (NULL , E_WARNING, " Cannot rebuild mime structure" );
1392
1392
RETURN_FALSE;
@@ -2203,7 +2203,7 @@ PHP_FUNCTION(swoole_native_curl_setopt) {
2203
2203
Z_PARAM_ZVAL (zvalue)
2204
2204
ZEND_PARSE_PARAMETERS_END ();
2205
2205
2206
- if ((ch = _php_curl_get_handle (zid, false )) == NULL ) {
2206
+ if ((ch = swoole_curl_get_handle (zid, false )) == NULL ) {
2207
2207
RETURN_FALSE;
2208
2208
}
2209
2209
@@ -2236,7 +2236,7 @@ PHP_FUNCTION(swoole_native_curl_setopt_array) {
2236
2236
Z_PARAM_ARRAY (arr)
2237
2237
ZEND_PARSE_PARAMETERS_END ();
2238
2238
2239
- if ((ch = _php_curl_get_handle (zid, false )) == NULL ) {
2239
+ if ((ch = swoole_curl_get_handle (zid, false )) == NULL ) {
2240
2240
RETURN_FALSE;
2241
2241
}
2242
2242
@@ -2262,7 +2262,7 @@ PHP_FUNCTION(swoole_native_curl_setopt_array) {
2262
2262
2263
2263
/* {{{ _php_curl_cleanup_handle(ch)
2264
2264
Cleanup an execution phase */
2265
- void _php_curl_cleanup_handle (php_curl *ch) {
2265
+ void swoole_curl_cleanup_handle (php_curl *ch) {
2266
2266
smart_str_free (&ch->handlers ->write ->buf );
2267
2267
if (ch->header .str ) {
2268
2268
zend_string_release (ch->header .str );
@@ -2289,13 +2289,13 @@ PHP_FUNCTION(swoole_native_curl_exec) {
2289
2289
#endif
2290
2290
ZEND_PARSE_PARAMETERS_END ();
2291
2291
2292
- if ((ch = _php_curl_get_handle (zid)) == NULL ) {
2292
+ if ((ch = swoole_curl_get_handle (zid)) == NULL ) {
2293
2293
RETURN_FALSE;
2294
2294
}
2295
2295
2296
- _php_curl_verify_handlers (ch, 1 );
2296
+ swoole_curl_verify_handlers (ch, 1 );
2297
2297
2298
- _php_curl_cleanup_handle (ch);
2298
+ swoole_curl_cleanup_handle (ch);
2299
2299
2300
2300
Multi multi{};
2301
2301
error = multi.exec (ch);
@@ -2362,7 +2362,7 @@ PHP_FUNCTION(swoole_native_curl_getinfo) {
2362
2362
#endif
2363
2363
ZEND_PARSE_PARAMETERS_END ();
2364
2364
2365
- if ((ch = _php_curl_get_handle (zid, false )) == NULL ) {
2365
+ if ((ch = swoole_curl_get_handle (zid, false )) == NULL ) {
2366
2366
RETURN_FALSE;
2367
2367
}
2368
2368
@@ -2629,7 +2629,7 @@ PHP_FUNCTION(swoole_native_curl_error) {
2629
2629
#endif
2630
2630
ZEND_PARSE_PARAMETERS_END ();
2631
2631
2632
- if ((ch = _php_curl_get_handle (zid, false )) == NULL ) {
2632
+ if ((ch = swoole_curl_get_handle (zid, false )) == NULL ) {
2633
2633
RETURN_FALSE;
2634
2634
}
2635
2635
@@ -2659,7 +2659,7 @@ PHP_FUNCTION(swoole_native_curl_errno) {
2659
2659
#endif
2660
2660
ZEND_PARSE_PARAMETERS_END ();
2661
2661
2662
- if ((ch = _php_curl_get_handle (zid, false )) == NULL ) {
2662
+ if ((ch = swoole_curl_get_handle (zid, false )) == NULL ) {
2663
2663
RETURN_FALSE;
2664
2664
}
2665
2665
@@ -2681,7 +2681,7 @@ PHP_FUNCTION(swoole_native_curl_close) {
2681
2681
#endif
2682
2682
ZEND_PARSE_PARAMETERS_END ();
2683
2683
2684
- if ((ch = _php_curl_get_handle (zid)) == NULL ) {
2684
+ if ((ch = swoole_curl_get_handle (zid)) == NULL ) {
2685
2685
RETURN_FALSE;
2686
2686
}
2687
2687
@@ -2787,7 +2787,7 @@ static void curl_free_obj(zend_object *object) {
2787
2787
return ;
2788
2788
}
2789
2789
2790
- _php_curl_verify_handlers (ch, 0 );
2790
+ swoole_curl_verify_handlers (ch, 0 );
2791
2791
_php_curl_free (ch);
2792
2792
2793
2793
zend_object_std_dtor (&ch->std );
@@ -2797,22 +2797,22 @@ static void curl_free_obj(zend_object *object) {
2797
2797
#if PHP_VERSION_ID < 80000
2798
2798
/* {{{ _php_curl_close_ex()
2799
2799
List destructor for curl handles */
2800
- void _php_curl_close_ex (php_curl *ch) {
2800
+ void swoole_curl_close_ex (php_curl *ch) {
2801
2801
#if PHP_CURL_DEBUG
2802
2802
fprintf (stderr, " DTOR CALLED, ch = %x\n " , ch);
2803
2803
#endif
2804
2804
2805
- _php_curl_verify_handlers (ch, 0 );
2805
+ swoole_curl_verify_handlers (ch, 0 );
2806
2806
_php_curl_free (ch);
2807
2807
efree (ch);
2808
2808
}
2809
2809
/* }}} */
2810
2810
2811
2811
/* {{{ _php_curl_close()
2812
2812
List destructor for curl handles */
2813
- void _php_curl_close (zend_resource *rsrc) {
2813
+ void swoole_curl_close (zend_resource *rsrc) {
2814
2814
php_curl *ch = (php_curl *) rsrc->ptr ;
2815
- _php_curl_close_ex (ch);
2815
+ swoole_curl_close_ex (ch);
2816
2816
}
2817
2817
#endif
2818
2818
/* }}} */
@@ -2877,7 +2877,7 @@ PHP_FUNCTION(swoole_native_curl_reset) {
2877
2877
#endif
2878
2878
ZEND_PARSE_PARAMETERS_END ();
2879
2879
2880
- if ((ch = _php_curl_get_handle (zid)) == NULL ) {
2880
+ if ((ch = swoole_curl_get_handle (zid)) == NULL ) {
2881
2881
RETURN_FALSE;
2882
2882
}
2883
2883
@@ -2909,7 +2909,7 @@ PHP_FUNCTION(swoole_native_curl_escape) {
2909
2909
Z_PARAM_STR (str)
2910
2910
ZEND_PARSE_PARAMETERS_END ();
2911
2911
2912
- if ((ch = _php_curl_get_handle (zid)) == NULL ) {
2912
+ if ((ch = swoole_curl_get_handle (zid)) == NULL ) {
2913
2913
RETURN_FALSE;
2914
2914
}
2915
2915
@@ -2982,7 +2982,7 @@ PHP_FUNCTION(swoole_native_curl_pause) {
2982
2982
Z_PARAM_LONG (bitmask)
2983
2983
ZEND_PARSE_PARAMETERS_END ();
2984
2984
2985
- if ((ch = _php_curl_get_handle (zid)) == NULL ) {
2985
+ if ((ch = swoole_curl_get_handle (zid)) == NULL ) {
2986
2986
RETURN_FALSE;
2987
2987
}
2988
2988
0 commit comments