[Xfce4-commits] <xfce4-weather-plugin:master> Set timeout for HTTP connections.

Harald Judt noreply at xfce.org
Tue Nov 20 20:18:11 CET 2012


Updating branch refs/heads/master
         to 22f7f826441c39c64ba1ca05ab57f9a03b30ad8b (commit)
       from ea0e5a5d5e9e6878d2a163c393c841bfd9ee1b00 (commit)

commit 22f7f826441c39c64ba1ca05ab57f9a03b30ad8b
Author: Harald Judt <h.judt at gmx.at>
Date:   Tue Nov 20 20:06:26 2012 +0100

    Set timeout for HTTP connections.

 panel-plugin/weather-http.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/weather-http.c b/panel-plugin/weather-http.c
index 6a8b6a9..cfb81e1 100644
--- a/panel-plugin/weather-http.c
+++ b/panel-plugin/weather-http.c
@@ -24,6 +24,8 @@
 
 #include "weather-http.h"
 
+#define WEATHER_MAX_CONN_TIMEOUT   (10)        /* connection timeout in seconds */
+
 
 void
 weather_http_queue_request(const gchar *uri,
@@ -37,13 +39,15 @@ weather_http_queue_request(const gchar *uri,
 
     /* create a new soup session */
     session = soup_session_async_new();
+    g_object_set(session, SOUP_SESSION_TIMEOUT,
+                 WEATHER_MAX_CONN_TIMEOUT, NULL);
 
     /* Set the proxy URI if any */
     proxy_uri = g_getenv("http_proxy");
 
     if (proxy_uri != NULL) {
         soup_proxy_uri = soup_uri_new (proxy_uri);
-        g_object_set(session, "proxy-uri", soup_proxy_uri, NULL);
+        g_object_set(session, SOUP_SESSION_PROXY_URI, soup_proxy_uri, NULL);
         soup_uri_free(soup_proxy_uri);
     }
 


More information about the Xfce4-commits mailing list