mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 21:50:17 +01:00
connectivity: fix evaluating @what argument of CURLMOPT_SOCKETFUNCTION
It's not a bitfields, it's documented to be an enum with 4 possible values.
This commit is contained in:
parent
bfe60cb7b9
commit
89ccfa8dde
1 changed files with 8 additions and 5 deletions
|
|
@ -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;
|
||||
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;
|
||||
|
||||
fdp->ev = g_io_add_watch (fdp->ch, condition, curl_socketevent_cb, self);
|
||||
if (condition)
|
||||
fdp->ev = g_io_add_watch (fdp->ch, condition, curl_socketevent_cb, self);
|
||||
curl_multi_assign (priv->curl_mhandle, s, fdp);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue