Lines Matching refs:ch

106 static zend_result php_curl_option_str(php_curl *ch, zend_long option, const char *str, const size_…  in php_curl_option_str()  argument
113 CURLcode error = curl_easy_setopt(ch->cp, option, str); in php_curl_option_str()
114 SAVE_CURL_ERROR(ch, error); in php_curl_option_str()
119 static zend_result php_curl_option_url(php_curl *ch, const zend_string *url) /* {{{ */ in php_curl_option_url() argument
123 curl_easy_setopt(ch->cp, CURLOPT_PROTOCOLS, CURLPROTO_ALL & ~CURLPROTO_FILE); in php_curl_option_url()
137 return php_curl_option_str(ch, CURLOPT_URL, _tmp, ZSTR_LEN(url) + 1); in php_curl_option_url()
141 return php_curl_option_str(ch, CURLOPT_URL, ZSTR_VAL(url), ZSTR_LEN(url)); in php_curl_option_url()
145 void _php_curl_verify_handlers(php_curl *ch, bool reporterror) /* {{{ */ in _php_curl_verify_handlers() argument
149 ZEND_ASSERT(ch); in _php_curl_verify_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()
160 curl_easy_setopt(ch->cp, CURLOPT_STDERR, stderr); 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()
174 curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch); 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()
188 curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch); 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()
202 curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch); in _php_curl_verify_handlers()
240 static inline zend_result build_mime_structure_from_hash(php_curl *ch, zval *zpostfields);
438 php_curl *ch; in curl_clone_obj() local
448 ch = curl_from_obj(object); in curl_clone_obj()
449 cp = curl_easy_duphandle(ch->cp); in curl_clone_obj()
456 _php_setup_easy_copy_handlers(clone_ch, ch); in curl_clone_obj()
565 php_curl *ch = (php_curl *) ctx; in curl_write() local
566 php_curl_write *t = ch->handlers.write; in curl_write()
591 GC_ADDREF(&ch->std); in curl_write()
592 ZVAL_OBJ(&argv[0], &ch->std); in curl_write()
603 ch->in_callback = 1; in curl_write()
605 ch->in_callback = 0; in curl_write()
610 _php_curl_verify_handlers(ch, /* reporterror */ true); in curl_write()
627 php_curl *ch = (php_curl *) ctx; in curl_fnmatch() local
628 php_curl_callback *t = ch->handlers.fnmatch; in curl_fnmatch()
635 GC_ADDREF(&ch->std); in curl_fnmatch()
636 ZVAL_OBJ(&argv[0], &ch->std); in curl_fnmatch()
648 ch->in_callback = 1; in curl_fnmatch()
650 ch->in_callback = 0; in curl_fnmatch()
654 _php_curl_verify_handlers(ch, /* reporterror */ true); in curl_fnmatch()
667 php_curl *ch = (php_curl *)clientp; in curl_progress() local
668 php_curl_callback *t = ch->handlers.progress; in curl_progress()
681 GC_ADDREF(&ch->std); in curl_progress()
682 ZVAL_OBJ(&argv[0], &ch->std); in curl_progress()
696 ch->in_callback = 1; in curl_progress()
698 ch->in_callback = 0; in curl_progress()
702 _php_curl_verify_handlers(ch, /* reporterror */ true); in curl_progress()
715 php_curl *ch = (php_curl *)clientp; in curl_xferinfo() local
716 php_curl_callback *t = ch->handlers.xferinfo; in curl_xferinfo()
729 GC_ADDREF(&ch->std); in curl_xferinfo()
730 ZVAL_OBJ(&argv[0], &ch->std); in curl_xferinfo()
744 ch->in_callback = 1; in curl_xferinfo()
746 ch->in_callback = 0; in curl_xferinfo()
750 _php_curl_verify_handlers(ch, /* reporterror */ true); in curl_xferinfo()
763 php_curl *ch = (php_curl *)clientp; in curl_ssh_hostkeyfunction() local
764 php_curl_callback *t = ch->handlers.sshhostkey; in curl_ssh_hostkeyfunction()
777 GC_ADDREF(&ch->std); in curl_ssh_hostkeyfunction()
778 ZVAL_OBJ(&argv[0], &ch->std); in curl_ssh_hostkeyfunction()
791 ch->in_callback = 1; in curl_ssh_hostkeyfunction()
793 ch->in_callback = 0; in curl_ssh_hostkeyfunction()
797 _php_curl_verify_handlers(ch, /* reporterror */ true); in curl_ssh_hostkeyfunction()
818 php_curl *ch = (php_curl *)ctx; in curl_read() local
819 php_curl_read *t = ch->handlers.read; in curl_read()
834 GC_ADDREF(&ch->std); in curl_read()
835 ZVAL_OBJ(&argv[0], &ch->std); in curl_read()
852 ch->in_callback = 1; in curl_read()
854 ch->in_callback = 0; in curl_read()
859 _php_curl_verify_handlers(ch, /* reporterror */ true); in curl_read()
882 php_curl *ch = (php_curl *) ctx; in curl_write_header() local
883 php_curl_write *t = ch->handlers.write_header; in curl_write_header()
890 if (ch->handlers.write->method == PHP_CURL_RETURN && length > 0) { in curl_write_header()
891 smart_str_appendl(&ch->handlers.write->buf, data, (int) length); in curl_write_header()
904 GC_ADDREF(&ch->std); in curl_write_header()
905 ZVAL_OBJ(&argv[0], &ch->std); in curl_write_header()
916 ch->in_callback = 1; in curl_write_header()
918 ch->in_callback = 0; in curl_write_header()
923 _php_curl_verify_handlers(ch, /* reporterror */ true); in curl_write_header()
944 php_curl *ch = (php_curl *)ctx; in curl_debug() local
947 if (ch->header.str) { in curl_debug()
948 zend_string_release_ex(ch->header.str, 0); in curl_debug()
950 ch->header.str = zend_string_init(buf, buf_len, 0); in curl_debug()
1104 php_curl *ch; in init_curl_handle_into_zval() local
1107 ch = Z_CURL_P(curl); in init_curl_handle_into_zval()
1109 init_curl_handle(ch); in init_curl_handle_into_zval()
1111 return ch; in init_curl_handle_into_zval()
1114 void init_curl_handle(php_curl *ch) in init_curl_handle() argument
1116 ch->to_free = ecalloc(1, sizeof(struct _php_curl_free)); in init_curl_handle()
1117 ch->handlers.write = ecalloc(1, sizeof(php_curl_write)); in init_curl_handle()
1118 ch->handlers.write_header = ecalloc(1, sizeof(php_curl_write)); in init_curl_handle()
1119 ch->handlers.read = ecalloc(1, sizeof(php_curl_read)); in init_curl_handle()
1120 ch->handlers.progress = NULL; in init_curl_handle()
1121 ch->handlers.xferinfo = NULL; in init_curl_handle()
1122 ch->handlers.fnmatch = NULL; in init_curl_handle()
1124 ch->handlers.sshhostkey = NULL; in init_curl_handle()
1126 ch->clone = emalloc(sizeof(uint32_t)); in init_curl_handle()
1127 *ch->clone = 1; in init_curl_handle()
1129 memset(&ch->err, 0, sizeof(struct _php_curl_error)); in init_curl_handle()
1131 …zend_llist_init(&ch->to_free->post, sizeof(struct HttpPost *), (llist_dtor_func_t)curl_free_post,… in init_curl_handle()
1132 …zend_llist_init(&ch->to_free->stream, sizeof(struct mime_data_cb_arg *), (llist_dtor_func_t)curl_f… in init_curl_handle()
1134 ch->to_free->slist = emalloc(sizeof(HashTable)); in init_curl_handle()
1135 zend_hash_init(ch->to_free->slist, 4, NULL, curl_free_slist, 0); in init_curl_handle()
1136 ZVAL_UNDEF(&ch->postfields); in init_curl_handle()
1176 static void _php_curl_set_default_options(php_curl *ch) in _php_curl_set_default_options() argument
1180 curl_easy_setopt(ch->cp, CURLOPT_NOPROGRESS, 1); in _php_curl_set_default_options()
1181 curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0); in _php_curl_set_default_options()
1182 curl_easy_setopt(ch->cp, CURLOPT_ERRORBUFFER, ch->err.str); in _php_curl_set_default_options()
1183 curl_easy_setopt(ch->cp, CURLOPT_WRITEFUNCTION, curl_write); in _php_curl_set_default_options()
1184 curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch); in _php_curl_set_default_options()
1185 curl_easy_setopt(ch->cp, CURLOPT_READFUNCTION, curl_read); in _php_curl_set_default_options()
1186 curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch); in _php_curl_set_default_options()
1187 curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_header); in _php_curl_set_default_options()
1188 curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch); in _php_curl_set_default_options()
1190 curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1); in _php_curl_set_default_options()
1192 curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120); in _php_curl_set_default_options()
1193 curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */ in _php_curl_set_default_options()
1200 curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo); in _php_curl_set_default_options()
1204 curl_easy_setopt(ch->cp, CURLOPT_NOSIGNAL, 1); in _php_curl_set_default_options()
1212 php_curl *ch; in PHP_FUNCTION() local
1227 ch = init_curl_handle_into_zval(return_value); in PHP_FUNCTION()
1229 ch->cp = cp; in PHP_FUNCTION()
1231 ch->handlers.write->method = PHP_CURL_STDOUT; in PHP_FUNCTION()
1232 ch->handlers.read->method = PHP_CURL_DIRECT; in PHP_FUNCTION()
1233 ch->handlers.write_header->method = PHP_CURL_IGNORE; in PHP_FUNCTION()
1235 _php_curl_set_default_options(ch); in PHP_FUNCTION()
1238 if (php_curl_option_url(ch, url) == FAILURE) { in PHP_FUNCTION()
1246 static void _php_copy_callback(php_curl *ch, php_curl_callback **new_callback, php_curl_callback *s… in _php_copy_callback() argument
1253 curl_easy_setopt(ch->cp, option, (void *) ch); in _php_copy_callback()
1257 void _php_setup_easy_copy_handlers(php_curl *ch, php_curl *source) in _php_setup_easy_copy_handlers() argument
1262 ch->handlers.write->stream = source->handlers.write->stream; in _php_setup_easy_copy_handlers()
1263 ch->handlers.write->method = source->handlers.write->method; in _php_setup_easy_copy_handlers()
1267 ch->handlers.read->stream = source->handlers.read->stream; in _php_setup_easy_copy_handlers()
1268 ch->handlers.read->method = source->handlers.read->method; in _php_setup_easy_copy_handlers()
1269 ch->handlers.write_header->method = source->handlers.write_header->method; in _php_setup_easy_copy_handlers()
1273 ch->handlers.write_header->stream = source->handlers.write_header->stream; in _php_setup_easy_copy_handlers()
1275 ch->handlers.write->fp = source->handlers.write->fp; in _php_setup_easy_copy_handlers()
1276 ch->handlers.write_header->fp = source->handlers.write_header->fp; in _php_setup_easy_copy_handlers()
1277 ch->handlers.read->fp = source->handlers.read->fp; in _php_setup_easy_copy_handlers()
1278 ch->handlers.read->res = source->handlers.read->res; in _php_setup_easy_copy_handlers()
1281 ZVAL_COPY(&ch->handlers.write->func_name, &source->handlers.write->func_name); in _php_setup_easy_copy_handlers()
1284 ZVAL_COPY(&ch->handlers.read->func_name, &source->handlers.read->func_name); in _php_setup_easy_copy_handlers()
1287 ZVAL_COPY(&ch->handlers.write_header->func_name, &source->handlers.write_header->func_name); in _php_setup_easy_copy_handlers()
1290 curl_easy_setopt(ch->cp, CURLOPT_ERRORBUFFER, ch->err.str); in _php_setup_easy_copy_handlers()
1291 curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch); in _php_setup_easy_copy_handlers()
1292 curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch); in _php_setup_easy_copy_handlers()
1293 curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch); in _php_setup_easy_copy_handlers()
1294 curl_easy_setopt(ch->cp, CURLOPT_DEBUGDATA, (void *) ch); in _php_setup_easy_copy_handlers()
1296 _php_copy_callback(ch, &ch->handlers.progress, source->handlers.progress, CURLOPT_PROGRESSDATA); in _php_setup_easy_copy_handlers()
1297 _php_copy_callback(ch, &ch->handlers.xferinfo, source->handlers.xferinfo, CURLOPT_XFERINFODATA); in _php_setup_easy_copy_handlers()
1298 _php_copy_callback(ch, &ch->handlers.fnmatch, source->handlers.fnmatch, CURLOPT_FNMATCH_DATA); in _php_setup_easy_copy_handlers()
1300 …_php_copy_callback(ch, &ch->handlers.sshhostkey, source->handlers.sshhostkey, CURLOPT_SSH_HOSTKEYD… in _php_setup_easy_copy_handlers()
1303 ZVAL_COPY(&ch->private_data, &source->private_data); in _php_setup_easy_copy_handlers()
1305 efree(ch->to_free->slist); in _php_setup_easy_copy_handlers()
1306 efree(ch->to_free); in _php_setup_easy_copy_handlers()
1307 ch->to_free = source->to_free; in _php_setup_easy_copy_handlers()
1308 efree(ch->clone); in _php_setup_easy_copy_handlers()
1309 ch->clone = source->clone; in _php_setup_easy_copy_handlers()
1384 static inline zend_result build_mime_structure_from_hash(php_curl *ch, zval *zpostfields) /* {{{ */ in build_mime_structure_from_hash() argument
1396 mime = curl_mime_init(ch->cp); in build_mime_structure_from_hash()
1445 zval_ptr_dtor(&ch->postfields); in build_mime_structure_from_hash()
1446 ZVAL_COPY(&ch->postfields, zpostfields); in build_mime_structure_from_hash()
1471 zend_llist_add_element(&ch->to_free->stream, &cb_arg); in build_mime_structure_from_hash()
1513 zval_ptr_dtor(&ch->postfields); in build_mime_structure_from_hash()
1514 ZVAL_COPY(&ch->postfields, zpostfields); in build_mime_structure_from_hash()
1548 SAVE_CURL_ERROR(ch, error); in build_mime_structure_from_hash()
1553 if ((*ch->clone) == 1) { in build_mime_structure_from_hash()
1554 zend_llist_clean(&ch->to_free->post); in build_mime_structure_from_hash()
1556 zend_llist_add_element(&ch->to_free->post, &mime); in build_mime_structure_from_hash()
1557 error = curl_easy_setopt(ch->cp, CURLOPT_MIMEPOST, mime); in build_mime_structure_from_hash()
1559 SAVE_CURL_ERROR(ch, error); in build_mime_structure_from_hash()
1567 php_curl *ch; in PHP_FUNCTION() local
1577 ch = Z_CURL_P(zid); in PHP_FUNCTION()
1579 cp = curl_easy_duphandle(ch->cp); in PHP_FUNCTION()
1588 _php_setup_easy_copy_handlers(dupch, ch); in PHP_FUNCTION()
1590 postfields = &ch->postfields; in PHP_FUNCTION()
1601 static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue, bool is_array_con… in _php_curl_setopt() argument
1612 error = curl_easy_setopt(ch->cp, option, 2); in _php_curl_setopt()
1774 error = curl_easy_setopt(ch->cp, option, lval); in _php_curl_setopt()
1874 zend_result ret = php_curl_option_str(ch, option, ZSTR_VAL(str), ZSTR_LEN(str)); in _php_curl_setopt()
1900 error = curl_easy_setopt(ch->cp, option, NULL); in _php_curl_setopt()
1904 zend_result ret = php_curl_option_str(ch, option, ZSTR_VAL(str), ZSTR_LEN(str)); in _php_curl_setopt()
1914 zval_ptr_dtor(&ch->private_data); in _php_curl_setopt()
1915 ZVAL_COPY(&ch->private_data, zvalue); in _php_curl_setopt()
1924 zend_result ret = php_curl_option_url(ch, str); in _php_curl_setopt()
1956 if (!Z_ISUNDEF(ch->handlers.write->stream)) { in _php_curl_setopt()
1957 zval_ptr_dtor(&ch->handlers.write->stream); in _php_curl_setopt()
1958 ZVAL_UNDEF(&ch->handlers.write->stream); in _php_curl_setopt()
1960 ch->handlers.write->fp = NULL; in _php_curl_setopt()
1961 ch->handlers.write->method = PHP_CURL_STDOUT; in _php_curl_setopt()
1963 zval_ptr_dtor(&ch->handlers.write->stream); in _php_curl_setopt()
1964 ch->handlers.write->fp = fp; in _php_curl_setopt()
1965 ch->handlers.write->method = PHP_CURL_FILE; in _php_curl_setopt()
1966 ZVAL_COPY(&ch->handlers.write->stream, zvalue); in _php_curl_setopt()
1974 if (!Z_ISUNDEF(ch->handlers.write_header->stream)) { in _php_curl_setopt()
1975 zval_ptr_dtor(&ch->handlers.write_header->stream); in _php_curl_setopt()
1976 ZVAL_UNDEF(&ch->handlers.write_header->stream); in _php_curl_setopt()
1978 ch->handlers.write_header->fp = NULL; in _php_curl_setopt()
1979 ch->handlers.write_header->method = PHP_CURL_IGNORE; in _php_curl_setopt()
1981 zval_ptr_dtor(&ch->handlers.write_header->stream); in _php_curl_setopt()
1982 ch->handlers.write_header->fp = fp; in _php_curl_setopt()
1983 ch->handlers.write_header->method = PHP_CURL_FILE; in _php_curl_setopt()
1984 ZVAL_COPY(&ch->handlers.write_header->stream, zvalue); in _php_curl_setopt()
1992 if (!Z_ISUNDEF(ch->handlers.read->stream)) { in _php_curl_setopt()
1993 zval_ptr_dtor(&ch->handlers.read->stream); in _php_curl_setopt()
1994 ZVAL_UNDEF(&ch->handlers.read->stream); in _php_curl_setopt()
1996 ch->handlers.read->fp = NULL; in _php_curl_setopt()
1997 ch->handlers.read->res = NULL; in _php_curl_setopt()
1999 zval_ptr_dtor(&ch->handlers.read->stream); in _php_curl_setopt()
2000 ch->handlers.read->fp = fp; in _php_curl_setopt()
2001 ch->handlers.read->res = Z_RES_P(zvalue); in _php_curl_setopt()
2002 ZVAL_COPY(&ch->handlers.read->stream, zvalue); in _php_curl_setopt()
2007 if (!Z_ISUNDEF(ch->handlers.std_err)) { in _php_curl_setopt()
2008 zval_ptr_dtor(&ch->handlers.std_err); in _php_curl_setopt()
2009 ZVAL_UNDEF(&ch->handlers.std_err); in _php_curl_setopt()
2012 zval_ptr_dtor(&ch->handlers.std_err); in _php_curl_setopt()
2013 ZVAL_COPY(&ch->handlers.std_err, zvalue); in _php_curl_setopt()
2020 error = curl_easy_setopt(ch->cp, option, fp); in _php_curl_setopt()
2095 if ((*ch->clone) == 1) { in _php_curl_setopt()
2096 zend_hash_index_update_ptr(ch->to_free->slist, option, slist); in _php_curl_setopt()
2098 zend_hash_next_index_insert_ptr(ch->to_free->slist, slist); in _php_curl_setopt()
2102 error = curl_easy_setopt(ch->cp, option, slist); in _php_curl_setopt()
2113 error = curl_easy_setopt(ch->cp, option, lval); in _php_curl_setopt()
2117 if (!Z_ISUNDEF(ch->handlers.write_header->func_name)) { in _php_curl_setopt()
2118 zval_ptr_dtor(&ch->handlers.write_header->func_name); in _php_curl_setopt()
2119 ch->handlers.write_header->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2121 ZVAL_COPY(&ch->handlers.write_header->func_name, zvalue); in _php_curl_setopt()
2122 ch->handlers.write_header->method = PHP_CURL_USER; in _php_curl_setopt()
2130 curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, ""); in _php_curl_setopt()
2131 error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, 0); in _php_curl_setopt()
2133 return build_mime_structure_from_hash(ch, zvalue); in _php_curl_setopt()
2139 error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, ZSTR_LEN(str)); in _php_curl_setopt()
2140 error = curl_easy_setopt(ch->cp, CURLOPT_COPYPOSTFIELDS, ZSTR_VAL(str)); in _php_curl_setopt()
2146 curl_easy_setopt(ch->cp, CURLOPT_PROGRESSFUNCTION, curl_progress); in _php_curl_setopt()
2147 curl_easy_setopt(ch->cp, CURLOPT_PROGRESSDATA, ch); in _php_curl_setopt()
2148 if (ch->handlers.progress == NULL) { in _php_curl_setopt()
2149 ch->handlers.progress = ecalloc(1, sizeof(php_curl_callback)); in _php_curl_setopt()
2150 } else if (!Z_ISUNDEF(ch->handlers.progress->func_name)) { in _php_curl_setopt()
2151 zval_ptr_dtor(&ch->handlers.progress->func_name); in _php_curl_setopt()
2152 ch->handlers.progress->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2154 ZVAL_COPY(&ch->handlers.progress->func_name, zvalue); in _php_curl_setopt()
2159 curl_easy_setopt(ch->cp, CURLOPT_SSH_HOSTKEYFUNCTION, curl_ssh_hostkeyfunction); in _php_curl_setopt()
2160 curl_easy_setopt(ch->cp, CURLOPT_SSH_HOSTKEYDATA, ch); in _php_curl_setopt()
2161 if (ch->handlers.sshhostkey == NULL) { in _php_curl_setopt()
2162 ch->handlers.sshhostkey = ecalloc(1, sizeof(php_curl_callback)); in _php_curl_setopt()
2163 } else if (!Z_ISUNDEF(ch->handlers.sshhostkey->func_name)) { in _php_curl_setopt()
2164 zval_ptr_dtor(&ch->handlers.sshhostkey->func_name); in _php_curl_setopt()
2165 ch->handlers.sshhostkey->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2167 ZVAL_COPY(&ch->handlers.sshhostkey->func_name, zvalue); in _php_curl_setopt()
2172 if (!Z_ISUNDEF(ch->handlers.read->func_name)) { in _php_curl_setopt()
2173 zval_ptr_dtor(&ch->handlers.read->func_name); in _php_curl_setopt()
2174 ch->handlers.read->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2176 ZVAL_COPY(&ch->handlers.read->func_name, zvalue); in _php_curl_setopt()
2177 ch->handlers.read->method = PHP_CURL_USER; in _php_curl_setopt()
2182 ch->handlers.write->method = PHP_CURL_RETURN; in _php_curl_setopt()
2184 ch->handlers.write->method = PHP_CURL_STDOUT; in _php_curl_setopt()
2189 if (!Z_ISUNDEF(ch->handlers.write->func_name)) { in _php_curl_setopt()
2190 zval_ptr_dtor(&ch->handlers.write->func_name); in _php_curl_setopt()
2191 ch->handlers.write->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2193 ZVAL_COPY(&ch->handlers.write->func_name, zvalue); in _php_curl_setopt()
2194 ch->handlers.write->method = PHP_CURL_USER; in _php_curl_setopt()
2198 curl_easy_setopt(ch->cp, CURLOPT_XFERINFOFUNCTION, curl_xferinfo); in _php_curl_setopt()
2199 curl_easy_setopt(ch->cp, CURLOPT_XFERINFODATA, ch); in _php_curl_setopt()
2200 if (ch->handlers.xferinfo == NULL) { in _php_curl_setopt()
2201 ch->handlers.xferinfo = ecalloc(1, sizeof(php_curl_callback)); in _php_curl_setopt()
2202 } else if (!Z_ISUNDEF(ch->handlers.xferinfo->func_name)) { in _php_curl_setopt()
2203 zval_ptr_dtor(&ch->handlers.xferinfo->func_name); in _php_curl_setopt()
2204 ch->handlers.xferinfo->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2206 ZVAL_COPY(&ch->handlers.xferinfo->func_name, zvalue); in _php_curl_setopt()
2215 error = curl_easy_setopt(ch->cp, option, (curl_off_t)lval); in _php_curl_setopt()
2220 error = curl_easy_setopt(ch->cp, CURLOPT_POSTREDIR, lval & CURL_REDIR_POST_ALL); in _php_curl_setopt()
2246 ret = php_curl_option_str(ch, option, ZSTR_VAL(str), ZSTR_LEN(str)); in _php_curl_setopt()
2253 curl_easy_setopt(ch->cp, CURLOPT_DEBUGFUNCTION, curl_debug); in _php_curl_setopt()
2254 curl_easy_setopt(ch->cp, CURLOPT_DEBUGDATA, (void *)ch); in _php_curl_setopt()
2255 curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 1); in _php_curl_setopt()
2257 curl_easy_setopt(ch->cp, CURLOPT_DEBUGFUNCTION, NULL); in _php_curl_setopt()
2258 curl_easy_setopt(ch->cp, CURLOPT_DEBUGDATA, NULL); in _php_curl_setopt()
2259 curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0); in _php_curl_setopt()
2267 curl_easy_setopt(ch->cp, CURLOPT_SHARE, sh->share); in _php_curl_setopt()
2269 if (ch->share) { in _php_curl_setopt()
2270 OBJ_RELEASE(&ch->share->std); in _php_curl_setopt()
2273 ch->share = sh; in _php_curl_setopt()
2279 curl_easy_setopt(ch->cp, CURLOPT_FNMATCH_FUNCTION, curl_fnmatch); in _php_curl_setopt()
2280 curl_easy_setopt(ch->cp, CURLOPT_FNMATCH_DATA, ch); in _php_curl_setopt()
2281 if (ch->handlers.fnmatch == NULL) { in _php_curl_setopt()
2282 ch->handlers.fnmatch = ecalloc(1, sizeof(php_curl_callback)); in _php_curl_setopt()
2283 } else if (!Z_ISUNDEF(ch->handlers.fnmatch->func_name)) { in _php_curl_setopt()
2284 zval_ptr_dtor(&ch->handlers.fnmatch->func_name); in _php_curl_setopt()
2285 ch->handlers.fnmatch->fci_cache = empty_fcall_info_cache; in _php_curl_setopt()
2287 ZVAL_COPY(&ch->handlers.fnmatch->func_name, zvalue); in _php_curl_setopt()
2310 error = curl_easy_setopt(ch->cp, option, &stblob); in _php_curl_setopt()
2327 SAVE_CURL_ERROR(ch, error); in _php_curl_setopt()
2341 php_curl *ch; in PHP_FUNCTION() local
2349 ch = Z_CURL_P(zid); in PHP_FUNCTION()
2351 if (_php_curl_setopt(ch, options, zvalue, 0) == SUCCESS) { in PHP_FUNCTION()
2363 php_curl *ch; in PHP_FUNCTION() local
2372 ch = Z_CURL_P(zid); in PHP_FUNCTION()
2381 if (_php_curl_setopt(ch, (zend_long) option, entry, 1) == FAILURE) { in PHP_FUNCTION()
2392 void _php_curl_cleanup_handle(php_curl *ch) in _php_curl_cleanup_handle() argument
2394 smart_str_free(&ch->handlers.write->buf); in _php_curl_cleanup_handle()
2395 if (ch->header.str) { in _php_curl_cleanup_handle()
2396 zend_string_release_ex(ch->header.str, 0); in _php_curl_cleanup_handle()
2397 ch->header.str = NULL; in _php_curl_cleanup_handle()
2400 memset(ch->err.str, 0, CURL_ERROR_SIZE + 1); in _php_curl_cleanup_handle()
2401 ch->err.no = 0; in _php_curl_cleanup_handle()
2410 php_curl *ch; in PHP_FUNCTION() local
2416 ch = Z_CURL_P(zid); in PHP_FUNCTION()
2418 _php_curl_verify_handlers(ch, /* reporterror */ true); in PHP_FUNCTION()
2420 _php_curl_cleanup_handle(ch); in PHP_FUNCTION()
2422 error = curl_easy_perform(ch->cp); in PHP_FUNCTION()
2423 SAVE_CURL_ERROR(ch, error); in PHP_FUNCTION()
2426 smart_str_free(&ch->handlers.write->buf); in PHP_FUNCTION()
2430 if (!Z_ISUNDEF(ch->handlers.std_err)) { in PHP_FUNCTION()
2432 …stream = (php_stream*)zend_fetch_resource2_ex(&ch->handlers.std_err, NULL, php_file_le_stream(), p… in PHP_FUNCTION()
2438 if (ch->handlers.write->method == PHP_CURL_RETURN && ch->handlers.write->buf.s) { in PHP_FUNCTION()
2439 smart_str_0(&ch->handlers.write->buf); in PHP_FUNCTION()
2440 RETURN_STR_COPY(ch->handlers.write->buf.s); in PHP_FUNCTION()
2444 if (ch->handlers.write->method == PHP_CURL_FILE && ch->handlers.write->fp) { in PHP_FUNCTION()
2445 fflush(ch->handlers.write->fp); in PHP_FUNCTION()
2447 if (ch->handlers.write_header->method == PHP_CURL_FILE && ch->handlers.write_header->fp) { in PHP_FUNCTION()
2448 fflush(ch->handlers.write_header->fp); in PHP_FUNCTION()
2451 if (ch->handlers.write->method == PHP_CURL_RETURN) { in PHP_FUNCTION()
2463 php_curl *ch; in PHP_FUNCTION() local
2473 ch = Z_CURL_P(zid); in PHP_FUNCTION()
2489 if (curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_URL, &s_code) == CURLE_OK) { in PHP_FUNCTION()
2492 if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_TYPE, &s_code) == CURLE_OK) { in PHP_FUNCTION()
2501 if (curl_easy_getinfo(ch->cp, CURLINFO_HTTP_CODE, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2504 if (curl_easy_getinfo(ch->cp, CURLINFO_HEADER_SIZE, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2507 if (curl_easy_getinfo(ch->cp, CURLINFO_REQUEST_SIZE, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2510 if (curl_easy_getinfo(ch->cp, CURLINFO_FILETIME, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2513 if (curl_easy_getinfo(ch->cp, CURLINFO_SSL_VERIFYRESULT, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2516 if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_COUNT, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2519 if (curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2522 if (curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2525 if (curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2528 if (curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2531 if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_UPLOAD, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2534 if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_DOWNLOAD, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2537 if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_DOWNLOAD, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2540 if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_UPLOAD, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2543 if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2546 if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_UPLOAD, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2549 if (curl_easy_getinfo(ch->cp, CURLINFO_STARTTRANSFER_TIME, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2552 if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_TIME, &d_code) == CURLE_OK) { in PHP_FUNCTION()
2555 if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_URL, &s_code) == CURLE_OK) { in PHP_FUNCTION()
2558 if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_IP, &s_code) == CURLE_OK) { in PHP_FUNCTION()
2561 if (curl_easy_getinfo(ch->cp, CURLINFO_CERTINFO, &ci) == CURLE_OK) { in PHP_FUNCTION()
2566 if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_PORT, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2569 if (curl_easy_getinfo(ch->cp, CURLINFO_LOCAL_IP, &s_code) == CURLE_OK) { in PHP_FUNCTION()
2572 if (curl_easy_getinfo(ch->cp, CURLINFO_LOCAL_PORT, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2575 if (curl_easy_getinfo(ch->cp, CURLINFO_HTTP_VERSION, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2578 if (curl_easy_getinfo(ch->cp, CURLINFO_PROTOCOL, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2581 if (curl_easy_getinfo(ch->cp, CURLINFO_PROXY_SSL_VERIFYRESULT, &l_code) == CURLE_OK) { in PHP_FUNCTION()
2584 if (curl_easy_getinfo(ch->cp, CURLINFO_SCHEME, &s_code) == CURLE_OK) { in PHP_FUNCTION()
2587 if (curl_easy_getinfo(ch->cp, CURLINFO_APPCONNECT_TIME_T, &co) == CURLE_OK) { in PHP_FUNCTION()
2590 if (curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME_T, &co) == CURLE_OK) { in PHP_FUNCTION()
2593 if (curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME_T, &co) == CURLE_OK) { in PHP_FUNCTION()
2596 if (curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME_T, &co) == CURLE_OK) { in PHP_FUNCTION()
2599 if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_TIME_T, &co) == CURLE_OK) { in PHP_FUNCTION()
2602 if (curl_easy_getinfo(ch->cp, CURLINFO_STARTTRANSFER_TIME_T, &co) == CURLE_OK) { in PHP_FUNCTION()
2605 if (curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME_T, &co) == CURLE_OK) { in PHP_FUNCTION()
2608 if (ch->header.str) { in PHP_FUNCTION()
2609 CAASTR("request_header", ch->header.str); in PHP_FUNCTION()
2612 if (curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_METHOD, &s_code) == CURLE_OK) { in PHP_FUNCTION()
2617 if (curl_easy_getinfo(ch->cp, CURLINFO_CAPATH, &s_code) == CURLE_OK) { in PHP_FUNCTION()
2620 if (curl_easy_getinfo(ch->cp, CURLINFO_CAINFO, &s_code) == CURLE_OK) { in PHP_FUNCTION()
2627 if (ch->header.str) { in PHP_FUNCTION()
2628 RETURN_STR_COPY(ch->header.str); in PHP_FUNCTION()
2637 if (curl_easy_getinfo(ch->cp, CURLINFO_CERTINFO, &ci) == CURLE_OK) { in PHP_FUNCTION()
2645 if (!Z_ISUNDEF(ch->private_data)) { in PHP_FUNCTION()
2646 RETURN_COPY(&ch->private_data); in PHP_FUNCTION()
2658 if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) { in PHP_FUNCTION()
2669 if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) { in PHP_FUNCTION()
2680 if (curl_easy_getinfo(ch->cp, option, &code) == CURLE_OK) { in PHP_FUNCTION()
2690 if (curl_easy_getinfo(ch->cp, option, &slist) == CURLE_OK) { in PHP_FUNCTION()
2706 if (curl_easy_getinfo(ch->cp, option, &c_off) == CURLE_OK) { in PHP_FUNCTION()
2726 php_curl *ch; in PHP_FUNCTION() local
2732 ch = Z_CURL_P(zid); in PHP_FUNCTION()
2734 if (ch->err.no) { in PHP_FUNCTION()
2735 ch->err.str[CURL_ERROR_SIZE] = 0; in PHP_FUNCTION()
2736 RETURN_STRING(ch->err.str); in PHP_FUNCTION()
2747 php_curl *ch; in PHP_FUNCTION() local
2753 ch = Z_CURL_P(zid); in PHP_FUNCTION()
2755 RETURN_LONG(ch->err.no); in PHP_FUNCTION()
2763 php_curl *ch; in PHP_FUNCTION() local
2769 ch = Z_CURL_P(zid); in PHP_FUNCTION()
2771 if (ch->in_callback) { in PHP_FUNCTION()
2788 php_curl *ch = curl_from_obj(object); in curl_free_obj() local
2791 fprintf(stderr, "DTOR CALLED, ch = %x\n", ch); in curl_free_obj()
2794 if (!ch->cp) { in curl_free_obj()
2796 zend_object_std_dtor(&ch->std); in curl_free_obj()
2800 _php_curl_verify_handlers(ch, /* reporterror */ false); in curl_free_obj()
2813 curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_nothing); in curl_free_obj()
2814 curl_easy_setopt(ch->cp, CURLOPT_WRITEFUNCTION, curl_write_nothing); in curl_free_obj()
2816 curl_easy_cleanup(ch->cp); in curl_free_obj()
2819 if (--(*ch->clone) == 0) { in curl_free_obj()
2820 zend_llist_clean(&ch->to_free->post); in curl_free_obj()
2821 zend_llist_clean(&ch->to_free->stream); in curl_free_obj()
2823 zend_hash_destroy(ch->to_free->slist); in curl_free_obj()
2824 efree(ch->to_free->slist); in curl_free_obj()
2825 efree(ch->to_free); in curl_free_obj()
2826 efree(ch->clone); in curl_free_obj()
2829 smart_str_free(&ch->handlers.write->buf); in curl_free_obj()
2830 zval_ptr_dtor(&ch->handlers.write->func_name); in curl_free_obj()
2831 zval_ptr_dtor(&ch->handlers.read->func_name); in curl_free_obj()
2832 zval_ptr_dtor(&ch->handlers.write_header->func_name); in curl_free_obj()
2833 zval_ptr_dtor(&ch->handlers.std_err); in curl_free_obj()
2834 if (ch->header.str) { in curl_free_obj()
2835 zend_string_release_ex(ch->header.str, 0); in curl_free_obj()
2838 zval_ptr_dtor(&ch->handlers.write_header->stream); in curl_free_obj()
2839 zval_ptr_dtor(&ch->handlers.write->stream); in curl_free_obj()
2840 zval_ptr_dtor(&ch->handlers.read->stream); in curl_free_obj()
2842 efree(ch->handlers.write); in curl_free_obj()
2843 efree(ch->handlers.write_header); in curl_free_obj()
2844 efree(ch->handlers.read); in curl_free_obj()
2846 _php_curl_free_callback(ch->handlers.progress); in curl_free_obj()
2847 _php_curl_free_callback(ch->handlers.xferinfo); in curl_free_obj()
2848 _php_curl_free_callback(ch->handlers.fnmatch); in curl_free_obj()
2850 _php_curl_free_callback(ch->handlers.sshhostkey); in curl_free_obj()
2853 zval_ptr_dtor(&ch->postfields); in curl_free_obj()
2854 zval_ptr_dtor(&ch->private_data); in curl_free_obj()
2856 if (ch->share) { in curl_free_obj()
2857 OBJ_RELEASE(&ch->share->std); in curl_free_obj()
2860 zend_object_std_dtor(&ch->std); in curl_free_obj()
2885 static void _php_curl_reset_handlers(php_curl *ch) in _php_curl_reset_handlers() argument
2887 if (!Z_ISUNDEF(ch->handlers.write->stream)) { in _php_curl_reset_handlers()
2888 zval_ptr_dtor(&ch->handlers.write->stream); in _php_curl_reset_handlers()
2889 ZVAL_UNDEF(&ch->handlers.write->stream); in _php_curl_reset_handlers()
2891 ch->handlers.write->fp = NULL; in _php_curl_reset_handlers()
2892 ch->handlers.write->method = PHP_CURL_STDOUT; in _php_curl_reset_handlers()
2894 if (!Z_ISUNDEF(ch->handlers.write_header->stream)) { in _php_curl_reset_handlers()
2895 zval_ptr_dtor(&ch->handlers.write_header->stream); in _php_curl_reset_handlers()
2896 ZVAL_UNDEF(&ch->handlers.write_header->stream); in _php_curl_reset_handlers()
2898 ch->handlers.write_header->fp = NULL; in _php_curl_reset_handlers()
2899 ch->handlers.write_header->method = PHP_CURL_IGNORE; in _php_curl_reset_handlers()
2901 if (!Z_ISUNDEF(ch->handlers.read->stream)) { in _php_curl_reset_handlers()
2902 zval_ptr_dtor(&ch->handlers.read->stream); in _php_curl_reset_handlers()
2903 ZVAL_UNDEF(&ch->handlers.read->stream); in _php_curl_reset_handlers()
2905 ch->handlers.read->fp = NULL; in _php_curl_reset_handlers()
2906 ch->handlers.read->res = NULL; in _php_curl_reset_handlers()
2907 ch->handlers.read->method = PHP_CURL_DIRECT; in _php_curl_reset_handlers()
2909 if (!Z_ISUNDEF(ch->handlers.std_err)) { in _php_curl_reset_handlers()
2910 zval_ptr_dtor(&ch->handlers.std_err); in _php_curl_reset_handlers()
2911 ZVAL_UNDEF(&ch->handlers.std_err); in _php_curl_reset_handlers()
2914 if (ch->handlers.progress) { in _php_curl_reset_handlers()
2915 zval_ptr_dtor(&ch->handlers.progress->func_name); in _php_curl_reset_handlers()
2916 efree(ch->handlers.progress); in _php_curl_reset_handlers()
2917 ch->handlers.progress = NULL; in _php_curl_reset_handlers()
2920 if (ch->handlers.xferinfo) { in _php_curl_reset_handlers()
2921 zval_ptr_dtor(&ch->handlers.xferinfo->func_name); in _php_curl_reset_handlers()
2922 efree(ch->handlers.xferinfo); in _php_curl_reset_handlers()
2923 ch->handlers.xferinfo = NULL; in _php_curl_reset_handlers()
2926 if (ch->handlers.fnmatch) { in _php_curl_reset_handlers()
2927 zval_ptr_dtor(&ch->handlers.fnmatch->func_name); in _php_curl_reset_handlers()
2928 efree(ch->handlers.fnmatch); in _php_curl_reset_handlers()
2929 ch->handlers.fnmatch = NULL; in _php_curl_reset_handlers()
2933 if (ch->handlers.sshhostkey) { in _php_curl_reset_handlers()
2934 zval_ptr_dtor(&ch->handlers.sshhostkey->func_name); in _php_curl_reset_handlers()
2935 efree(ch->handlers.sshhostkey); in _php_curl_reset_handlers()
2936 ch->handlers.sshhostkey = NULL; in _php_curl_reset_handlers()
2946 php_curl *ch; in PHP_FUNCTION() local
2952 ch = Z_CURL_P(zid); in PHP_FUNCTION()
2954 if (ch->in_callback) { in PHP_FUNCTION()
2959 curl_easy_reset(ch->cp); in PHP_FUNCTION()
2960 _php_curl_reset_handlers(ch); in PHP_FUNCTION()
2961 _php_curl_set_default_options(ch); in PHP_FUNCTION()
2971 php_curl *ch; in PHP_FUNCTION() local
2978 ch = Z_CURL_P(zid); in PHP_FUNCTION()
2984 if ((res = curl_easy_escape(ch->cp, ZSTR_VAL(str), ZSTR_LEN(str)))) { in PHP_FUNCTION()
3000 php_curl *ch; in PHP_FUNCTION() local
3007 ch = Z_CURL_P(zid); in PHP_FUNCTION()
3013 if ((out = curl_easy_unescape(ch->cp, ZSTR_VAL(str), ZSTR_LEN(str), &out_len))) { in PHP_FUNCTION()
3027 php_curl *ch; in PHP_FUNCTION() local
3034 ch = Z_CURL_P(zid); in PHP_FUNCTION()
3036 RETURN_LONG(curl_easy_pause(ch->cp, bitmask)); in PHP_FUNCTION()
3046 php_curl *ch; in PHP_FUNCTION() local
3052 ch = Z_CURL_P(zid); in PHP_FUNCTION()
3054 error = curl_easy_upkeep(ch->cp); in PHP_FUNCTION()
3055 SAVE_CURL_ERROR(ch, error); in PHP_FUNCTION()