Lines Matching refs:handlers

227 	if (!ch || !ch->handlers) {  in _php_curl_verify_handlers()
231 if (ch->handlers->std_err) { in _php_curl_verify_handlers()
232 …stream = (php_stream *) zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, p… in _php_curl_verify_handlers()
237 zval_ptr_dtor(&ch->handlers->std_err); in _php_curl_verify_handlers()
238 ch->handlers->std_err = NULL; in _php_curl_verify_handlers()
243 if (ch->handlers->read && ch->handlers->read->stream) { in _php_curl_verify_handlers()
244 …stream = (php_stream *) zend_fetch_resource(&ch->handlers->read->stream TSRMLS_CC, -1, NULL, NULL,… in _php_curl_verify_handlers()
249 zval_ptr_dtor(&ch->handlers->read->stream); in _php_curl_verify_handlers()
250 ch->handlers->read->fd = 0; in _php_curl_verify_handlers()
251 ch->handlers->read->fp = 0; in _php_curl_verify_handlers()
252 ch->handlers->read->stream = NULL; in _php_curl_verify_handlers()
257 if (ch->handlers->write_header && ch->handlers->write_header->stream) { in _php_curl_verify_handlers()
258 …stream = (php_stream *) zend_fetch_resource(&ch->handlers->write_header->stream TSRMLS_CC, -1, NUL… in _php_curl_verify_handlers()
263 zval_ptr_dtor(&ch->handlers->write_header->stream); in _php_curl_verify_handlers()
264 ch->handlers->write_header->fp = 0; in _php_curl_verify_handlers()
265 ch->handlers->write_header->stream = NULL; in _php_curl_verify_handlers()
267 ch->handlers->write_header->method = PHP_CURL_IGNORE; in _php_curl_verify_handlers()
271 if (ch->handlers->write && ch->handlers->write->stream) { in _php_curl_verify_handlers()
272 …stream = (php_stream *) zend_fetch_resource(&ch->handlers->write->stream TSRMLS_CC, -1, NULL, NULL… in _php_curl_verify_handlers()
277 zval_ptr_dtor(&ch->handlers->write->stream); in _php_curl_verify_handlers()
278 ch->handlers->write->fp = 0; in _php_curl_verify_handlers()
279 ch->handlers->write->stream = NULL; in _php_curl_verify_handlers()
281 ch->handlers->write->method = PHP_CURL_STDOUT; in _php_curl_verify_handlers()
1303 php_curl_write *t = ch->handlers->write; in curl_write()
1381 php_curl_fnmatch *t = ch->handlers->fnmatch; in curl_fnmatch()
1446 php_curl_progress *t = ch->handlers->progress; in curl_progress()
1528 php_curl_read *t = ch->handlers->read; in curl_read()
1604 php_curl_write *t = ch->handlers->write_header; in curl_write_header()
1612 if (ch->handlers->write->method == PHP_CURL_RETURN && length > 0) { in curl_write_header()
1613 smart_str_appendl(&ch->handlers->write->buf, data, (int) length); in curl_write_header()
1702 zval *func = ch->handlers->passwd; in curl_passwd()
1814 (*ch)->handlers = ecalloc(1, sizeof(php_curl_handlers)); in alloc_curl_handle()
1815 (*ch)->handlers->write = ecalloc(1, sizeof(php_curl_write)); in alloc_curl_handle()
1816 (*ch)->handlers->write_header = ecalloc(1, sizeof(php_curl_write)); in alloc_curl_handle()
1817 (*ch)->handlers->read = ecalloc(1, sizeof(php_curl_read)); in alloc_curl_handle()
1818 (*ch)->handlers->progress = NULL; in alloc_curl_handle()
1820 (*ch)->handlers->fnmatch = NULL; in alloc_curl_handle()
1827 (*ch)->handlers->write->stream = NULL; in alloc_curl_handle()
1828 (*ch)->handlers->write_header->stream = NULL; in alloc_curl_handle()
1829 (*ch)->handlers->read->stream = NULL; in alloc_curl_handle()
1973 ch->handlers->write->method = PHP_CURL_STDOUT; in PHP_FUNCTION()
1974 ch->handlers->read->method = PHP_CURL_DIRECT; in PHP_FUNCTION()
1975 ch->handlers->write_header->method = PHP_CURL_IGNORE; in PHP_FUNCTION()
2019 if (ch->handlers->write->stream) { in PHP_FUNCTION()
2020 Z_ADDREF_P(ch->handlers->write->stream); in PHP_FUNCTION()
2022 dupch->handlers->write->stream = ch->handlers->write->stream; in PHP_FUNCTION()
2023 dupch->handlers->write->method = ch->handlers->write->method; in PHP_FUNCTION()
2024 if (ch->handlers->read->stream) { in PHP_FUNCTION()
2025 Z_ADDREF_P(ch->handlers->read->stream); in PHP_FUNCTION()
2027 dupch->handlers->read->stream = ch->handlers->read->stream; in PHP_FUNCTION()
2028 dupch->handlers->read->method = ch->handlers->read->method; in PHP_FUNCTION()
2029 dupch->handlers->write_header->method = ch->handlers->write_header->method; in PHP_FUNCTION()
2030 if (ch->handlers->write_header->stream) { in PHP_FUNCTION()
2031 Z_ADDREF_P(ch->handlers->write_header->stream); in PHP_FUNCTION()
2033 dupch->handlers->write_header->stream = ch->handlers->write_header->stream; in PHP_FUNCTION()
2035 dupch->handlers->write->fp = ch->handlers->write->fp; in PHP_FUNCTION()
2036 dupch->handlers->write_header->fp = ch->handlers->write_header->fp; in PHP_FUNCTION()
2037 dupch->handlers->read->fp = ch->handlers->read->fp; in PHP_FUNCTION()
2038 dupch->handlers->read->fd = ch->handlers->read->fd; in PHP_FUNCTION()
2040 if (ch->handlers->passwd) { in PHP_FUNCTION()
2041 zval_add_ref(&ch->handlers->passwd); in PHP_FUNCTION()
2042 dupch->handlers->passwd = ch->handlers->passwd; in PHP_FUNCTION()
2046 if (ch->handlers->write->func_name) { in PHP_FUNCTION()
2047 zval_add_ref(&ch->handlers->write->func_name); in PHP_FUNCTION()
2048 dupch->handlers->write->func_name = ch->handlers->write->func_name; in PHP_FUNCTION()
2050 if (ch->handlers->read->func_name) { in PHP_FUNCTION()
2051 zval_add_ref(&ch->handlers->read->func_name); in PHP_FUNCTION()
2052 dupch->handlers->read->func_name = ch->handlers->read->func_name; in PHP_FUNCTION()
2054 if (ch->handlers->write_header->func_name) { in PHP_FUNCTION()
2055 zval_add_ref(&ch->handlers->write_header->func_name); in PHP_FUNCTION()
2056 dupch->handlers->write_header->func_name = ch->handlers->write_header->func_name; in PHP_FUNCTION()
2064 if (ch->handlers->progress) { in PHP_FUNCTION()
2065 dupch->handlers->progress = ecalloc(1, sizeof(php_curl_progress)); in PHP_FUNCTION()
2066 if (ch->handlers->progress->func_name) { in PHP_FUNCTION()
2067 zval_add_ref(&ch->handlers->progress->func_name); in PHP_FUNCTION()
2068 dupch->handlers->progress->func_name = ch->handlers->progress->func_name; in PHP_FUNCTION()
2070 dupch->handlers->progress->method = ch->handlers->progress->method; in PHP_FUNCTION()
2076 if (ch->handlers->fnmatch) { in PHP_FUNCTION()
2077 dupch->handlers->fnmatch = ecalloc(1, sizeof(php_curl_fnmatch)); in PHP_FUNCTION()
2078 if (ch->handlers->fnmatch->func_name) { in PHP_FUNCTION()
2079 zval_add_ref(&ch->handlers->fnmatch->func_name); in PHP_FUNCTION()
2080 dupch->handlers->fnmatch->func_name = ch->handlers->fnmatch->func_name; in PHP_FUNCTION()
2082 dupch->handlers->fnmatch->method = ch->handlers->fnmatch->method; in PHP_FUNCTION()
2402 if (ch->handlers->write->stream) { in _php_curl_setopt()
2403 Z_DELREF_P(ch->handlers->write->stream); in _php_curl_setopt()
2404 ch->handlers->write->stream = NULL; in _php_curl_setopt()
2406 ch->handlers->write->fp = NULL; in _php_curl_setopt()
2407 ch->handlers->write->method = PHP_CURL_STDOUT; in _php_curl_setopt()
2409 if (ch->handlers->write->stream) { in _php_curl_setopt()
2410 Z_DELREF_P(ch->handlers->write->stream); in _php_curl_setopt()
2413 ch->handlers->write->fp = fp; in _php_curl_setopt()
2414 ch->handlers->write->method = PHP_CURL_FILE; in _php_curl_setopt()
2415 ch->handlers->write->stream = *zvalue; in _php_curl_setopt()
2423 if (ch->handlers->write_header->stream) { in _php_curl_setopt()
2424 Z_DELREF_P(ch->handlers->write_header->stream); in _php_curl_setopt()
2425 ch->handlers->write_header->stream = NULL; in _php_curl_setopt()
2427 ch->handlers->write_header->fp = NULL; in _php_curl_setopt()
2428 ch->handlers->write_header->method = PHP_CURL_IGNORE; in _php_curl_setopt()
2430 if (ch->handlers->write_header->stream) { in _php_curl_setopt()
2431 Z_DELREF_P(ch->handlers->write_header->stream); in _php_curl_setopt()
2434 ch->handlers->write_header->fp = fp; in _php_curl_setopt()
2435 ch->handlers->write_header->method = PHP_CURL_FILE; in _php_curl_setopt()
2436 ch->handlers->write_header->stream = *zvalue; in _php_curl_setopt()
2444 if (ch->handlers->read->stream) { in _php_curl_setopt()
2445 Z_DELREF_P(ch->handlers->read->stream); in _php_curl_setopt()
2446 ch->handlers->read->stream = NULL; in _php_curl_setopt()
2448 ch->handlers->read->fp = NULL; in _php_curl_setopt()
2449 ch->handlers->read->fd = 0; in _php_curl_setopt()
2451 if (ch->handlers->read->stream) { in _php_curl_setopt()
2452 Z_DELREF_P(ch->handlers->read->stream); in _php_curl_setopt()
2455 ch->handlers->read->fp = fp; in _php_curl_setopt()
2456 ch->handlers->read->fd = Z_LVAL_PP(zvalue); in _php_curl_setopt()
2457 ch->handlers->read->stream = *zvalue; in _php_curl_setopt()
2462 if (ch->handlers->std_err) { in _php_curl_setopt()
2463 zval_ptr_dtor(&ch->handlers->std_err); in _php_curl_setopt()
2464 ch->handlers->std_err = NULL; in _php_curl_setopt()
2467 if (ch->handlers->std_err) { in _php_curl_setopt()
2468 zval_ptr_dtor(&ch->handlers->std_err); in _php_curl_setopt()
2471 ch->handlers->std_err = *zvalue; in _php_curl_setopt()
2575 if (ch->handlers->write_header->func_name) { in _php_curl_setopt()
2576 zval_ptr_dtor(&ch->handlers->write_header->func_name); in _php_curl_setopt()
2577 ch->handlers->write_header->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2580 ch->handlers->write_header->func_name = *zvalue; in _php_curl_setopt()
2581 ch->handlers->write_header->method = PHP_CURL_USER; in _php_curl_setopt()
2740 if (ch->handlers->progress == NULL) { in _php_curl_setopt()
2741 ch->handlers->progress = ecalloc(1, sizeof(php_curl_progress)); in _php_curl_setopt()
2742 } else if (ch->handlers->progress->func_name) { in _php_curl_setopt()
2743 zval_ptr_dtor(&ch->handlers->progress->func_name); in _php_curl_setopt()
2744 ch->handlers->progress->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2747 ch->handlers->progress->func_name = *zvalue; in _php_curl_setopt()
2748 ch->handlers->progress->method = PHP_CURL_USER; in _php_curl_setopt()
2752 if (ch->handlers->read->func_name) { in _php_curl_setopt()
2753 zval_ptr_dtor(&ch->handlers->read->func_name); in _php_curl_setopt()
2754 ch->handlers->read->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2757 ch->handlers->read->func_name = *zvalue; in _php_curl_setopt()
2758 ch->handlers->read->method = PHP_CURL_USER; in _php_curl_setopt()
2764 ch->handlers->write->method = PHP_CURL_RETURN; in _php_curl_setopt()
2766 ch->handlers->write->method = PHP_CURL_STDOUT; in _php_curl_setopt()
2771 if (ch->handlers->write->func_name) { in _php_curl_setopt()
2772 zval_ptr_dtor(&ch->handlers->write->func_name); in _php_curl_setopt()
2773 ch->handlers->write->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2776 ch->handlers->write->func_name = *zvalue; in _php_curl_setopt()
2777 ch->handlers->write->method = PHP_CURL_USER; in _php_curl_setopt()
2797 if (ch->handlers->passwd) { in _php_curl_setopt()
2798 zval_ptr_dtor(&ch->handlers->passwd); in _php_curl_setopt()
2801 ch->handlers->passwd = *zvalue; in _php_curl_setopt()
2865 if (ch->handlers->fnmatch == NULL) { in _php_curl_setopt()
2866 ch->handlers->fnmatch = ecalloc(1, sizeof(php_curl_fnmatch)); in _php_curl_setopt()
2867 } else if (ch->handlers->fnmatch->func_name) { in _php_curl_setopt()
2868 zval_ptr_dtor(&ch->handlers->fnmatch->func_name); in _php_curl_setopt()
2869 ch->handlers->fnmatch->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2872 ch->handlers->fnmatch->func_name = *zvalue; in _php_curl_setopt()
2873 ch->handlers->fnmatch->method = PHP_CURL_USER; in _php_curl_setopt()
2951 if (ch->handlers->write->buf.len > 0) { in _php_curl_cleanup_handle()
2952 smart_str_free(&ch->handlers->write->buf); in _php_curl_cleanup_handle()
2986 if (ch->handlers->write->buf.len > 0) { in PHP_FUNCTION()
2987 smart_str_free(&ch->handlers->write->buf); in PHP_FUNCTION()
2992 if (ch->handlers->std_err) { in PHP_FUNCTION()
2994 …stream = (php_stream*)zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, php… in PHP_FUNCTION()
3000 if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) { in PHP_FUNCTION()
3001 smart_str_0(&ch->handlers->write->buf); in PHP_FUNCTION()
3002 RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1); in PHP_FUNCTION()
3006 if (ch->handlers->write->method == PHP_CURL_FILE && ch->handlers->write->fp) { in PHP_FUNCTION()
3007 fflush(ch->handlers->write->fp); in PHP_FUNCTION()
3009 if (ch->handlers->write_header->method == PHP_CURL_FILE && ch->handlers->write_header->fp) { in PHP_FUNCTION()
3010 fflush(ch->handlers->write_header->fp); in PHP_FUNCTION()
3013 if (ch->handlers->write->method == PHP_CURL_RETURN) { in PHP_FUNCTION()
3324 if (ch->handlers->write->buf.len > 0) { in _php_curl_close_ex()
3325 smart_str_free(&ch->handlers->write->buf); in _php_curl_close_ex()
3327 if (ch->handlers->write->func_name) { in _php_curl_close_ex()
3328 zval_ptr_dtor(&ch->handlers->write->func_name); in _php_curl_close_ex()
3330 if (ch->handlers->read->func_name) { in _php_curl_close_ex()
3331 zval_ptr_dtor(&ch->handlers->read->func_name); in _php_curl_close_ex()
3333 if (ch->handlers->write_header->func_name) { in _php_curl_close_ex()
3334 zval_ptr_dtor(&ch->handlers->write_header->func_name); in _php_curl_close_ex()
3337 if (ch->handlers->passwd) { in _php_curl_close_ex()
3338 zval_ptr_dtor(&ch->handlers->passwd); in _php_curl_close_ex()
3341 if (ch->handlers->std_err) { in _php_curl_close_ex()
3342 zval_ptr_dtor(&ch->handlers->std_err); in _php_curl_close_ex()
3348 if (ch->handlers->write_header->stream) { in _php_curl_close_ex()
3349 zval_ptr_dtor(&ch->handlers->write_header->stream); in _php_curl_close_ex()
3351 if (ch->handlers->write->stream) { in _php_curl_close_ex()
3352 zval_ptr_dtor(&ch->handlers->write->stream); in _php_curl_close_ex()
3354 if (ch->handlers->read->stream) { in _php_curl_close_ex()
3355 zval_ptr_dtor(&ch->handlers->read->stream); in _php_curl_close_ex()
3358 efree(ch->handlers->write); in _php_curl_close_ex()
3359 efree(ch->handlers->write_header); in _php_curl_close_ex()
3360 efree(ch->handlers->read); in _php_curl_close_ex()
3362 if (ch->handlers->progress) { in _php_curl_close_ex()
3363 if (ch->handlers->progress->func_name) { in _php_curl_close_ex()
3364 zval_ptr_dtor(&ch->handlers->progress->func_name); in _php_curl_close_ex()
3366 efree(ch->handlers->progress); in _php_curl_close_ex()
3370 if (ch->handlers->fnmatch) { in _php_curl_close_ex()
3371 if (ch->handlers->fnmatch->func_name) { in _php_curl_close_ex()
3372 zval_ptr_dtor(&ch->handlers->fnmatch->func_name); in _php_curl_close_ex()
3374 efree(ch->handlers->fnmatch); in _php_curl_close_ex()
3378 efree(ch->handlers); in _php_curl_close_ex()
3419 if (ch->handlers->write->stream) { in _php_curl_reset_handlers()
3420 Z_DELREF_P(ch->handlers->write->stream); in _php_curl_reset_handlers()
3421 ch->handlers->write->stream = NULL; in _php_curl_reset_handlers()
3423 ch->handlers->write->fp = NULL; in _php_curl_reset_handlers()
3424 ch->handlers->write->method = PHP_CURL_STDOUT; in _php_curl_reset_handlers()
3426 if (ch->handlers->write_header->stream) { in _php_curl_reset_handlers()
3427 Z_DELREF_P(ch->handlers->write_header->stream); in _php_curl_reset_handlers()
3428 ch->handlers->write_header->stream = NULL; in _php_curl_reset_handlers()
3430 ch->handlers->write_header->fp = NULL; in _php_curl_reset_handlers()
3431 ch->handlers->write_header->method = PHP_CURL_IGNORE; in _php_curl_reset_handlers()
3433 if (ch->handlers->read->stream) { in _php_curl_reset_handlers()
3434 Z_DELREF_P(ch->handlers->read->stream); in _php_curl_reset_handlers()
3435 ch->handlers->read->stream = NULL; in _php_curl_reset_handlers()
3437 ch->handlers->read->fp = NULL; in _php_curl_reset_handlers()
3438 ch->handlers->read->fd = 0; in _php_curl_reset_handlers()
3439 ch->handlers->read->method = PHP_CURL_DIRECT; in _php_curl_reset_handlers()
3441 if (ch->handlers->std_err) { in _php_curl_reset_handlers()
3442 zval_ptr_dtor(&ch->handlers->std_err); in _php_curl_reset_handlers()
3443 ch->handlers->std_err = NULL; in _php_curl_reset_handlers()
3446 if (ch->handlers->progress) { in _php_curl_reset_handlers()
3447 if (ch->handlers->progress->func_name) { in _php_curl_reset_handlers()
3448 zval_ptr_dtor(&ch->handlers->progress->func_name); in _php_curl_reset_handlers()
3450 efree(ch->handlers->progress); in _php_curl_reset_handlers()
3451 ch->handlers->progress = NULL; in _php_curl_reset_handlers()
3455 if (ch->handlers->fnmatch) { in _php_curl_reset_handlers()
3456 if (ch->handlers->fnmatch->func_name) { in _php_curl_reset_handlers()
3457 zval_ptr_dtor(&ch->handlers->fnmatch->func_name); in _php_curl_reset_handlers()
3459 efree(ch->handlers->fnmatch); in _php_curl_reset_handlers()
3460 ch->handlers->fnmatch = NULL; in _php_curl_reset_handlers()