summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOgnyan Tonchev <ognyan@axis.com>2012-10-25 09:19:21 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2012-10-25 17:59:47 +0200
commit6e5ea441e7896c6bcbb505d0f1e428fafcbada30 (patch)
tree349771e0050f53fb8c8ce51ee443d456359b821a
parent883dc4184894d7347d4a10cc17773fb9ed74e1a7 (diff)
rtsp: Don't use invalid sockets
return false from dispatch () if the read and write sockets have been unset in tunnel_complete () Setting up HTTP tunnels causes segfaults since the watch for the second connection is not destroyed anymore in tunnel_complete () and the connection will still be used even though it is not valid anymore. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=686276
-rw-r--r--gst-libs/gst/rtsp/gstrtspconnection.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c
index 4d5f1333e..589079bc6 100644
--- a/gst-libs/gst/rtsp/gstrtspconnection.c
+++ b/gst-libs/gst/rtsp/gstrtspconnection.c
@@ -2971,8 +2971,13 @@ gst_rtsp_source_dispatch (GSource * source, GSourceFunc callback G_GNUC_UNUSED,
/* in the callback the connection should be tunneled with the
* GET connection */
- if (watch->funcs.tunnel_complete)
+ if (watch->funcs.tunnel_complete) {
watch->funcs.tunnel_complete (watch, watch->user_data);
+ keep_running = !(watch->conn->read_socket == NULL &&
+ watch->conn->write_socket == NULL);
+ if (!keep_running)
+ goto done;
+ }
goto read_done;
}
}
@@ -3056,6 +3061,7 @@ gst_rtsp_source_dispatch (GSource * source, GSourceFunc callback G_GNUC_UNUSED,
g_mutex_unlock (&watch->mutex);
}
+done:
write_blocked:
return keep_running;