diff options
author | Alexander Zallesov <zallesov@gmail.com> | 2014-03-13 10:56:11 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-04-10 11:11:35 +0200 |
commit | b089524b216ef1719e3b30aae4769a91dcc4c973 (patch) | |
tree | ebbca279a2fba578e772d0c55d324f1f7a16c961 | |
parent | ecf188e6cd91554ce3a011e37f572ec41909ce18 (diff) |
souphttpsrc: Change default timeout to 15 seconds
If nothing happens after 15 seconds, chances are good that
our connection will never will work. Stop after 15 seconds
instead of waiting until the system's default timeout, which
can be > 1 minute.
-rw-r--r-- | ext/soup/gstsouphttpsrc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index 26d8654a3..2d7df81da 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -17,7 +17,7 @@ * * This plugin reads data from a remote location specified by a URI. * Supported protocols are 'http', 'https'. - * + * * An HTTP proxy must be specified by its URL. * If the "http_proxy" environment variable is set, its value is used. * If built with libsoup's GNOME integration features, the GNOME proxy @@ -123,6 +123,7 @@ enum #define DEFAULT_SSL_STRICT TRUE #define DEFAULT_SSL_CA_FILE NULL #define DEFAULT_SSL_USE_SYSTEM_CA_FILE TRUE +#define DEFAULT_TIMEOUT 15 static void gst_soup_http_src_uri_handler_init (gpointer g_iface, gpointer iface_data); @@ -250,7 +251,7 @@ gst_soup_http_src_class_init (GstSoupHTTPSrcClass * klass) g_object_class_install_property (gobject_class, PROP_TIMEOUT, g_param_spec_uint ("timeout", "timeout", "Value in seconds to timeout a blocking I/O (0 = No timeout).", 0, - 3600, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + 3600, DEFAULT_TIMEOUT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_EXTRA_HEADERS, g_param_spec_boxed ("extra-headers", "Extra Headers", "Extra headers to append to the HTTP request", @@ -416,6 +417,7 @@ gst_soup_http_src_init (GstSoupHTTPSrc * src) src->context = NULL; src->session = NULL; src->msg = NULL; + src->timeout = DEFAULT_TIMEOUT; src->log_level = DEFAULT_SOUP_LOG_LEVEL; src->ssl_strict = DEFAULT_SSL_STRICT; src->ssl_use_system_ca_file = DEFAULT_SSL_USE_SYSTEM_CA_FILE; |