Component *component = NULL;
Stream *_stream = NULL;
gboolean retval = FALSE;
- GSList *i;
NiceAgent *agent; /* owned */
/* Closed streams are not writeable. */
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);
}
}