comparison libpurple/plugins/ssl/ssl-gnutls.c @ 17252:a2edef5eb1b1

- Document some weird-looking logic in the GnuTLS plugin.
author William Ehlhardt <williamehlhardt@gmail.com>
date Fri, 25 May 2007 05:22:25 +0000
parents 6531f1a2e1d7
children fe571cfcf225
comparison
equal deleted inserted replaced
17251:2d2c72f70e8c 17252:a2edef5eb1b1
121 gnutls_transport_set_ptr(gnutls_data->session, GINT_TO_POINTER(gsc->fd)); 121 gnutls_transport_set_ptr(gnutls_data->session, GINT_TO_POINTER(gsc->fd));
122 122
123 gnutls_data->handshake_handler = purple_input_add(gsc->fd, 123 gnutls_data->handshake_handler = purple_input_add(gsc->fd,
124 PURPLE_INPUT_READ, ssl_gnutls_handshake_cb, gsc); 124 PURPLE_INPUT_READ, ssl_gnutls_handshake_cb, gsc);
125 125
126 /* Orborde asks: Why are we configuring a callback, then
127 immediately calling it?
128
129 Answer: gnutls_handshake (up in handshake_cb) needs to be called
130 once in order to get the ball rolling on the SSL connection.
131 Once it has done so, only then will the server reply, triggering
132 the callback.
133
134 Since the logic driving gnutls_handshake is the same with the first
135 and subsequent calls, we'll just fire the callback immediately to
136 accomplish this.
137 */
126 ssl_gnutls_handshake_cb(gsc, gsc->fd, PURPLE_INPUT_READ); 138 ssl_gnutls_handshake_cb(gsc, gsc->fd, PURPLE_INPUT_READ);
127 } 139 }
128 140
129 static void 141 static void
130 ssl_gnutls_close(PurpleSslConnection *gsc) 142 ssl_gnutls_close(PurpleSslConnection *gsc)