[evolution-data-server/camel-socks-proxy] Use the SOCKS proxy in the nntp 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 nntp store
- Date: Thu, 13 May 2010 20:17:43 +0000 (UTC)
commit 8a8dc0a0f6fbeec6bf8e296aa336ced751c41657
Author: Federico Mena Quintero <federico novell com>
Date: Thu May 13 14:47:20 2010 -0500
Use the SOCKS proxy in the nntp store
Signed-off-by: Federico Mena Quintero <federico novell com>
camel/providers/nntp/camel-nntp-store.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index 6e20bff..e86ac5d 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -162,6 +162,9 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
{
CamelNNTPStore *store = (CamelNNTPStore *) service;
CamelDiscoStore *disco_store = (CamelDiscoStore*) service;
+ CamelSession *session;
+ char *socks_host;
+ int socks_port;
CamelStream *tcp_stream;
gboolean retval = FALSE;
guchar *buf;
@@ -188,6 +191,14 @@ connect_to_server (CamelService *service, struct addrinfo *ai, gint ssl_mode, Ca
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]