Lines Matching full:multi
426 static int events_timer(CURLM *multi, /* multi handle */ in events_timer() argument
431 (void)multi; in events_timer()
553 * Do the multi handle setups that only event-based transfers need.
555 static void events_setup(CURLM *multi, struct events *ev) in events_setup() argument
558 curl_multi_setopt(multi, CURLMOPT_TIMERFUNCTION, events_timer); in events_setup()
559 curl_multi_setopt(multi, CURLMOPT_TIMERDATA, ev); in events_setup()
562 curl_multi_setopt(multi, CURLMOPT_SOCKETFUNCTION, events_socket); in events_setup()
563 curl_multi_setopt(multi, CURLMOPT_SOCKETDATA, ev); in events_setup()
572 static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) in wait_or_timeout() argument
613 mcode = curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0, in wait_or_timeout()
622 infof(multi->easyp, "call curl_multi_socket_action( socket %d )\n", in wait_or_timeout()
624 mcode = curl_multi_socket_action(multi, fds[i].fd, act, in wait_or_timeout()
644 msg = curl_multi_info_read(multi, &pollrc); in wait_or_timeout()
659 static CURLcode easy_events(CURLM *multi) in easy_events() argument
663 /* if running event-based, do some further multi inits */ in easy_events()
664 events_setup(multi, &evs); in easy_events()
666 return wait_or_timeout(multi, &evs); in easy_events()
673 static CURLcode easy_transfer(CURLM *multi) in easy_transfer() argument
687 mcode = curl_multi_wait(multi, NULL, 0, 1000, &ret); in easy_transfer()
715 mcode = curl_multi_perform(multi, &still_running); in easy_transfer()
721 CURLMsg *msg = curl_multi_info_read(multi, &rc); in easy_transfer()
729 /* Make sure to return some kind of error if there was a multi problem */ in easy_transfer()
732 /* The other multi errors should never happen, so return in easy_transfer()
745 * CONCEPT: This function creates a multi handle, adds the easy handle to it,
747 * easy handle, destroys the multi handle and returns the easy handle's return
750 * REALITY: it can't just create and destroy the multi handle that easily. It
752 * function, the same multi handle must be re-used so that the same pools and
760 CURLM *multi; in easy_perform() local
768 if(data->multi) { in easy_perform()
769 failf(data, "easy handle already used in multi handle"); in easy_perform()
774 multi = data->multi_easy; in easy_perform()
776 /* this multi handle will only ever have a single easy handled attached in easy_perform()
778 multi = Curl_multi_handle(1, 3); in easy_perform()
779 if(!multi) in easy_perform()
781 data->multi_easy = multi; in easy_perform()
784 /* Copy the MAXCONNECTS option to the multi handle */ in easy_perform()
785 curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, data->set.maxconnects); in easy_perform()
787 mcode = curl_multi_add_handle(multi, data); in easy_perform()
789 curl_multi_cleanup(multi); in easy_perform()
800 data->multi = multi; in easy_perform()
803 result = events ? easy_events(multi) : easy_transfer(multi); in easy_perform()
807 (void)curl_multi_remove_handle(multi, data); in easy_perform()
811 /* The multi handle is kept alive, owned by the easy handle */ in easy_perform()