• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/curl/curl-7.36.0/lib/

Lines Matching defs:multi

71 static void singlesocket(struct Curl_multi *multi,
73 static int update_timer(struct Curl_multi *multi);
78 struct Curl_multi *multi,
80 static CURLMcode multi_timeout(struct Curl_multi *multi,
140 data->multi->num_alive--;
263 * the list kept in the multi handle.
265 static CURLMcode multi_addmsg(struct Curl_multi *multi,
268 if(!Curl_llist_insert_next(multi->msglist, multi->msglist->tail, msg))
288 struct Curl_multi *multi = calloc(1, sizeof(struct Curl_multi));
290 if(!multi)
293 multi->type = CURL_MULTI_HANDLE;
295 multi->hostcache = Curl_mk_dnscache();
296 if(!multi->hostcache)
299 multi->sockhash = sh_init(hashsize);
300 if(!multi->sockhash)
303 multi->conn_cache = Curl_conncache_init(chashsize);
304 if(!multi->conn_cache)
307 multi->msglist = Curl_llist_alloc(multi_freeamsg);
308 if(!multi->msglist)
312 multi->closure_handle = curl_easy_init();
313 if(!multi->closure_handle)
316 multi->closure_handle->multi = multi;
317 multi->closure_handle->state.conn_cache = multi->conn_cache;
319 multi->max_pipeline_length = 5;
322 multi->maxconnects = -1;
323 return (CURLM *) multi;
327 Curl_hash_destroy(multi->sockhash);
328 multi->sockhash = NULL;
329 Curl_hash_destroy(multi->hostcache);
330 multi->hostcache = NULL;
331 Curl_conncache_destroy(multi->conn_cache);
332 multi->conn_cache = NULL;
333 Curl_close(multi->closure_handle);
334 multi->closure_handle = NULL;
335 Curl_llist_destroy(multi->msglist, NULL);
337 free(multi);
351 struct Curl_multi *multi = (struct Curl_multi *)multi_handle;
355 if(!GOOD_MULTI_HANDLE(multi))
363 adding to more than one multi stack */
364 if(data->multi)
374 * modification of easy nor multi handle allowed before this except for
375 * potential multi's connection cache growing which won't be undone in this
396 /* for multi interface connections, we share DNS cache automatically if the
400 data->dns.hostcache = multi->hostcache;
404 /* Point to the multi's connection cache */
405 data->state.conn_cache = multi->conn_cache;
414 if(multi->easyp) {
415 struct SessionHandle *last = multi->easylp;
418 multi->easylp = data; /* the new last node */
424 multi->easylp = multi->easyp = data; /* both first and last */
427 /* make the SessionHandle refer back to this multi handle */
428 data->multi = multi_handle;
439 multi->num_easy++;
442 multi->num_alive++;
454 memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall));
456 update_timer(multi);
463 * Curl_hash_print(multi->sockhash, debug_print_sock_hash);
479 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
484 if(!GOOD_MULTI_HANDLE(multi))
492 if(!data->multi)
506 multi->num_alive--;
522 /* The timer must be shut down before data->multi is set to NULL,
534 /* stop using the multi handle's DNS cache */
560 to that since we're not part of that multi handle anymore */
566 singlesocket(multi, easy); /* to let the application know what sockets
575 data->multi = NULL; /* clear the association to this multi handle */
582 for(e = multi->msglist->head; e; e = e->next) {
586 Curl_llist_remove(multi->msglist, e, NULL);
597 multi->easyp = data->next; /* point to first node */
603 multi->easylp = data->prev; /* point to last node */
608 multi->num_easy--; /* one less to care about now */
610 update_timer(multi);
617 bool Curl_multi_pipeline_enabled(const struct Curl_multi *multi)
619 return (multi && multi->pipelining_enabled) ? TRUE : FALSE;
735 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
743 if(!GOOD_MULTI_HANDLE(multi))
746 data=multi->easyp;
784 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
794 if(!GOOD_MULTI_HANDLE(multi))
800 (void)multi_timeout(multi, &timeout_internal);
804 /* Count up how many fds we have from the multi handle */
805 data=multi->easyp;
843 data=multi->easyp;
918 static CURLMcode multi_runsingle(struct Curl_multi *multi,
1065 multistate(data, multi->pipelining_enabled?
1094 singlesocket(multi, data);
1110 multistate(data, multi->pipelining_enabled?
1191 multistate(data, multi->pipelining_enabled?
1204 multistate(data, multi->pipelining_enabled?
1398 Curl_multi_process_pending_handles(multi);
1544 Curl_multi_process_pending_handles(multi);
1607 Curl_multi_process_pending_handles(multi);
1681 Curl_multi_process_pending_handles(multi);
1723 result = multi_addmsg(multi, msg);
1734 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
1740 if(!GOOD_MULTI_HANDLE(multi))
1743 data=multi->easyp;
1759 result = multi_runsingle(multi, now, data);
1786 multi->timetree = Curl_splaygetbest(now, multi->timetree, &t);
1789 (void)add_next_timeout(now, multi, t->payload);
1793 *running_handles = multi->num_alive;
1796 update_timer(multi);
1801 static void close_all_connections(struct Curl_multi *multi)
1805 conn = Curl_conncache_find_first_connection(multi->conn_cache);
1807 conn->data = multi->closure_handle;
1812 conn = Curl_conncache_find_first_connection(multi->conn_cache);
1818 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
1822 if(GOOD_MULTI_HANDLE(multi)) {
1826 multi->type = 0; /* not good anymore */
1829 close_all_connections(multi);
1831 if(multi->closure_handle) {
1832 sigpipe_ignore(multi->closure_handle, &pipe_st);
1835 multi->closure_handle->dns.hostcache = multi->hostcache;
1836 Curl_hostcache_clean(multi->closure_handle,
1837 multi->closure_handle->dns.hostcache);
1839 Curl_close(multi->closure_handle);
1840 multi->closure_handle = NULL;
1843 Curl_hash_destroy(multi->sockhash);
1844 multi->sockhash = NULL;
1846 Curl_conncache_destroy(multi->conn_cache);
1847 multi->conn_cache = NULL;
1850 Curl_llist_destroy(multi->msglist, NULL);
1851 multi->msglist = NULL;
1854 data = multi->easyp;
1866 data->multi = NULL; /* clear the association */
1871 Curl_hash_destroy(multi->hostcache);
1872 multi->hostcache = NULL;
1875 Curl_pipeline_set_site_blacklist(NULL, &multi->pipelining_site_bl);
1876 Curl_pipeline_set_server_blacklist(NULL, &multi->pipelining_server_bl);
1878 free(multi);
1891 * This function is the primary way for a multi/multi_socket application to
1900 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
1905 if(GOOD_MULTI_HANDLE(multi) && Curl_llist_count(multi->msglist)) {
1910 e = multi->msglist->head;
1915 Curl_llist_remove(multi->msglist, e, NULL);
1917 *msgs_in_queue = curlx_uztosi(Curl_llist_count(multi->msglist));
1930 static void singlesocket(struct Curl_multi *multi,
1961 entry = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));
1976 entry = sh_addentry(multi->sockhash, s, data);
1983 if(multi->socket_cb)
1984 multi->socket_cb(data,
1987 multi->socket_userp,
2012 entry = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));
2061 if(multi->socket_cb)
2062 multi->socket_cb(data,
2065 multi->socket_userp,
2067 sh_delentry(multi->sockhash, s);
2089 struct Curl_multi *multi = conn->data->multi;
2090 if(multi) {
2092 a multi handle, and only then this is necessary */
2094 Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));
2097 if(multi->socket_cb)
2098 multi->socket_cb(conn->data, s, CURL_POLL_REMOVE,
2099 multi->socket_userp,
2103 sh_delentry(multi->sockhash, s);
2123 struct Curl_multi *multi,
2159 multi->timetree = Curl_splayinsert(*tv, multi->timetree,
2165 static CURLMcode multi_socket(struct Curl_multi *multi,
2178 result = curl_multi_perform(multi, running_handles);
2183 data=multi->easyp;
2185 singlesocket(multi, data);
2196 Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));
2235 result = multi_runsingle(multi, now, data);
2247 singlesocket(multi, data);
2264 memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall));
2279 result = multi_runsingle(multi, now, data);
2286 singlesocket(multi, data);
2292 multi->timetree = Curl_splaygetbest(now, multi->timetree, &t);
2295 (void)add_next_timeout(now, multi, t->payload);
2300 *running_handles = multi->num_alive;
2308 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
2312 if(!GOOD_MULTI_HANDLE(multi))
2319 multi->socket_cb = va_arg(param, curl_socket_callback);
2322 multi->socket_userp = va_arg(param, void *);
2325 multi->pipelining_enabled = (0 != va_arg(param, long)) ? TRUE : FALSE;
2328 multi->timer_cb = va_arg(param, curl_multi_timer_callback);
2331 multi->timer_userp = va_arg(param, void *);
2334 multi->maxconnects = va_arg(param, long);
2337 multi->max_host_connections = va_arg(param, long);
2340 multi->max_pipeline_length = va_arg(param, long);
2343 multi->content_length_penalty_size = va_arg(param, long);
2346 multi->chunk_length_penalty_size = va_arg(param, long);
2350 &multi->pipelining_site_bl);
2354 &multi->pipelining_server_bl);
2357 multi->max_total_connections = va_arg(param, long);
2367 /* we define curl_multi_socket() in the public multi.h header */
2400 static CURLMcode multi_timeout(struct Curl_multi *multi,
2405 if(multi->timetree) {
2410 multi->timetree = Curl_splay(tv_zero, multi->timetree);
2412 if(Curl_splaycomparekeys(multi->timetree->key, now) > 0) {
2414 *timeout_ms = curlx_tvdiff(multi->timetree->key, now);
2438 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
2441 if(!GOOD_MULTI_HANDLE(multi))
2444 return multi_timeout(multi, timeout_ms);
2451 static int update_timer(struct Curl_multi *multi)
2455 if(!multi->timer_cb)
2457 if(multi_timeout(multi, &timeout_ms)) {
2462 if(Curl_splaycomparekeys(none, multi->timer_lastcall)) {
2463 multi->timer_lastcall = none;
2466 return multi->timer_cb((CURLM*)multi, -1, multi->timer_userp);
2471 /* When multi_timeout() is done, multi->timetree points to the node with the
2475 if(Curl_splaycomparekeys(multi->timetree->key, multi->timer_lastcall) == 0)
2478 multi->timer_lastcall = multi->timetree->key;
2480 return multi->timer_cb((CURLM*)multi, timeout_ms, multi->timer_userp);
2570 struct Curl_multi *multi = data->multi;
2574 /* this is only interesting while there is still an associated multi struct
2576 if(!multi)
2586 rc = Curl_splayremovebyaddr(multi->timetree,
2588 &multi->timetree);
2633 rc = Curl_splayremovebyaddr(multi->timetree,
2635 &multi->timetree);
2642 multi->timetree = Curl_splayinsert(*nowp,
2643 multi->timetree,
2647 Curl_splayprint(multi->timetree, 0, TRUE);
2655 struct Curl_multi *multi = (struct Curl_multi *)multi_handle;
2658 there = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(curl_socket_t));
2668 size_t Curl_multi_max_host_connections(struct Curl_multi *multi)
2670 return multi ? multi->max_host_connections : 0;
2673 size_t Curl_multi_max_total_connections(struct Curl_multi *multi)
2675 return multi ? multi->max_total_connections : 0;
2678 size_t Curl_multi_max_pipeline_length(struct Curl_multi *multi)
2680 return multi ? multi->max_pipeline_length : 0;
2683 curl_off_t Curl_multi_content_length_penalty_size(struct Curl_multi *multi)
2685 return multi ? multi->content_length_penalty_size : 0;
2688 curl_off_t Curl_multi_chunk_length_penalty_size(struct Curl_multi *multi)
2690 return multi ? multi->chunk_length_penalty_size : 0;
2693 struct curl_llist *Curl_multi_pipelining_site_bl(struct Curl_multi *multi)
2695 return multi->pipelining_site_bl;
2698 struct curl_llist *Curl_multi_pipelining_server_bl(struct Curl_multi *multi)
2700 return multi->pipelining_server_bl;
2703 void Curl_multi_process_pending_handles(struct Curl_multi *multi)
2707 data=multi->easyp;
2721 struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
2725 multi->num_easy, multi->num_alive);
2726 for(data=multi->easyp; data; data = data->next) {
2735 Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));