rtsp-client: Fix session timeout
authorJoakim Johansson <joakimj@axis.com>
Tue, 17 Apr 2018 09:03:11 +0000 (11:03 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 20 Apr 2018 07:13:53 +0000 (10:13 +0300)
When streaming data over TCP then is not the keep-alive
functionality working.

The reason is that the function do_send_data have changed
to boolean but the code is still checking the received result
from send_func with GST_RTSP_OK.

The result is that a successful send_func will always lead to
that do_send_data is returning false and the keep-alive will
not be updated.

https://bugzilla.gnome.org/show_bug.cgi?id=795321

gst/rtsp-server/rtsp-client.c

index 724065f..d987c1f 100644 (file)
@@ -1065,7 +1065,7 @@ do_send_data (GstBuffer * buffer, guint8 channel, GstRTSPClient * client)
 {
   GstRTSPClientPrivate *priv = client->priv;
   GstRTSPMessage message = { 0 };
-  GstRTSPResult res = GST_RTSP_OK;
+  gboolean ret = TRUE;
   GstMapInfo map_info;
   guint8 *data;
   guint usize;
@@ -1080,7 +1080,7 @@ do_send_data (GstBuffer * buffer, guint8 channel, GstRTSPClient * client)
 
   g_mutex_lock (&priv->send_lock);
   if (priv->send_func)
-    res = priv->send_func (client, &message, FALSE, priv->send_data);
+    ret = priv->send_func (client, &message, FALSE, priv->send_data);
   g_mutex_unlock (&priv->send_lock);
 
   gst_rtsp_message_steal_body (&message, &data, &usize);
@@ -1088,7 +1088,7 @@ do_send_data (GstBuffer * buffer, guint8 channel, GstRTSPClient * client)
 
   gst_rtsp_message_unset (&message);
 
-  return res == GST_RTSP_OK;
+  return ret;
 }
 
 /**