* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
timeout.tv_usec = 0;
multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd);
- select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
+ select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
abort_on_test_timeout();
multi_perform(m, &still_running);
abort_on_test_timeout();
}
- while((msg = curl_multi_info_read(m, &msgs_left))) {
- if(msg->msg == CURLMSG_DONE && msg->easy_handle == curls) {
+ do {
+ msg = curl_multi_info_read(m, &msgs_left);
+ if(msg && msg->msg == CURLMSG_DONE && msg->easy_handle == curls) {
res = msg->data.result;
break;
}
- }
+ } while(msg);
test_cleanup:
test_cleanup:
curl_multi_cleanup(multi);
+ curl_global_cleanup();
return (int) res;
}