[evolution-data-server/camel-socks-proxy-master] Add function to replace CamelTcpStreamRaw's sockfd with another one



commit a34e6b6641dfa4aade0805ff7bb0ea78a97dabf7
Author: Federico Mena Quintero <federico novell com>
Date:   Thu Jul 15 16:01:20 2010 -0500

    Add function to replace CamelTcpStreamRaw's sockfd with another one
    
    We need this in the TcpSSL stream to replace the normal socket with
    the SSL-ified one.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 camel/camel-tcp-stream-raw.c |    8 ++++++++
 camel/camel-tcp-stream-raw.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index a6a337e..f64c148 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -997,6 +997,14 @@ tcp_stream_raw_get_file_desc (CamelTcpStream *stream)
 	return priv->sockfd;
 }
 
+void
+_camel_tcp_stream_raw_replace_file_desc (CamelTcpStreamRaw *raw, PRFileDesc *new_file_desc)
+{
+	CamelTcpStreamRawPrivate *priv = raw->priv;
+
+	priv->sockfd = new_file_desc;
+}
+
 #define CAMEL_TCP_STREAM_RAW_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
 	((obj), CAMEL_TYPE_TCP_STREAM_RAW, CamelTcpStreamRawPrivate))
diff --git a/camel/camel-tcp-stream-raw.h b/camel/camel-tcp-stream-raw.h
index 8ea1d79..f87a638 100644
--- a/camel/camel-tcp-stream-raw.h
+++ b/camel/camel-tcp-stream-raw.h
@@ -68,6 +68,8 @@ GType camel_tcp_stream_raw_get_type (void);
 /* public methods */
 CamelStream *camel_tcp_stream_raw_new (void);
 
+void _camel_tcp_stream_raw_replace_file_desc (CamelTcpStreamRaw *raw, PRFileDesc *new_file_desc);
+
 void _set_errno_from_pr_error (gint pr_code);
 
 G_END_DECLS



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