# HG changeset patch # User William Ehlhardt # Date 1180115799 0 # Node ID c76bee45540a2d27300f75fc016dcdc1c152a290 # Parent a2edef5eb1b1f2dbb7e6c9f82edefeba58cc6302# Parent 42c2d75b3d3e113ac54f550e37058661c88d8cfa propagate from branch 'im.pidgin.pidgin' (head dc4f2ee34039521ae6a198fe7d62f4dca8a84589) to branch 'im.pidgin.soc.2007.certmgr' (head 9a820d4262a69cde7e03915f22c234b75f54cf5c) diff -r 42c2d75b3d3e -r c76bee45540a libpurple/plugins/ssl/ssl-gnutls.c --- a/libpurple/plugins/ssl/ssl-gnutls.c Fri May 25 16:17:50 2007 +0000 +++ b/libpurple/plugins/ssl/ssl-gnutls.c Fri May 25 17:56:39 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 42c2d75b3d3e -r c76bee45540a libpurple/sslconn.h --- a/libpurple/sslconn.h Fri May 25 16:17:50 2007 +0000 +++ b/libpurple/sslconn.h Fri May 25 17:56:39 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.