From a9df5de4af55791e4d4aeb3533bcc715e28c1512 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 16 Mar 2001 23:02:04 +0000 Subject: Print info about the issuer of the certificate. 2001-03-16 Jeffrey Stedfast * camel-tcp-stream-ssl.c (ssl_bad_cert): Print info about the issuer of the certificate. * providers/smtp/camel-smtp-transport.c (smtp_connect): Use camel_tcp_stream_get_socket(). * camel-tcp-stream-openssl.c (stream_get_socket): Implemented. * camel-tcp-stream-ssl.c (stream_get_socket): Implemented. * camel-tcp-stream-raw.c (stream_get_socket): Implemented. * camel-tcp-stream.c (camel_tcp_stream_get_socket): New function. svn path=/trunk/; revision=8764 --- camel/camel-tcp-stream.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'camel/camel-tcp-stream.c') diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c index f42fa0f1d5..acbd108212 100644 --- a/camel/camel-tcp-stream.c +++ b/camel/camel-tcp-stream.c @@ -33,6 +33,7 @@ static CamelStreamClass *parent_class = NULL; static int tcp_connect (CamelTcpStream *stream, struct hostent *host, int port); static int tcp_getsockopt (CamelTcpStream *stream, CamelSockOptData *data); static int tcp_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data); +static gpointer tcp_get_socket (CamelTcpStream *stream); static void camel_tcp_stream_class_init (CamelTcpStreamClass *camel_tcp_stream_class) @@ -46,6 +47,7 @@ camel_tcp_stream_class_init (CamelTcpStreamClass *camel_tcp_stream_class) camel_tcp_stream_class->connect = tcp_connect; camel_tcp_stream_class->getsockopt = tcp_getsockopt; camel_tcp_stream_class->setsockopt = tcp_setsockopt; + camel_tcp_stream_class->get_socket = tcp_get_socket; } static void @@ -150,3 +152,28 @@ camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *dat return CTS_CLASS (stream)->setsockopt (stream, data); } + + +static gpointer +tcp_get_socket (CamelTcpStream *stream) +{ + g_warning ("CamelTcpStream::get_socket called on default implementation\n"); + return NULL; +} + + +/** + * camel_tcp_stream_get_socket: + * @stream: tcp stream object + * + * Get the stream's socket. + * + * Return value: the stream's socket on success or NULL on failure. + **/ +gpointer +camel_tcp_stream_get_socket (CamelTcpStream *stream) +{ + g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), NULL); + + return CTS_CLASS (stream)->get_socket (stream); +} -- cgit