Lines Matching refs:handlers

151 	if (!Z_ISUNDEF(ch->handlers.std_err)) {  in _php_curl_verify_handlers()
152 …stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers.std_err, NULL, php_file_le_stream(), … in _php_curl_verify_handlers()
157 zval_ptr_dtor(&ch->handlers.std_err); in _php_curl_verify_handlers()
158 ZVAL_UNDEF(&ch->handlers.std_err); in _php_curl_verify_handlers()
163 if (ch->handlers.read && !Z_ISUNDEF(ch->handlers.read->stream)) { in _php_curl_verify_handlers()
164 …stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers.read->stream, NULL, php_file_le_strea… in _php_curl_verify_handlers()
169 zval_ptr_dtor(&ch->handlers.read->stream); in _php_curl_verify_handlers()
170 ZVAL_UNDEF(&ch->handlers.read->stream); in _php_curl_verify_handlers()
171 ch->handlers.read->res = NULL; in _php_curl_verify_handlers()
172 ch->handlers.read->fp = 0; in _php_curl_verify_handlers()
177 if (ch->handlers.write_header && !Z_ISUNDEF(ch->handlers.write_header->stream)) { in _php_curl_verify_handlers()
178 …stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers.write_header->stream, NULL, php_file_… in _php_curl_verify_handlers()
183 zval_ptr_dtor(&ch->handlers.write_header->stream); in _php_curl_verify_handlers()
184 ZVAL_UNDEF(&ch->handlers.write_header->stream); in _php_curl_verify_handlers()
185 ch->handlers.write_header->fp = 0; in _php_curl_verify_handlers()
187 ch->handlers.write_header->method = PHP_CURL_IGNORE; in _php_curl_verify_handlers()
191 if (ch->handlers.write && !Z_ISUNDEF(ch->handlers.write->stream)) { in _php_curl_verify_handlers()
192 …stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers.write->stream, NULL, php_file_le_stre… in _php_curl_verify_handlers()
197 zval_ptr_dtor(&ch->handlers.write->stream); in _php_curl_verify_handlers()
198 ZVAL_UNDEF(&ch->handlers.write->stream); in _php_curl_verify_handlers()
199 ch->handlers.write->fp = 0; in _php_curl_verify_handlers()
201 ch->handlers.write->method = PHP_CURL_STDOUT; in _php_curl_verify_handlers()
476 if (curl->handlers.read) { in curl_get_gc()
477 if (ZEND_FCC_INITIALIZED(curl->handlers.read->fcc)) { in curl_get_gc()
478 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->handlers.read->fcc); in curl_get_gc()
480 zend_get_gc_buffer_add_zval(gc_buffer, &curl->handlers.read->stream); in curl_get_gc()
483 if (curl->handlers.write) { in curl_get_gc()
484 if (ZEND_FCC_INITIALIZED(curl->handlers.write->fcc)) { in curl_get_gc()
485 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->handlers.write->fcc); in curl_get_gc()
487 zend_get_gc_buffer_add_zval(gc_buffer, &curl->handlers.write->stream); in curl_get_gc()
490 if (curl->handlers.write_header) { in curl_get_gc()
491 if (ZEND_FCC_INITIALIZED(curl->handlers.write_header->fcc)) { in curl_get_gc()
492 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->handlers.write_header->fcc); in curl_get_gc()
494 zend_get_gc_buffer_add_zval(gc_buffer, &curl->handlers.write_header->stream); in curl_get_gc()
497 if (ZEND_FCC_INITIALIZED(curl->handlers.progress)) { in curl_get_gc()
498 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->handlers.progress); in curl_get_gc()
501 if (ZEND_FCC_INITIALIZED(curl->handlers.xferinfo)) { in curl_get_gc()
502 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->handlers.xferinfo); in curl_get_gc()
505 if (ZEND_FCC_INITIALIZED(curl->handlers.fnmatch)) { in curl_get_gc()
506 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->handlers.fnmatch); in curl_get_gc()
510 if (ZEND_FCC_INITIALIZED(curl->handlers.sshhostkey)) { in curl_get_gc()
511 zend_get_gc_buffer_add_fcc(gc_buffer, &curl->handlers.sshhostkey); in curl_get_gc()
515 zend_get_gc_buffer_add_zval(gc_buffer, &curl->handlers.std_err); in curl_get_gc()
563 php_curl_write *write_handler = ch->handlers.write; in curl_write()
623 …zend_call_known_fcc(&ch->handlers.fnmatch, &retval, /* param_count */ 3, argv, /* named_params */ … in curl_fnmatch()
660 …zend_call_known_fcc(&ch->handlers.progress, &retval, /* param_count */ 5, args, /* named_params */… in curl_progress()
698 …zend_call_known_fcc(&ch->handlers.xferinfo, &retval, /* param_count */ 5, argv, /* named_params */… in curl_xferinfo()
735 …zend_call_known_fcc(&ch->handlers.sshhostkey, &retval, /* param_count */ 4, args, /* named_params … in curl_ssh_hostkeyfunction()
762 php_curl_read *read_handler = ch->handlers.read; in curl_read()
814 php_curl_write *write_handler = ch->handlers.write_header; in curl_write_header()
821 if (ch->handlers.write->method == PHP_CURL_RETURN && length > 0) { in curl_write_header()
822 smart_str_appendl(&ch->handlers.write->buf, data, (int) length); in curl_write_header()
1036 ch->handlers.write = ecalloc(1, sizeof(php_curl_write)); in init_curl_handle()
1037 ch->handlers.write_header = ecalloc(1, sizeof(php_curl_write)); in init_curl_handle()
1038 ch->handlers.read = ecalloc(1, sizeof(php_curl_read)); in init_curl_handle()
1039 ch->handlers.progress = empty_fcall_info_cache; in init_curl_handle()
1040 ch->handlers.xferinfo = empty_fcall_info_cache; in init_curl_handle()
1041 ch->handlers.fnmatch = empty_fcall_info_cache; in init_curl_handle()
1043 ch->handlers.sshhostkey = empty_fcall_info_cache; in init_curl_handle()
1150 ch->handlers.write->method = PHP_CURL_STDOUT; in PHP_FUNCTION()
1151 ch->handlers.read->method = PHP_CURL_DIRECT; in PHP_FUNCTION()
1152 ch->handlers.write_header->method = PHP_CURL_IGNORE; in PHP_FUNCTION()
1175 if (!Z_ISUNDEF(source->handlers.write->stream)) { in _php_setup_easy_copy_handlers()
1176 Z_ADDREF(source->handlers.write->stream); in _php_setup_easy_copy_handlers()
1178 ch->handlers.write->stream = source->handlers.write->stream; in _php_setup_easy_copy_handlers()
1179 ch->handlers.write->method = source->handlers.write->method; in _php_setup_easy_copy_handlers()
1180 if (!Z_ISUNDEF(source->handlers.read->stream)) { in _php_setup_easy_copy_handlers()
1181 Z_ADDREF(source->handlers.read->stream); in _php_setup_easy_copy_handlers()
1183 ch->handlers.read->stream = source->handlers.read->stream; in _php_setup_easy_copy_handlers()
1184 ch->handlers.read->method = source->handlers.read->method; in _php_setup_easy_copy_handlers()
1185 ch->handlers.write_header->method = source->handlers.write_header->method; in _php_setup_easy_copy_handlers()
1186 if (!Z_ISUNDEF(source->handlers.write_header->stream)) { in _php_setup_easy_copy_handlers()
1187 Z_ADDREF(source->handlers.write_header->stream); in _php_setup_easy_copy_handlers()
1189 ch->handlers.write_header->stream = source->handlers.write_header->stream; in _php_setup_easy_copy_handlers()
1191 ch->handlers.write->fp = source->handlers.write->fp; in _php_setup_easy_copy_handlers()
1192 ch->handlers.write_header->fp = source->handlers.write_header->fp; in _php_setup_easy_copy_handlers()
1193 ch->handlers.read->fp = source->handlers.read->fp; in _php_setup_easy_copy_handlers()
1194 ch->handlers.read->res = source->handlers.read->res; in _php_setup_easy_copy_handlers()
1196 if (ZEND_FCC_INITIALIZED(source->handlers.read->fcc)) { in _php_setup_easy_copy_handlers()
1197 zend_fcc_dup(&source->handlers.read->fcc, &source->handlers.read->fcc); in _php_setup_easy_copy_handlers()
1199 if (ZEND_FCC_INITIALIZED(source->handlers.write->fcc)) { in _php_setup_easy_copy_handlers()
1200 zend_fcc_dup(&source->handlers.write->fcc, &source->handlers.write->fcc); in _php_setup_easy_copy_handlers()
1202 if (ZEND_FCC_INITIALIZED(source->handlers.write_header->fcc)) { in _php_setup_easy_copy_handlers()
1203 zend_fcc_dup(&source->handlers.write_header->fcc, &source->handlers.write_header->fcc); in _php_setup_easy_copy_handlers()
1212 …php_curl_copy_fcc_with_option(ch, CURLOPT_PROGRESSDATA, &ch->handlers.progress, &source->handlers.… in _php_setup_easy_copy_handlers()
1213 …php_curl_copy_fcc_with_option(ch, CURLOPT_XFERINFODATA, &ch->handlers.xferinfo, &source->handlers.… in _php_setup_easy_copy_handlers()
1214 …php_curl_copy_fcc_with_option(ch, CURLOPT_FNMATCH_DATA, &ch->handlers.fnmatch, &source->handlers.f… in _php_setup_easy_copy_handlers()
1216 …l_copy_fcc_with_option(ch, CURLOPT_SSH_HOSTKEYDATA, &ch->handlers.sshhostkey, &source->handlers.ss… in _php_setup_easy_copy_handlers()
1538 …bool result = php_curl_set_callable_handler(&curl_ptr->handlers.handler_type->fcc, zvalue, is_arra…
1542 curl_ptr->handlers.handler_type->method = PHP_CURL_USER; \
1568 HANDLE_CURL_OPTION_CALLABLE(ch, CURLOPT_PROGRESS, handlers.progress, curl_progress); in _php_curl_setopt()
1569 HANDLE_CURL_OPTION_CALLABLE(ch, CURLOPT_XFERINFO, handlers.xferinfo, curl_xferinfo); in _php_curl_setopt()
1570 HANDLE_CURL_OPTION_CALLABLE(ch, CURLOPT_FNMATCH_, handlers.fnmatch, curl_fnmatch); in _php_curl_setopt()
1572 …HANDLE_CURL_OPTION_CALLABLE(ch, CURLOPT_SSH_HOSTKEY, handlers.sshhostkey, curl_ssh_hostkeyfunction… in _php_curl_setopt()
1924 if (!Z_ISUNDEF(ch->handlers.write->stream)) { in _php_curl_setopt()
1925 zval_ptr_dtor(&ch->handlers.write->stream); in _php_curl_setopt()
1926 ZVAL_UNDEF(&ch->handlers.write->stream); in _php_curl_setopt()
1928 ch->handlers.write->fp = NULL; in _php_curl_setopt()
1929 ch->handlers.write->method = PHP_CURL_STDOUT; in _php_curl_setopt()
1931 zval_ptr_dtor(&ch->handlers.write->stream); in _php_curl_setopt()
1932 ch->handlers.write->fp = fp; in _php_curl_setopt()
1933 ch->handlers.write->method = PHP_CURL_FILE; in _php_curl_setopt()
1934 ZVAL_COPY(&ch->handlers.write->stream, zvalue); in _php_curl_setopt()
1942 if (!Z_ISUNDEF(ch->handlers.write_header->stream)) { in _php_curl_setopt()
1943 zval_ptr_dtor(&ch->handlers.write_header->stream); in _php_curl_setopt()
1944 ZVAL_UNDEF(&ch->handlers.write_header->stream); in _php_curl_setopt()
1946 ch->handlers.write_header->fp = NULL; in _php_curl_setopt()
1947 ch->handlers.write_header->method = PHP_CURL_IGNORE; in _php_curl_setopt()
1949 zval_ptr_dtor(&ch->handlers.write_header->stream); in _php_curl_setopt()
1950 ch->handlers.write_header->fp = fp; in _php_curl_setopt()
1951 ch->handlers.write_header->method = PHP_CURL_FILE; in _php_curl_setopt()
1952 ZVAL_COPY(&ch->handlers.write_header->stream, zvalue); in _php_curl_setopt()
1960 if (!Z_ISUNDEF(ch->handlers.read->stream)) { in _php_curl_setopt()
1961 zval_ptr_dtor(&ch->handlers.read->stream); in _php_curl_setopt()
1962 ZVAL_UNDEF(&ch->handlers.read->stream); in _php_curl_setopt()
1964 ch->handlers.read->fp = NULL; in _php_curl_setopt()
1965 ch->handlers.read->res = NULL; in _php_curl_setopt()
1967 zval_ptr_dtor(&ch->handlers.read->stream); in _php_curl_setopt()
1968 ch->handlers.read->fp = fp; in _php_curl_setopt()
1969 ch->handlers.read->res = Z_RES_P(zvalue); in _php_curl_setopt()
1970 ZVAL_COPY(&ch->handlers.read->stream, zvalue); in _php_curl_setopt()
1975 if (!Z_ISUNDEF(ch->handlers.std_err)) { in _php_curl_setopt()
1976 zval_ptr_dtor(&ch->handlers.std_err); in _php_curl_setopt()
1977 ZVAL_UNDEF(&ch->handlers.std_err); in _php_curl_setopt()
1980 zval_ptr_dtor(&ch->handlers.std_err); in _php_curl_setopt()
1981 ZVAL_COPY(&ch->handlers.std_err, zvalue); in _php_curl_setopt()
2106 ch->handlers.write->method = PHP_CURL_RETURN; in _php_curl_setopt()
2108 ch->handlers.write->method = PHP_CURL_STDOUT; in _php_curl_setopt()
2285 smart_str_free(&ch->handlers.write->buf); in _php_curl_cleanup_handle()
2317 smart_str_free(&ch->handlers.write->buf); in PHP_FUNCTION()
2321 if (!Z_ISUNDEF(ch->handlers.std_err)) { in PHP_FUNCTION()
2323 …stream = (php_stream*)zend_fetch_resource2_ex(&ch->handlers.std_err, NULL, php_file_le_stream(), p… in PHP_FUNCTION()
2329 if (ch->handlers.write->method == PHP_CURL_RETURN && ch->handlers.write->buf.s) { in PHP_FUNCTION()
2330 smart_str_0(&ch->handlers.write->buf); in PHP_FUNCTION()
2331 RETURN_STR_COPY(ch->handlers.write->buf.s); in PHP_FUNCTION()
2335 if (ch->handlers.write->method == PHP_CURL_FILE && ch->handlers.write->fp) { in PHP_FUNCTION()
2336 fflush(ch->handlers.write->fp); in PHP_FUNCTION()
2338 if (ch->handlers.write_header->method == PHP_CURL_FILE && ch->handlers.write_header->fp) { in PHP_FUNCTION()
2339 fflush(ch->handlers.write_header->fp); in PHP_FUNCTION()
2342 if (ch->handlers.write->method == PHP_CURL_RETURN) { in PHP_FUNCTION()
2698 smart_str_free(&ch->handlers.write->buf); in curl_free_obj()
2699 if (ZEND_FCC_INITIALIZED(ch->handlers.write->fcc)) { in curl_free_obj()
2700 zend_fcc_dtor(&ch->handlers.write->fcc); in curl_free_obj()
2702 if (ZEND_FCC_INITIALIZED(ch->handlers.write_header->fcc)) { in curl_free_obj()
2703 zend_fcc_dtor(&ch->handlers.write_header->fcc); in curl_free_obj()
2705 if (ZEND_FCC_INITIALIZED(ch->handlers.read->fcc)) { in curl_free_obj()
2706 zend_fcc_dtor(&ch->handlers.read->fcc); in curl_free_obj()
2708 zval_ptr_dtor(&ch->handlers.std_err); in curl_free_obj()
2713 zval_ptr_dtor(&ch->handlers.write_header->stream); in curl_free_obj()
2714 zval_ptr_dtor(&ch->handlers.write->stream); in curl_free_obj()
2715 zval_ptr_dtor(&ch->handlers.read->stream); in curl_free_obj()
2717 efree(ch->handlers.write); in curl_free_obj()
2718 efree(ch->handlers.write_header); in curl_free_obj()
2719 efree(ch->handlers.read); in curl_free_obj()
2721 if (ZEND_FCC_INITIALIZED(ch->handlers.progress)) { in curl_free_obj()
2722 zend_fcc_dtor(&ch->handlers.progress); in curl_free_obj()
2724 if (ZEND_FCC_INITIALIZED(ch->handlers.xferinfo)) { in curl_free_obj()
2725 zend_fcc_dtor(&ch->handlers.xferinfo); in curl_free_obj()
2727 if (ZEND_FCC_INITIALIZED(ch->handlers.fnmatch)) { in curl_free_obj()
2728 zend_fcc_dtor(&ch->handlers.fnmatch); in curl_free_obj()
2731 if (ZEND_FCC_INITIALIZED(ch->handlers.sshhostkey)) { in curl_free_obj()
2732 zend_fcc_dtor(&ch->handlers.sshhostkey); in curl_free_obj()
2770 if (!Z_ISUNDEF(ch->handlers.write->stream)) { in _php_curl_reset_handlers()
2771 zval_ptr_dtor(&ch->handlers.write->stream); in _php_curl_reset_handlers()
2772 ZVAL_UNDEF(&ch->handlers.write->stream); in _php_curl_reset_handlers()
2774 ch->handlers.write->fp = NULL; in _php_curl_reset_handlers()
2775 ch->handlers.write->method = PHP_CURL_STDOUT; in _php_curl_reset_handlers()
2777 if (!Z_ISUNDEF(ch->handlers.write_header->stream)) { in _php_curl_reset_handlers()
2778 zval_ptr_dtor(&ch->handlers.write_header->stream); in _php_curl_reset_handlers()
2779 ZVAL_UNDEF(&ch->handlers.write_header->stream); in _php_curl_reset_handlers()
2781 ch->handlers.write_header->fp = NULL; in _php_curl_reset_handlers()
2782 ch->handlers.write_header->method = PHP_CURL_IGNORE; in _php_curl_reset_handlers()
2784 if (!Z_ISUNDEF(ch->handlers.read->stream)) { in _php_curl_reset_handlers()
2785 zval_ptr_dtor(&ch->handlers.read->stream); in _php_curl_reset_handlers()
2786 ZVAL_UNDEF(&ch->handlers.read->stream); in _php_curl_reset_handlers()
2788 ch->handlers.read->fp = NULL; in _php_curl_reset_handlers()
2789 ch->handlers.read->res = NULL; in _php_curl_reset_handlers()
2790 ch->handlers.read->method = PHP_CURL_DIRECT; in _php_curl_reset_handlers()
2792 if (!Z_ISUNDEF(ch->handlers.std_err)) { in _php_curl_reset_handlers()
2793 zval_ptr_dtor(&ch->handlers.std_err); in _php_curl_reset_handlers()
2794 ZVAL_UNDEF(&ch->handlers.std_err); in _php_curl_reset_handlers()
2797 if (ZEND_FCC_INITIALIZED(ch->handlers.progress)) { in _php_curl_reset_handlers()
2798 zend_fcc_dtor(&ch->handlers.progress); in _php_curl_reset_handlers()
2801 if (ZEND_FCC_INITIALIZED(ch->handlers.xferinfo)) { in _php_curl_reset_handlers()
2802 zend_fcc_dtor(&ch->handlers.xferinfo); in _php_curl_reset_handlers()
2805 if (ZEND_FCC_INITIALIZED(ch->handlers.fnmatch)) { in _php_curl_reset_handlers()
2806 zend_fcc_dtor(&ch->handlers.fnmatch); in _php_curl_reset_handlers()
2810 if (ZEND_FCC_INITIALIZED(ch->handlers.sshhostkey)) { in _php_curl_reset_handlers()
2811 zend_fcc_dtor(&ch->handlers.sshhostkey); in _php_curl_reset_handlers()