[evolution-data-server] Debug info for read/write/close on the SSL stream



commit 2948706d1488673496cf6c74ffeb4929314297a6
Author: Federico Mena Quintero <federico novell com>
Date:   Wed Jun 2 13:51:20 2010 -0500

    Debug info for read/write/close on the SSL stream
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 camel/camel-tcp-stream-ssl.c |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 41ca11a..8ffc1c9 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -269,8 +269,15 @@ tcp_stream_ssl_read (CamelStream *stream,
                      gsize n)
 {
 	CamelTcpStreamSSL *ssl = CAMEL_TCP_STREAM_SSL (stream);
+	gssize result;
 
-	return read_from_prfd (ssl->priv->sockfd, buffer, n);
+	d (g_print ("SSL stream %p: reading %" G_GSIZE_FORMAT " bytes...\n", ssl, n));
+
+	result = read_from_prfd (ssl->priv->sockfd, buffer, n);
+
+	d (g_print ("SSL stream %p: read %" G_GSSIZE_FORMAT " bytes, errno = %d\n", ssl, result, result == -1 ? errno : 0));
+
+	return result;
 }
 
 static gssize
@@ -373,8 +380,15 @@ tcp_stream_ssl_write (CamelStream *stream,
                       gsize n)
 {
 	CamelTcpStreamSSL *ssl = CAMEL_TCP_STREAM_SSL (stream);
+	gssize result;
+
+	d (g_print ("SSL stream %p: writing %" G_GSIZE_FORMAT " bytes...\n", ssl, n));
 
-	return write_to_prfd (ssl->priv->sockfd, buffer, n);
+	result = write_to_prfd (ssl->priv->sockfd, buffer, n);
+
+	d (g_print ("SSL stream %p: wrote %" G_GSSIZE_FORMAT " bytes, errno = %d\n", ssl, result, result == -1 ? errno : 0));
+
+	return result;
 }
 
 static gint
@@ -387,6 +401,8 @@ tcp_stream_ssl_flush (CamelStream *stream)
 static gint
 tcp_stream_ssl_close (CamelStream *stream)
 {
+	d (g_print ("SSL stream %p: closing\n", stream));
+
 	if (((CamelTcpStreamSSL *)stream)->priv->sockfd == NULL) {
 		errno = EINVAL;
 		return -1;
@@ -1107,7 +1123,7 @@ connect_to_socks4_proxy (CamelTcpStreamSSL *ssl, const gchar *proxy_host, gint p
 
 	g_assert (proxy_host != NULL);
 
-	d (g_print ("SSL: connecting to SOCKS4 proxy %s:%d {\n  resolving proxy host\n", proxy_host, proxy_port));
+	d (g_print ("SSL stream %p: connecting to SOCKS4 proxy %s:%d {\n  resolving proxy host\n", ssl, proxy_host, proxy_port));
 
 	sprintf (serv, "%d", proxy_port);
 



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