Commit 84eaa12b authored by Jakub Adam's avatar Jakub Adam Committed by Philip Withnall

agent: check for base socket in _tcp_sock_is_writable()

The argument passed into the callback is always a base (TCP/UDP) socket,
which can't be directly compared with local candidate's sockptr (may be
TURN, http, or other socket wrapping another one). We're in fact
interested whether sock is a base socket of sockptr.

Maniphest Tasks: T114
Reviewed-by: default avatarPhilip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D241
parent 837c8953
...@@ -1851,7 +1851,7 @@ _tcp_sock_is_writable (NiceSocket *sock, gpointer user_data) ...@@ -1851,7 +1851,7 @@ _tcp_sock_is_writable (NiceSocket *sock, gpointer user_data)
/* Don't signal writable if the socket that has become writable is not /* Don't signal writable if the socket that has become writable is not
* the selected pair */ * the selected pair */
if (component->selected_pair.local == NULL || if (component->selected_pair.local == NULL ||
component->selected_pair.local->sockptr != sock) { !nice_socket_is_base_of (sock, component->selected_pair.local->sockptr)) {
agent_unlock (); agent_unlock ();
return; return;
} }
......
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