[Xfce4-commits] <xfce4-screenshooter:master> Make the ZimageZ upload work behind a proxy.

Jérôme Guelfucci noreply at xfce.org
Sun Oct 11 15:42:01 CEST 2009


Updating branch refs/heads/master
         to 020db2b8066b3ab79c268b2ca68c25bceeca4031 (commit)
       from cd273c6753d4a049ea53651ad4ed3ebed4e1fdbb (commit)

commit 020db2b8066b3ab79c268b2ca68c25bceeca4031
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Thu Oct 1 11:06:42 2009 +0200

    Make the ZimageZ upload work behind a proxy.

 lib/screenshooter-zimagez.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/lib/screenshooter-zimagez.c b/lib/screenshooter-zimagez.c
index c506869..cca0858 100644
--- a/lib/screenshooter-zimagez.c
+++ b/lib/screenshooter-zimagez.c
@@ -222,6 +222,7 @@ zimagez_upload_job (ScreenshooterJob *job, GValueArray *param_values, GError **e
   const gchar *last_user;
   const gchar *date = screenshooter_get_date (FALSE);
   const gchar *current_time = screenshooter_get_time ();
+  const gchar *proxy_uri;
   gchar *comment = g_strdup_printf (_("Taken on %s, at %s"), date, current_time);
   gchar *data = NULL;
   gchar *encoded_password = NULL;
@@ -240,6 +241,7 @@ zimagez_upload_job (ScreenshooterJob *job, GValueArray *param_values, GError **e
   const gchar *method_logout = g_strdup ("apiXml.xmlrpcLogout");
   const gchar *method_upload = g_strdup ("apiXml.xmlrpcUpload");
   SoupSession *session;
+  SoupURI *soup_proxy_uri;
 
   GError *tmp_error;
   GtkTreeIter iter;
@@ -291,6 +293,16 @@ zimagez_upload_job (ScreenshooterJob *job, GValueArray *param_values, GError **e
   exo_job_info_message (EXO_JOB (job), _("Initialize the connection..."));
   session = soup_session_sync_new ();
 
+  /* 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);
+      soup_uri_free (soup_proxy_uri);
+    }
+
   TRACE ("Get the information liststore ready.");
   liststore = gtk_list_store_new (2, G_TYPE_INT, G_TYPE_STRING);
 



More information about the Xfce4-commits mailing list