From 8ccd603cba3ad14561a1942b872f977308c36e92 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Thu, 13 Feb 2014 10:57:10 -0600 Subject: [PATCH] fetcher: set timeouts on HTTP connections We're seeing some hangs while ostree is fetching updates. I imagine the fact that SoupSessionAsync has no timeout by default could be the cause of this. Set timeout values to 60 seconds, which is the default for the new SoupSession API which we may switch to later. https://bugzilla.gnome.org/show_bug.cgi?id=724310 --- src/libostree/ostree-fetcher.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libostree/ostree-fetcher.c b/src/libostree/ostree-fetcher.c index ec3b519e..6b55378f 100644 --- a/src/libostree/ostree-fetcher.c +++ b/src/libostree/ostree-fetcher.c @@ -153,6 +153,8 @@ ostree_fetcher_init (OstreeFetcher *self) SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE, SOUP_SESSION_USE_THREAD_CONTEXT, TRUE, SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_REQUESTER, + SOUP_SESSION_TIMEOUT, 60, + SOUP_SESSION_IDLE_TIMEOUT, 60, NULL); self->requester = (SoupRequester *)soup_session_get_feature (self->session, SOUP_TYPE_REQUESTER); g_object_get (self->session, "max-conns-per-host", &max_conns, NULL);