[evolution-data-server/camel-socks-proxy] Use the SOCKS proxy in the imapx server



commit 43ab0c98d8c31a01764bb843f8ea9c7e25966e46
Author: Federico Mena Quintero <federico novell com>
Date:   Thu May 13 14:46:18 2010 -0500

    Use the SOCKS proxy in the imapx server
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 camel/providers/imapx/camel-imapx-server.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index fb1c4a9..0ad4af8 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -2108,6 +2108,8 @@ gboolean
 imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex)
 {
 	CamelStream * tcp_stream = NULL;
+	char *socks_host;
+	int socks_port;
 	CamelSockOptData sockopt;
 	gint ret, ssl_mode = 0;
 
@@ -2151,6 +2153,13 @@ imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex)
 	is->is_ssl_stream = FALSE;
 #endif /* HAVE_SSL */
 
+	camel_session_get_socks_proxy (is->session, &socks_host, &socks_port);
+
+	if (socks_host) {
+		camel_tcp_stream_set_socks_proxy ((CamelTcpStream *) tcp_stream, socks_host, socks_port);
+		g_free (socks_host);
+	}
+
 	hints.ai_socktype = SOCK_STREAM;
 	ai = camel_getaddrinfo(is->url->host, serv, &hints, ex);
 	if (ex && ex->id && ex->id != CAMEL_EXCEPTION_USER_CANCEL && port != NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]