# HG changeset patch # User maiku@pidgin.im # Date 1251601707 0 # Node ID 614a40c68b88847096286efe4255db24768703fb # Parent 2858857f457b565753ade572c02ff4ebd51ef345 Wait to set remote candidates until the session has been accepted. This stops the accepting side from sending a bunch of connectivity packets and "fail" to connect before the user has accepted. diff -r 2858857f457b -r 614a40c68b88 libpurple/media.c --- a/libpurple/media.c Sat Aug 29 22:05:20 2009 +0000 +++ b/libpurple/media.c Sun Aug 30 03:08:27 2009 +0000 @@ -2278,6 +2278,18 @@ purple_media_to_fs_stream_direction( stream->session->type), NULL); stream->accepted = TRUE; + + if (stream->remote_candidates != NULL) { + GError *err = NULL; + fs_stream_set_remote_candidates(stream->stream, + stream->remote_candidates, &err); + + if (err) { + purple_debug_error("media", "Error adding remote" + " candidates: %s\n", err->message); + g_error_free(err); + } + } } } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE || type == PURPLE_MEDIA_INFO_UNMUTE)) { @@ -2903,13 +2915,15 @@ stream->remote_candidates = g_list_concat(stream->remote_candidates, purple_media_candidate_list_to_fs(remote_candidates)); - fs_stream_set_remote_candidates(stream->stream, - stream->remote_candidates, &err); - - if (err) { - purple_debug_error("media", "Error adding remote" - " candidates: %s\n", err->message); - g_error_free(err); + if (stream->accepted == TRUE) { + fs_stream_set_remote_candidates(stream->stream, + stream->remote_candidates, &err); + + if (err) { + purple_debug_error("media", "Error adding remote" + " candidates: %s\n", err->message); + g_error_free(err); + } } #endif }