summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Balneaves <[email protected]>2017-04-03 11:46:29 -0500
committerraveit65 <[email protected]>2017-07-23 14:34:45 +0200
commitc307e7c9ee89e4ac17cc2bb2aa1e245d766cbc5e (patch)
treed2d4ba1c104b7e03fba569471dae03aebd6086f8
parent97326e615fffaef92669dbe82c8955c2c2e2edda (diff)
downloadlibmateweather-c307e7c9ee89e4ac17cc2bb2aa1e245d766cbc5e.tar.bz2
libmateweather-c307e7c9ee89e4ac17cc2bb2aa1e245d766cbc5e.tar.xz
Add timeout, actully invalidate session in weather_info_abort
-rw-r--r--libmateweather/weather.c3
-rw-r--r--libmateweather/weather.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/libmateweather/weather.c b/libmateweather/weather.c
index 71d43a4..0e7d8d6 100644
--- a/libmateweather/weather.c
+++ b/libmateweather/weather.c
@@ -557,7 +557,7 @@ _weather_info_fill (WeatherInfo *info,
info->cb_data = data;
if (!info->session) {
- info->session = soup_session_new ();
+ info->session = soup_session_new_with_options (SOUP_SESSION_TIMEOUT, MATEWEATHER_DEFAULT_TIMEOUT, NULL);
soup_session_add_feature_by_type (info->session, SOUP_TYPE_PROXY_RESOLVER_DEFAULT);
}
@@ -579,6 +579,7 @@ weather_info_abort (WeatherInfo *info)
if (info->session) {
soup_session_abort (info->session);
info->requests_pending = 0;
+ info->session = NULL;
}
}
diff --git a/libmateweather/weather.h b/libmateweather/weather.h
index d30b39f..35ba169 100644
--- a/libmateweather/weather.h
+++ b/libmateweather/weather.h
@@ -24,6 +24,7 @@
#error "libmateweather should only be used if you understand that it's subject to change, and is not supported as a fixed API/ABI or as part of the platform"
#endif
+#define MATEWEATHER_DEFAULT_TIMEOUT (30)
#include <gdk-pixbuf/gdk-pixbuf.h>