Skip to content

Commit

Permalink
Add timeout, actully invalidate session in weather_info_abort
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Balneaves authored and raveit65 committed Jul 23, 2017
1 parent 97326e6 commit c307e7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libmateweather/weather.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -579,6 +579,7 @@ weather_info_abort (WeatherInfo *info)
if (info->session) {
soup_session_abort (info->session);
info->requests_pending = 0;
info->session = NULL;
}
}

Expand Down
1 change: 1 addition & 0 deletions libmateweather/weather.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down

0 comments on commit c307e7c

Please sign in to comment.