- Timestamp:
- 2006-10-02T13:19:13Z (18 years ago)
- Branches:
- master
- Children:
- d9282b4
- Parents:
- 88591fd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/ssl_gnutls.c
r88591fd rc1ed6527 49 49 50 50 static gboolean ssl_connected( gpointer data, gint source, b_input_condition cond ); 51 static gboolean ssl_starttls_real( gpointer data, gint source, b_input_condition cond ); 52 static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond ); 51 53 52 54 … … 69 71 } 70 72 71 /* FIXME: It can happen that the handshake fails even before ssl_connected()72 returns already. This function will then return an invalid pointer because73 these failures can't be detected properly yet. Maybe ssl_connected()74 shouldn't be called directly, but via a short timeout? */75 73 void *ssl_starttls( int fd, ssl_input_function func, gpointer data ) 76 74 { … … 82 80 conn->inpa = -1; 83 81 84 ssl_connected( conn, fd, GAIM_INPUT_WRITE ); 82 /* This function should be called via a (short) timeout instead of 83 directly from here, because these SSL calls are *supposed* to be 84 *completely* asynchronous and not ready yet when this function 85 (or *_connect, for examle) returns. Also, errors are reported via 86 the callback function, not via this function's return value. 87 88 In short, doing things like this makes the rest of the code a lot 89 simpler. */ 90 91 b_timeout_add( 1, ssl_starttls_real, conn ); 85 92 86 93 return conn; 87 94 } 88 95 89 static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond ); 96 static gboolean ssl_starttls_real( gpointer data, gint source, b_input_condition cond ) 97 { 98 struct scd *conn = data; 99 100 return ssl_connected( conn, conn->fd, GAIM_INPUT_WRITE ); 101 } 90 102 91 103 static gboolean ssl_connected( gpointer data, gint source, b_input_condition cond )
Note: See TracChangeset
for help on using the changeset viewer.