Commit 89ccfa8d authored by Thomas Haller's avatar Thomas Haller

connectivity: fix evaluating @what argument of CURLMOPT_SOCKETFUNCTION

It's not a bitfields, it's documented to be an enum with 4
possible values.
parent bfe60cb7
......@@ -274,12 +274,15 @@ multi_socket_cb (CURL *e_handle, curl_socket_t s, int what, void *userdata, void
} else
nm_clear_g_source (&fdp->ev);
if (what & CURL_POLL_IN)
condition |= G_IO_IN;
if (what & CURL_POLL_OUT)
condition |= G_IO_OUT;
fdp->ev = g_io_add_watch (fdp->ch, condition, curl_socketevent_cb, self);
if (what == CURL_POLL_IN)
condition = G_IO_IN;
else if (what == CURL_POLL_OUT)
condition = G_IO_OUT;
else if (condition == CURL_POLL_INOUT)
condition = G_IO_IN | G_IO_OUT;
if (condition)
fdp->ev = g_io_add_watch (fdp->ch, condition, curl_socketevent_cb, self);
curl_multi_assign (priv->curl_mhandle, s, fdp);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment