souphttpsrc: check if request was cancelled when sending message
authorThiago Santos <thiagoss@osg.samsung.com>
Sat, 14 May 2016 15:57:41 +0000 (12:57 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Sun, 15 May 2016 09:40:01 +0000 (06:40 -0300)
It might be that the request was aborted by the application and
we can return immediatelly

ext/soup/gstsouphttpsrc.c

index ba00c431fd1cb08284f68743c3fb3b04c009f5c9..797f1e9947953c718588efab5c17c1a1003b1ea9 100644 (file)
@@ -1392,6 +1392,10 @@ gst_soup_http_src_send_message (GstSoupHTTPSrc * src)
   /* FIXME We are ignoring the GError here, might be useful to debug */
   src->input_stream =
       soup_session_send (src->session, src->msg, src->cancellable, NULL);
+
+  if (g_cancellable_is_cancelled (src->cancellable))
+    return GST_FLOW_FLUSHING;
+
   gst_soup_http_src_got_headers (src, src->msg);
   if (src->ret != GST_FLOW_OK) {
     return src->ret;