• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/curl-7.23.1/source/lib/

Lines Matching refs:multi

135      this multi handle with an easy handle. Set this to CURL_MULTI_HANDLE. */
163 /* Whether pipelining is enabled for this multi handle */
181 static void multi_connc_remove_handle(struct Curl_multi *multi,
183 static void singlesocket(struct Curl_multi *multi,
185 static CURLMcode add_closure(struct Curl_multi *multi,
187 static int update_timer(struct Curl_multi *multi);
199 struct Curl_multi *multi,
254 easy->easy_handle->multi->num_alive--;
371 * the list kept in the multi handle.
373 static CURLMcode multi_addmsg(struct Curl_multi *multi,
376 if(!Curl_llist_insert_next(multi->msglist, multi->msglist->tail, msg))
396 struct Curl_multi *multi = calloc(1, sizeof(struct Curl_multi));
398 if(!multi)
401 multi->type = CURL_MULTI_HANDLE;
403 multi->hostcache = Curl_mk_dnscache();
404 if(!multi->hostcache)
407 multi->sockhash = sh_init();
408 if(!multi->sockhash)
411 multi->connc = Curl_mk_connc(CONNCACHE_MULTI, -1L);
412 if(!multi->connc)
415 multi->msglist = Curl_llist_alloc(multi_freeamsg);
416 if(!multi->msglist)
422 multi->easy.next = &multi->easy;
423 multi->easy.prev = &multi->easy;
425 return (CURLM *) multi;
429 Curl_hash_destroy(multi->sockhash);
430 multi->sockhash = NULL;
431 Curl_hash_destroy(multi->hostcache);
432 multi->hostcache = NULL;
433 Curl_rm_connc(multi->connc);
434 multi->connc = NULL;
436 free(multi);
447 struct Curl_multi *multi = (struct Curl_multi *)multi_handle;
451 if(!GOOD_MULTI_HANDLE(multi))
459 once and prevent adding to more than one multi stack */
460 if(data->multi)
467 if(((multi->num_easy + 1) * 4) > multi->connc->num) {
468 long newmax = (multi->num_easy + 1) * 4;
470 if(multi->maxconnects && (newmax > multi->maxconnects))
472 newmax = multi->maxconnects;
474 if(newmax > multi->connc->num) {
476 CURLcode res = Curl_ch_connc(data, multi->connc, newmax);
497 ** no modification of easy nor multi handle allowed before this
498 ** except for potential multi's connection cache growing which
507 cl = multi->closure;
516 multi->closure = next;
534 /* for multi interface connections, we share DNS cache automatically if the
545 easy->easy_handle->dns.hostcache = multi->hostcache;
549 /* On a multi stack the connection cache, owned by the multi handle,
550 is shared between all easy handles within the multi handle. */
557 /* Point now to this multi's connection cache */
558 easy->easy_handle->state.connc = multi->connc;
567 easy->next = &multi->easy;
568 easy->prev = multi->easy.prev;
571 multi->easy.prev = easy;
577 /* make the SessionHandle refer back to this multi handle */
592 multi->num_easy++;
595 multi->num_alive++;
607 memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall));
609 update_timer(multi);
616 * Curl_hash_print(multi->sockhash, debug_print_sock_hash);
632 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
637 if(!GOOD_MULTI_HANDLE(multi))
658 multi->num_alive--;
674 /* The timer must be shut down before easy->multi is set to NULL,
716 multi_connc_remove_handle(multi, easy->easy_handle);
731 is within the multi handle and that owns the connections so we should
744 singlesocket(multi, easy); /* to let the application know what sockets
748 to this multi handle */
755 for(e = multi->msglist->head; e; e = e->next) {
759 Curl_llist_remove(multi->msglist, e, NULL);
782 multi->num_easy--; /* one less to care about now */
784 update_timer(multi);
791 bool Curl_multi_canPipeline(const struct Curl_multi* multi)
793 return multi->pipelining_enabled;
901 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
909 if(!GOOD_MULTI_HANDLE(multi))
912 easy=multi->easy.next;
913 while(easy != &multi->easy) {
944 static CURLMcode multi_runsingle(struct Curl_multi *multi,
1065 multistate(easy, multi->pipelining_enabled?
1092 singlesocket(multi, easy);
1107 multistate(easy, multi->pipelining_enabled?
1188 multistate(easy, multi->pipelining_enabled?
1201 multistate(easy, multi->pipelining_enabled?
1695 result = multi_addmsg(multi, msg);
1706 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
1712 if(!GOOD_MULTI_HANDLE(multi))
1715 easy=multi->easy.next;
1716 while(easy != &multi->easy) {
1729 result = multi_runsingle(multi, now, easy);
1755 multi->timetree = Curl_splaygetbest(now, multi->timetree, &t);
1758 (void)add_next_timeout(now, multi, t->payload);
1762 *running_handles = multi->num_alive;
1765 update_timer(multi);
1772 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
1779 if(GOOD_MULTI_HANDLE(multi)) {
1780 multi->type = 0; /* not good anymore */
1783 for(i=0; i< multi->connc->num; i++) {
1784 if(multi->connc->connects[i] &&
1785 multi->connc->connects[i]->handler->flags & PROTOPT_CLOSEACTION) {
1786 Curl_disconnect(multi->connc->connects[i], FALSE);
1787 multi->connc->connects[i] = NULL;
1792 cl = multi->closure;
1804 Curl_hash_destroy(multi->hostcache);
1805 multi->hostcache = NULL;
1807 Curl_hash_destroy(multi->sockhash);
1808 multi->sockhash = NULL;
1810 Curl_rm_connc(multi->connc);
1811 multi->connc = NULL;
1814 Curl_llist_destroy(multi->msglist, NULL);
1815 multi->msglist = NULL;
1818 easy = multi->easy.next;
1819 while(easy != &multi->easy) {
1836 free(multi);
1847 * This function is the primary way for a multi/multi_socket application to
1856 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
1861 if(GOOD_MULTI_HANDLE(multi) && Curl_llist_count(multi->msglist)) {
1866 e = multi->msglist->head;
1871 Curl_llist_remove(multi->msglist, e, NULL);
1873 *msgs_in_queue = curlx_uztosi(Curl_llist_count(multi->msglist));
1886 static void singlesocket(struct Curl_multi *multi,
1918 entry = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));
1933 entry = sh_addentry(multi->sockhash, s, easy->easy_handle);
1940 multi->socket_cb(easy->easy_handle,
1943 multi->socket_userp,
1968 entry = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));
2019 multi->socket_cb(easy->easy_handle,
2022 multi->socket_userp,
2024 sh_delentry(multi->sockhash, s);
2047 struct Curl_multi *multi,
2083 multi->timetree = Curl_splayinsert(*tv, multi->timetree,
2090 static CURLMcode multi_socket(struct Curl_multi *multi,
2104 result = curl_multi_perform(multi, running_handles);
2108 easyp=multi->easy.next;
2109 while(easyp != &multi->easy) {
2110 singlesocket(multi, easyp);
2120 Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));
2156 result = multi_runsingle(multi, now, data->set.one_easy);
2167 singlesocket(multi, data->set.one_easy);
2194 result = multi_runsingle(multi, now, data->set.one_easy);
2200 singlesocket(multi, data->set.one_easy);
2206 multi->timetree = Curl_splaygetbest(now, multi->timetree, &t);
2209 (void)add_next_timeout(now, multi, t->payload);
2214 *running_handles = multi->num_alive;
2222 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
2226 if(!GOOD_MULTI_HANDLE(multi))
2233 multi->socket_cb = va_arg(param, curl_socket_callback);
2236 multi->socket_userp = va_arg(param, void *);
2239 multi->pipelining_enabled = (0 != va_arg(param, long)) ? TRUE : FALSE;
2242 multi->timer_cb = va_arg(param, curl_multi_timer_callback);
2245 multi->timer_userp = va_arg(param, void *);
2248 multi->maxconnects = va_arg(param, long);
2258 /* we define curl_multi_socket() in the public multi.h header */
2291 static CURLMcode multi_timeout(struct Curl_multi *multi,
2296 if(multi->timetree) {
2301 multi->timetree = Curl_splay(tv_zero, multi->timetree);
2303 if(Curl_splaycomparekeys(multi->timetree->key, now) > 0) {
2305 *timeout_ms = curlx_tvdiff(multi->timetree->key, now);
2329 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
2332 if(!GOOD_MULTI_HANDLE(multi))
2335 return multi_timeout(multi, timeout_ms);
2342 static int update_timer(struct Curl_multi *multi)
2346 if(!multi->timer_cb)
2348 if(multi_timeout(multi, &timeout_ms)) {
2353 if(Curl_splaycomparekeys(none, multi->timer_lastcall)) {
2354 multi->timer_lastcall = none;
2357 return multi->timer_cb((CURLM*)multi, -1, multi->timer_userp);
2362 /* When multi_timeout() is done, multi->timetree points to the node with the
2366 if(Curl_splaycomparekeys(multi->timetree->key, multi->timer_lastcall) == 0)
2369 multi->timer_lastcall = multi->timetree->key;
2371 return multi->timer_cb((CURLM*)multi, timeout_ms, multi->timer_userp);
2580 struct Curl_multi *multi = data->multi;
2584 /* this is only interesting for multi-interface using libcurl, and only
2585 while there is still a multi interface struct remaining! */
2586 if(!multi)
2596 rc = Curl_splayremovebyaddr(multi->timetree,
2598 &multi->timetree);
2643 rc = Curl_splayremovebyaddr(multi->timetree,
2645 &multi->timetree);
2652 multi->timetree = Curl_splayinsert(*nowp,
2653 multi->timetree,
2657 Curl_splayprint(multi->timetree, 0, TRUE);
2665 struct Curl_multi *multi = (struct Curl_multi *)multi_handle;
2668 there = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(curl_socket_t));
2678 static void multi_connc_remove_handle(struct Curl_multi *multi,
2684 for(i=0; i< multi->connc->num; i++) {
2685 struct connectdata * conn = multi->connc->connects[i];
2708 if(add_closure(multi, data) == CURLM_OK)
2709 data->state.shared_conn = multi;
2713 multi->connc->connects[i] = NULL;
2731 static CURLMcode add_closure(struct Curl_multi *multi,
2734 struct closure *cl = multi->closure;
2746 for(i=0; i< multi->connc->num; i++) {
2747 if(multi->connc->connects[i] &&
2748 (multi->connc->connects[i]->data == cl->easy_handle)) {
2771 multi->closure = n;
2790 cl->next = multi->closure;
2791 multi->closure = cl;
2800 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
2804 multi->num_easy, multi->num_alive);
2805 for(easy=multi->easy.next; easy != &multi->easy; easy = easy->next) {
2814 Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));