[evolution-data-server/camel-socks-proxy] Use the SOCKS proxy in the pop3 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 pop3 store
- Date: Thu, 13 May 2010 20:17:23 +0000 (UTC)
commit 1014a5516c4217b74096af7bf60dbe15e282ff17
Author: Federico Mena Quintero <federico novell com>
Date: Thu May 13 13:55:59 2010 -0500
Use the SOCKS proxy in the pop3 store
Signed-off-by: Federico Mena Quintero <federico novell com>
camel/providers/pop3/camel-pop3-store.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index c81f88d..08efed9 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -173,6 +173,9 @@ static gboolean
connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, CamelException *ex)
{
CamelPOP3Store *store = CAMEL_POP3_STORE (service);
+ CamelSession *session;
+ gchar *socks_host;
+ gint socks_port;
CamelStream *tcp_stream;
CamelPOP3Command *pc;
guint32 flags = 0;
@@ -197,6 +200,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 ((ret = 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]