summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatricia Muscalu <patricia@axis.com>2015-09-08 14:37:57 +0200
committerTim-Philipp Müller <tim@centricular.com>2016-04-06 14:35:16 +0100
commitfc34266aef823293890b07cf00fb9dac3f4bf9db (patch)
tree18df757fe12ad4b08fdb7b8d77ce96b99dd5de99
parent60d14bf879e77df7dc390e88c9839c83094cae8e (diff)
downloadgstreamer-plugins-bad-fc34266aef823293890b07cf00fb9dac3f4bf9db.tar.gz
curlsink: catch an unknown error
In this case the socket callback has not been called by libcurl and the curlsink has not been notified about any connection problems by libcurl. This indicates that it's a bug in libcurl so catch it as an unknown error. https://bugzilla.gnome.org/show_bug.cgi?id=754432
-rw-r--r--ext/curl/gstcurlbasesink.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/curl/gstcurlbasesink.c b/ext/curl/gstcurlbasesink.c
index b13c182eb..3b3ab2aa0 100644
--- a/ext/curl/gstcurlbasesink.c
+++ b/ext/curl/gstcurlbasesink.c
@@ -981,6 +981,15 @@ handle_transfer (GstCurlBaseSink * sink)
GST_OBJECT_LOCK (sink);
if (sink->socket_type == CURLSOCKTYPE_ACCEPT) {
+ /* FIXME: remove this again once we can depend on libcurl > 7.44.0,
+ * see https://github.com/bagder/curl/issues/405.
+ */
+ if (G_UNLIKELY (sink->fd.fd < 0)) {
+ sink->error = g_strdup_printf ("unknown error");
+ retval = GST_FLOW_ERROR;
+ GST_OBJECT_UNLOCK (sink);
+ goto fail;
+ }
if (!gst_poll_remove_fd (sink->fdset, &sink->fd)) {
sink->error = g_strdup_printf ("failed to remove fd");
retval = GST_FLOW_ERROR;