# HG changeset patch # User Richard Laager # Date 1180119003 0 # Node ID 3939bfca572e897e749ebc405a74b8dc4d7dfb9c # Parent c155b0496161a4f4c1cd815c5535cd795aa80cd0# Parent d5f07d1e37e69d42622182fabdd05a82cf2fce37 merge of '63c69ee29386e7f15e24deaf98c667102057dd4b' and '75c57b7e6ba659cb3ad1d5b080c7ab0d4f02b640' diff -r c155b0496161 -r 3939bfca572e libpurple/plugins/ssl/ssl-gnutls.c --- a/libpurple/plugins/ssl/ssl-gnutls.c Fri May 25 18:31:16 2007 +0000 +++ b/libpurple/plugins/ssl/ssl-gnutls.c Fri May 25 18:50:03 2007 +0000 @@ -123,6 +123,18 @@ gnutls_data->handshake_handler = purple_input_add(gsc->fd, PURPLE_INPUT_READ, ssl_gnutls_handshake_cb, gsc); + /* Orborde asks: Why are we configuring a callback, then + immediately calling it? + + Answer: gnutls_handshake (up in handshake_cb) needs to be called + once in order to get the ball rolling on the SSL connection. + Once it has done so, only then will the server reply, triggering + the callback. + + Since the logic driving gnutls_handshake is the same with the first + and subsequent calls, we'll just fire the callback immediately to + accomplish this. + */ ssl_gnutls_handshake_cb(gsc, gsc->fd, PURPLE_INPUT_READ); } diff -r c155b0496161 -r 3939bfca572e libpurple/sslconn.h --- a/libpurple/sslconn.h Fri May 25 18:31:16 2007 +0000 +++ b/libpurple/sslconn.h Fri May 25 18:50:03 2007 +0000 @@ -170,6 +170,7 @@ /** * Adds an input watcher for the specified SSL connection. + * Once the SSL handshake is complete, use this to watch for actual data across it. * * @param gsc The SSL connection handle. * @param func The callback function.