- Timestamp:
- 2010-11-20T15:13:40Z (14 years ago)
- Branches:
- master
- Children:
- 1074806
- Parents:
- 6d544a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/ssl_nss.c
r6d544a1 ref043d3 34 34 #include <sslproto.h> 35 35 #include <nss.h> 36 #include <pk11pub.h> 36 37 #include <private/pprio.h> 37 38 #include <ssl.h> 39 #include <seccomon.h> 38 40 #include <secerr.h> 39 41 #include <sslerr.h> … … 53 55 54 56 static gboolean ssl_connected( gpointer data, gint source, b_input_condition cond ); 57 static gboolean ssl_starttls_real( gpointer data, gint source, b_input_condition cond ); 55 58 56 59 … … 122 125 } 123 126 127 static gboolean ssl_starttls_real( gpointer data, gint source, b_input_condition cond ) 128 { 129 struct scd *conn = data; 130 131 return ssl_connected( conn, conn->fd, B_EV_IO_WRITE ); 132 } 133 134 void *ssl_starttls( int fd, ssl_input_function func, gpointer data ) 135 { 136 struct scd *conn = g_new0( struct scd, 1 ); 137 138 conn->fd = fd; 139 conn->func = func; 140 conn->data = data; 141 142 /* This function should be called via a (short) timeout instead of 143 directly from here, because these SSL calls are *supposed* to be 144 *completely* asynchronous and not ready yet when this function 145 (or *_connect, for examle) returns. Also, errors are reported via 146 the callback function, not via this function's return value. 147 148 In short, doing things like this makes the rest of the code a lot 149 simpler. */ 150 151 b_timeout_add( 1, ssl_starttls_real, conn ); 152 153 return conn; 154 } 155 124 156 static gboolean ssl_connected( gpointer data, gint source, b_input_condition cond ) 125 157 {
Note: See TracChangeset
for help on using the changeset viewer.