diff options
author | Giovanni Campagna <gcampagna@src.gnome.org> | 2014-03-08 19:34:18 +0100 |
---|---|---|
committer | Giovanni Campagna <gcampagna@src.gnome.org> | 2014-03-08 19:35:42 +0100 |
commit | 356a5889a51dc3077dab4a3be4b0ac3ce62ce8d9 (patch) | |
tree | a767d696979c6ba9a51ff92d10de3c57865b7b34 /libgweather/weather-yahoo.c | |
parent | 5dfa781ccf3194d94287a0ad4cb9222aa7d6eb20 (diff) | |
download | libgweather-356a5889a51dc3077dab4a3be4b0ac3ce62ce8d9.tar.gz |
GWeatherInfo: don't abort the entire SoupSession
The SoupSession is shared between all GWeatherInfos, so it's
extremely bad to abort it, expecially because we do when infos
are finalized. Instead, have each info keep a list of pending
SoupMessages and cancel them.
Diffstat (limited to 'libgweather/weather-yahoo.c')
-rw-r--r-- | libgweather/weather-yahoo.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libgweather/weather-yahoo.c b/libgweather/weather-yahoo.c index 778169e..a44ae21 100644 --- a/libgweather/weather-yahoo.c +++ b/libgweather/weather-yahoo.c @@ -249,14 +249,15 @@ yahoo_finish (SoupSession *session, if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { /* forecast data is not really interesting anyway ;) */ - g_warning ("Failed to get Yahoo! Weather forecast data: %d %s\n", - msg->status_code, msg->reason_phrase); - _gweather_info_request_done (info); + if (msg->status_code != SOUP_STATUS_CANCELLED) + g_warning ("Failed to get Yahoo! Weather forecast data: %d %s\n", + msg->status_code, msg->reason_phrase); + _gweather_info_request_done (info, msg); return; } parse_forecast_xml (info, msg->response_body); - _gweather_info_request_done (info); + _gweather_info_request_done (info, msg); } gboolean @@ -280,10 +281,9 @@ yahoo_start_open (GWeatherInfo *info) url = g_strdup_printf("http://weather.yahooapis.com/forecastrss?w=%s&u=f", loc->yahoo_id); message = soup_message_new ("GET", url); + _gweather_info_begin_request (info, message); soup_session_queue_message (priv->session, message, yahoo_finish, info); - priv->requests_pending++; - g_free (url); return TRUE; |