rtspconnection: Fix potential deadlock caused by blocking read forever
authorSergio Torres Soldado <torres.soldado@gmail.com>
Mon, 4 Jul 2016 16:19:08 +0000 (17:19 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 7 Jul 2016 16:15:18 +0000 (19:15 +0300)
Reset the connection "may_cancel" property to avoid a potential deadlock
if there is no data to read and the socket stays blocked forever.

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

gst-libs/gst/rtsp/gstrtspconnection.c

index 3e5add4..309421c 100644 (file)
@@ -2161,11 +2161,13 @@ build_next (GstRTSPBuilder * builder, GstRTSPMessage * message,
     }
   }
 done:
+  conn->may_cancel = TRUE;
   return res;
 
   /* ERRORS */
 invalid_body_len:
   {
+    conn->may_cancel = TRUE;
     GST_DEBUG ("could not allocate body");
     return GST_RTSP_ERROR;
   }