diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2011-05-06 15:28:23 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2011-05-06 15:28:23 -0400 |
commit | 5dff4b882ce6f00f01b5b35621e7e74bda7b3d92 (patch) | |
tree | 5d43333f7c8882f6b50357ca12f25e2f82db7aca /transmitters/rawudp | |
parent | 88940cf647ae0365e04cd94731406f3a75a777ba (diff) | |
download | farstream-5dff4b882ce6f00f01b5b35621e7e74bda7b3d92.tar.gz |
rawudp: Send the original STUN packets from the same thread
This is to make sure the STUN packets for each component are sent in order.
Some firewalls just allocate output ports linearly. In that case, we prefer
if the order of the outside ports is the same as the order of the local ports,
that way, if we do UPnP, we have fewer chances of mixing it up.
Diffstat (limited to 'transmitters/rawudp')
-rw-r--r-- | transmitters/rawudp/fs-rawudp-component.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/transmitters/rawudp/fs-rawudp-component.c b/transmitters/rawudp/fs-rawudp-component.c index 3052583e..c16e5451 100644 --- a/transmitters/rawudp/fs-rawudp-component.c +++ b/transmitters/rawudp/fs-rawudp-component.c @@ -1306,9 +1306,17 @@ fs_rawudp_component_start_stun (FsRawUdpComponent *self, GError **error) self->priv->stun_buffer, sizeof(self->priv->stun_buffer)); - if (self->priv->stun_timeout_thread == NULL) { - /* only create a new thread if the old one was stopped. Otherwise we can - * just reuse the currently running one. */ + + /* only create a new thread if the old one was stopped. Otherwise we can + * just reuse the currently running one. */ + if (self->priv->stun_timeout_thread == NULL) + { + if (!fs_rawudp_component_send_stun_locked (self, error)) + { + FS_RAWUDP_COMPONENT_UNLOCK (self); + return FALSE; + } + self->priv->stun_timeout_thread = g_thread_create (stun_timeout_func, self, TRUE, error); } @@ -1465,7 +1473,7 @@ stun_timeout_func (gpointer user_data) GError *error = NULL; guint timeout_accum_ms = 0; guint remainder; - StunUsageTimerReturn timer_ret = STUN_USAGE_TIMER_RETURN_RETRANSMIT; + StunUsageTimerReturn timer_ret = STUN_USAGE_TIMER_RETURN_SUCCESS; StunTransactionId stunid; StunTimer stun_timer; |