lib/curl: Only check individual request errors
It looks like `curl_multi_socket_action()` will return an error if *one* of the requests has an error, but we already check for that explicitly by iterating over each handle. In libcurl, the "easy" layer doesn't really make use of this return value. I did a bit of looking elsewhere; systemd does check it as a runtime error, not an assertion. librepo doesn't use the multi interface. Closes: https://github.com/ostreedev/ostree/issues/1035 Closes: #1038 Approved by: jlebon
This commit is contained in:
parent
2f0707a054
commit
6347c0fb88
|
|
@ -425,11 +425,9 @@ static gboolean
|
||||||
timer_cb (gpointer data)
|
timer_cb (gpointer data)
|
||||||
{
|
{
|
||||||
OstreeFetcher *fetcher = data;
|
OstreeFetcher *fetcher = data;
|
||||||
CURLMcode rc;
|
|
||||||
GSource *orig_src = fetcher->timer_event;
|
GSource *orig_src = fetcher->timer_event;
|
||||||
|
|
||||||
rc = curl_multi_socket_action (fetcher->multi, CURL_SOCKET_TIMEOUT, 0, &fetcher->curl_running);
|
(void)curl_multi_socket_action (fetcher->multi, CURL_SOCKET_TIMEOUT, 0, &fetcher->curl_running);
|
||||||
g_assert (rc == CURLM_OK);
|
|
||||||
check_multi_info (fetcher);
|
check_multi_info (fetcher);
|
||||||
if (fetcher->timer_event == orig_src)
|
if (fetcher->timer_event == orig_src)
|
||||||
fetcher->timer_event = NULL;
|
fetcher->timer_event = NULL;
|
||||||
|
|
@ -460,15 +458,12 @@ static gboolean
|
||||||
event_cb (int fd, GIOCondition condition, gpointer data)
|
event_cb (int fd, GIOCondition condition, gpointer data)
|
||||||
{
|
{
|
||||||
OstreeFetcher *fetcher = data;
|
OstreeFetcher *fetcher = data;
|
||||||
CURLMcode rc;
|
|
||||||
|
|
||||||
int action =
|
int action =
|
||||||
(condition & G_IO_IN ? CURL_CSELECT_IN : 0) |
|
(condition & G_IO_IN ? CURL_CSELECT_IN : 0) |
|
||||||
(condition & G_IO_OUT ? CURL_CSELECT_OUT : 0);
|
(condition & G_IO_OUT ? CURL_CSELECT_OUT : 0);
|
||||||
|
|
||||||
rc = curl_multi_socket_action (fetcher->multi, fd, action, &fetcher->curl_running);
|
(void)curl_multi_socket_action (fetcher->multi, fd, action, &fetcher->curl_running);
|
||||||
g_assert (rc == CURLM_OK);
|
|
||||||
|
|
||||||
check_multi_info (fetcher);
|
check_multi_info (fetcher);
|
||||||
if (fetcher->curl_running > 0)
|
if (fetcher->curl_running > 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue