summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2010-12-24 03:32:15 (GMT)
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2010-12-24 03:50:52 (GMT)
commitb025bb618dc5cbf3a997c6a15711c38b4b385e82 (patch)
treea83b4930f76e318c89aee3a42bad081cd179da18
parentc4ad6fbc0a36fe2103bf65e2dfacab218ae01a7d (diff)
downloadlibnice-b025bb618dc5cbf3a997c6a15711c38b4b385e82.tar.gz
libnice-b025bb618dc5cbf3a997c6a15711c38b4b385e82.tar.xz
handle the permission response instead of having the code handled in the error case
-rw-r--r--socket/turn.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/socket/turn.c b/socket/turn.c
index b18c119..ce1ec0d 100644
--- a/socket/turn.c
+++ b/socket/turn.c
@@ -968,25 +968,26 @@ nice_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock,
priv_send_create_permission (priv, &msg, &to);
return 0;
}
- /* If we get an error, we just assume the server somehow
- doesn't support permissions and we ignore the error and
- fake a successful completion. If the server needs a permission
- but it failed to create it, then the connchecks will fail. */
- priv_remove_sent_permission_for_peer (priv, &to);
- priv_add_permission_for_peer (priv, &to);
-
- /* install timer to schedule refresh of the permission */
- /* (will not schedule refresh if we got an error) */
- if (stun_message_get_class (&msg) == STUN_RESPONSE &&
- !priv->permission_timeout_source) {
- priv->permission_timeout_source =
- g_timeout_add_seconds (STUN_PERMISSION_TIMEOUT,
- priv_permission_timeout, priv);
- }
-
- /* send enqued data */
- socket_dequeue_all_data (priv, &to);
}
+ /* If we get an error, we just assume the server somehow
+ doesn't support permissions and we ignore the error and
+ fake a successful completion. If the server needs a permission
+ but it failed to create it, then the connchecks will fail. */
+ priv_remove_sent_permission_for_peer (priv, &to);
+ priv_add_permission_for_peer (priv, &to);
+
+ /* install timer to schedule refresh of the permission */
+ /* (will not schedule refresh if we got an error) */
+ if (stun_message_get_class (&msg) == STUN_RESPONSE &&
+ !priv->permission_timeout_source) {
+ priv->permission_timeout_source =
+ g_timeout_add_seconds (STUN_PERMISSION_TIMEOUT,
+ priv_permission_timeout, priv);
+ }
+
+ /* send enqued data */
+ socket_dequeue_all_data (priv, &to);
+
g_free (priv->current_create_permission_msg);
priv->current_create_permission_msg = NULL;
}