Lines Matching full:multi
324 static int events_timer(struct Curl_multi *multi, /* multi handle */ in events_timer() argument
329 (void)multi; in events_timer()
455 * Do the multi handle setups that only event-based transfers need.
457 static void events_setup(struct Curl_multi *multi, struct events *ev) in events_setup() argument
460 curl_multi_setopt(multi, CURLMOPT_TIMERFUNCTION, events_timer); in events_setup()
461 curl_multi_setopt(multi, CURLMOPT_TIMERDATA, ev); in events_setup()
464 curl_multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, events_socket); in events_setup()
465 curl_multi_setopt(multi, CURLMOPT_SOCKETDATA, ev); in events_setup()
474 static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) in wait_or_timeout() argument
515 mcode = curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0, in wait_or_timeout()
524 infof(multi->easyp, "call curl_multi_socket_action(socket %d)\n", in wait_or_timeout()
526 mcode = curl_multi_socket_action(multi, fds[i].fd, act, in wait_or_timeout()
552 msg = curl_multi_info_read(multi, &pollrc); in wait_or_timeout()
567 static CURLcode easy_events(struct Curl_multi *multi) in easy_events() argument
573 /* if running event-based, do some further multi inits */ in easy_events()
574 events_setup(multi, &evs); in easy_events()
576 return wait_or_timeout(multi, &evs); in easy_events()
583 static CURLcode easy_transfer(struct Curl_multi *multi) in easy_transfer() argument
592 mcode = curl_multi_poll(multi, NULL, 0, 1000, NULL); in easy_transfer()
595 mcode = curl_multi_perform(multi, &still_running); in easy_transfer()
600 CURLMsg *msg = curl_multi_info_read(multi, &rc); in easy_transfer()
608 /* Make sure to return some kind of error if there was a multi problem */ in easy_transfer()
611 /* The other multi errors should never happen, so return in easy_transfer()
624 * CONCEPT: This function creates a multi handle, adds the easy handle to it,
626 * easy handle, destroys the multi handle and returns the easy handle's return
629 * REALITY: it can't just create and destroy the multi handle that easily. It
631 * function, the same multi handle must be re-used so that the same pools and
639 struct Curl_multi *multi; in easy_perform() local
651 if(data->multi) { in easy_perform()
652 failf(data, "easy handle already used in multi handle"); in easy_perform()
657 multi = data->multi_easy; in easy_perform()
659 /* this multi handle will only ever have a single easy handled attached in easy_perform()
661 multi = Curl_multi_handle(1, 3); in easy_perform()
662 if(!multi) in easy_perform()
664 data->multi_easy = multi; in easy_perform()
667 if(multi->in_callback) in easy_perform()
670 /* Copy the MAXCONNECTS option to the multi handle */ in easy_perform()
671 curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, data->set.maxconnects); in easy_perform()
673 mcode = curl_multi_add_handle(multi, data); in easy_perform()
675 curl_multi_cleanup(multi); in easy_perform()
685 data->multi = multi; in easy_perform()
688 result = events ? easy_events(multi) : easy_transfer(multi); in easy_perform()
692 (void)curl_multi_remove_handle(multi, data); in easy_perform()
696 /* The multi handle is kept alive, owned by the easy handle */ in easy_perform()
1026 if(data->multi) in curl_easy_pause()
1027 Curl_update_timer(data->multi); in curl_easy_pause()