Commit 390fb717 authored by Youness Alaoui's avatar Youness Alaoui Committed by Olivier Crête

Only check selected pair for writability in gio outputstream

parent 6840d863
......@@ -470,7 +470,6 @@ nice_output_stream_is_writable (GPollableOutputStream *stream)
Component *component = NULL;
Stream *_stream = NULL;
gboolean retval = FALSE;
GSList *i;
NiceAgent *agent; /* owned */
/* Closed streams are not writeable. */
......@@ -491,23 +490,15 @@ nice_output_stream_is_writable (GPollableOutputStream *stream)
goto done;
}
if (component->selected_pair.local != NULL) {
NiceSocket *sockptr = component->selected_pair.local->sockptr;
/* If it’s a reliable agent, see if there’s any space in the pseudo-TCP
* output buffer. */
if (!nice_socket_is_reliable (component->selected_pair.local->sockptr) &&
component->tcp != NULL) {
retval = pseudo_tcp_socket_can_send (component->tcp);
goto done;
}
/* Check whether any of the component’s FDs are pollable. */
for (i = component->socket_sources; i != NULL; i = i->next) {
SocketSource *socket_source = i->data;
NiceSocket *nicesock = socket_source->socket;
if (g_socket_condition_check (nicesock->fileno, G_IO_OUT) != 0) {
retval = TRUE;
break;
}
if (!nice_socket_is_reliable (sockptr)) {
if (component->tcp != NULL)
retval = pseudo_tcp_socket_can_send (component->tcp);
} else {
retval = (g_socket_condition_check (sockptr->fileno, G_IO_OUT) != 0);
}
}
......
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