[evolution-data-server/camel-socks-proxy] Implement ::get_file_desc() in CamelTcpStreamSSL



commit 629e42804cbd7dd713185e6022de3fbb01922be3
Author: Federico Mena Quintero <federico novell com>
Date:   Wed Jul 14 16:15:23 2010 -0500

    Implement ::get_file_desc() in CamelTcpStreamSSL
    
    This lets us get rid of camel_tcp_stream_ssl_sockfd(), in favor
    of camel_tcp_stream_get_file_desc().
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 camel/camel-tcp-stream-ssl.c               |   18 +++++++-----------
 camel/camel-tcp-stream-ssl.h               |    2 --
 camel/providers/imapx/camel-imapx-server.c |    2 +-
 3 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index e48fdf0..cec0dac 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -84,6 +84,7 @@ static gint stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
 static gint stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
 static struct sockaddr *stream_get_local_address (CamelTcpStream *stream, socklen_t *len);
 static struct sockaddr *stream_get_remote_address (CamelTcpStream *stream, socklen_t *len);
+static PRFileDesc *stream_get_file_desc (CamelTcpStream *stream);
 
 struct _CamelTcpStreamSSLPrivate {
 	PRFileDesc *sockfd;
@@ -115,6 +116,7 @@ camel_tcp_stream_ssl_class_init (CamelTcpStreamSSLClass *camel_tcp_stream_ssl_cl
 	camel_tcp_stream_class->setsockopt = stream_setsockopt;
 	camel_tcp_stream_class->get_local_address  = stream_get_local_address;
 	camel_tcp_stream_class->get_remote_address = stream_get_remote_address;
+	camel_tcp_stream_class->get_file_desc = stream_get_file_desc;
 }
 
 static void
@@ -1511,18 +1513,12 @@ stream_get_remote_address (CamelTcpStream *stream, socklen_t *len)
 	return sockaddr_from_praddr(&addr, len);
 }
 
-/**
- * camel_tcp_stream_ssl_sockfd:
- * @stream: a #CamelTcpStreamSSL
- *
- * FIXME Document me!
- *
- * Since: 2.30
- **/
-PRFileDesc *
-camel_tcp_stream_ssl_sockfd (CamelTcpStreamSSL *stream)
+static PRFileDesc *
+stream_get_file_desc (CamelTcpStream *stream)
 {
-	return stream->priv->sockfd;
+	CamelTcpStreamSSL *ssl = CAMEL_TCP_STREAM_SSL (stream);
+
+	return ssl->priv->sockfd;
 }
 
 #endif /* HAVE_NSS */
diff --git a/camel/camel-tcp-stream-ssl.h b/camel/camel-tcp-stream-ssl.h
index f4060a3..352e0f4 100644
--- a/camel/camel-tcp-stream-ssl.h
+++ b/camel/camel-tcp-stream-ssl.h
@@ -62,8 +62,6 @@ CamelStream *camel_tcp_stream_ssl_new_raw (struct _CamelSession *session, const
 
 gint camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *ssl);
 
-PRFileDesc * camel_tcp_stream_ssl_sockfd (CamelTcpStreamSSL *stream);
-
 G_END_DECLS
 
 #endif /* CAMEL_TCP_STREAM_SSL_H */
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 6b559cb..87ca7ac 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -4237,7 +4237,7 @@ imapx_parser_thread (gpointer d)
 			PRPollDesc pollfds[2] = { };
 			gint res;
 
-			pollfds[0].fd = camel_tcp_stream_ssl_sockfd ((CamelTcpStreamSSL *)is->stream->source);
+			pollfds[0].fd = camel_tcp_stream_get_file_desc (CAMEL_TCP_STREAM (is->stream->source));
 			pollfds[0].in_flags = PR_POLL_READ;
 			pollfds[1].fd = camel_operation_cancel_prfd (op);
 			pollfds[1].in_flags = PR_POLL_READ;



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