Lines Matching refs:mh

58 	php_curlm *mh;  in PHP_FUNCTION()  local
64 mh = ecalloc(1, sizeof(php_curlm)); in PHP_FUNCTION()
65 mh->multi = curl_multi_init(); in PHP_FUNCTION()
66 mh->handlers = ecalloc(1, sizeof(php_curlm_handlers)); in PHP_FUNCTION()
68 zend_llist_init(&mh->easyh, sizeof(zval), _php_curl_multi_cleanup_list, 0); in PHP_FUNCTION()
70 RETURN_RES(zend_register_resource(mh, le_curl_multi_handle)); in PHP_FUNCTION()
80 php_curlm *mh; in PHP_FUNCTION() local
89 …if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi… in PHP_FUNCTION()
102 zend_llist_add_element(&mh->easyh, &tmp_val); in PHP_FUNCTION()
104 error = curl_multi_add_handle(mh->multi, ch->cp); in PHP_FUNCTION()
105 SAVE_CURLM_ERROR(mh, error); in PHP_FUNCTION()
140 static zval *_php_curl_multi_find_easy_handle(php_curlm *mh, CURL *easy) /* {{{ */ in _php_curl_multi_find_easy_handle() argument
146 for(pz_ch_temp = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch_temp; in _php_curl_multi_find_easy_handle()
147 pz_ch_temp = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) { in _php_curl_multi_find_easy_handle()
168 php_curlm *mh; in PHP_FUNCTION() local
176 …if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi… in PHP_FUNCTION()
184 error = curl_multi_remove_handle(mh->multi, ch->cp); in PHP_FUNCTION()
185 SAVE_CURLM_ERROR(mh, error); in PHP_FUNCTION()
188 zend_llist_del_element(&mh->easyh, z_ch, (int (*)(void *, void *))curl_compare_resources); in PHP_FUNCTION()
210 php_curlm *mh; in PHP_FUNCTION() local
227 …if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi… in PHP_FUNCTION()
232 error = curl_multi_wait(mh->multi, NULL, 0, (unsigned long) timeout * 1000.0, &numfds); in PHP_FUNCTION()
234 SAVE_CURLM_ERROR(mh, error); in PHP_FUNCTION()
246 error = curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd); in PHP_FUNCTION()
247 SAVE_CURLM_ERROR(mh, error); in PHP_FUNCTION()
263 php_curlm *mh; in PHP_FUNCTION() local
271 …if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi… in PHP_FUNCTION()
280 for (pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch; in PHP_FUNCTION()
281 pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) { in PHP_FUNCTION()
293 error = curl_multi_perform(mh->multi, &still_running); in PHP_FUNCTION()
296 SAVE_CURLM_ERROR(mh, error); in PHP_FUNCTION()
333 php_curlm *mh; in PHP_FUNCTION() local
342 …if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi… in PHP_FUNCTION()
346 tmp_msg = curl_multi_info_read(mh->multi, &queued_msgs); in PHP_FUNCTION()
361 zval *pz_ch = _php_curl_multi_find_easy_handle(mh, tmp_msg->easy_handle); in PHP_FUNCTION()
386 php_curlm *mh; in PHP_FUNCTION() local
392 …if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi… in PHP_FUNCTION()
402 php_curlm *mh = (php_curlm *)rsrc->ptr; in _php_curl_multi_close() local
403 if (mh) { in _php_curl_multi_close()
408 for (pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch; in _php_curl_multi_close()
409 pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) { in _php_curl_multi_close()
418 curl_multi_cleanup(mh->multi); in _php_curl_multi_close()
419 zend_llist_clean(&mh->easyh); in _php_curl_multi_close()
420 if (mh->handlers->server_push) { in _php_curl_multi_close()
421 efree(mh->handlers->server_push); in _php_curl_multi_close()
423 if (mh->handlers) { in _php_curl_multi_close()
424 efree(mh->handlers); in _php_curl_multi_close()
426 efree(mh); in _php_curl_multi_close()
437 php_curlm *mh; in PHP_FUNCTION() local
443 …if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi… in PHP_FUNCTION()
447 RETURN_LONG(mh->err.no); in PHP_FUNCTION()
479 php_curlm *mh = (php_curlm *)userp; in _php_server_push_callback() local
481 php_curlm_server_push *t = mh->handlers->server_push; in _php_server_push_callback()
491 pz_parent_ch = _php_curl_multi_find_easy_handle(mh, parent_ch); in _php_server_push_callback()
538 zend_llist_add_element(&mh->easyh, &tmp_val); in _php_server_push_callback()
551 static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue, zval *return_value… in _php_curl_multi_setopt() argument
569 error = curl_multi_setopt(mh->multi, option, zval_get_long(zvalue)); in _php_curl_multi_setopt()
573 if (mh->handlers->server_push == NULL) { in _php_curl_multi_setopt()
574 mh->handlers->server_push = ecalloc(1, sizeof(php_curlm_server_push)); in _php_curl_multi_setopt()
575 } else if (!Z_ISUNDEF(mh->handlers->server_push->func_name)) { in _php_curl_multi_setopt()
576 zval_ptr_dtor(&mh->handlers->server_push->func_name); in _php_curl_multi_setopt()
577 mh->handlers->server_push->fci_cache = empty_fcall_info_cache; in _php_curl_multi_setopt()
580 ZVAL_COPY(&mh->handlers->server_push->func_name, zvalue); in _php_curl_multi_setopt()
581 mh->handlers->server_push->method = PHP_CURL_USER; in _php_curl_multi_setopt()
582 if (!Z_ISUNDEF(mh->handlers->server_push->func_name)) { in _php_curl_multi_setopt()
583 zval_ptr_dtor(&mh->handlers->server_push->func_name); in _php_curl_multi_setopt()
584 mh->handlers->server_push->fci_cache = empty_fcall_info_cache; in _php_curl_multi_setopt()
587 error = curl_multi_setopt(mh->multi, option, _php_server_push_callback); in _php_curl_multi_setopt()
591 error = curl_multi_setopt(mh->multi, CURLMOPT_PUSHDATA, mh); in _php_curl_multi_setopt()
600 SAVE_CURLM_ERROR(mh, error); in _php_curl_multi_setopt()
615 php_curlm *mh; in PHP_FUNCTION() local
621 …if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi… in PHP_FUNCTION()
625 if (!_php_curl_multi_setopt(mh, options, zvalue, return_value)) { in PHP_FUNCTION()