[evolution-data-server/camel-socks-proxy] Use the SOCKS proxy in the imap store
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/camel-socks-proxy] Use the SOCKS proxy in the imap store
- Date: Thu, 13 May 2010 20:17:28 +0000 (UTC)
commit 42cfa4693b06f63c107271702ef8bf482642d318
Author: Federico Mena Quintero <federico novell com>
Date: Thu May 13 14:00:28 2010 -0500
Use the SOCKS proxy in the imap store
Signed-off-by: Federico Mena Quintero <federico novell com>
camel/providers/imap/camel-imap-store.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 9239305..973cc6e 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -548,6 +548,9 @@ static gboolean
connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, CamelException *ex)
{
CamelImapStore *store = (CamelImapStore *) service;
+ CamelSession *session;
+ char *socks_host;
+ int socks_port;
CamelImapResponse *response;
CamelStream *tcp_stream;
CamelSockOptData sockopt;
@@ -572,6 +575,14 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
} else
tcp_stream = camel_tcp_stream_raw_new ();
+ session = camel_service_get_session (service);
+ camel_session_get_socks_proxy (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);
+ }
+
if (camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai) == -1) {
if (errno == EINTR)
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]