Changeset 8a2221a7
- Timestamp:
- 2008-03-23T14:29:19Z (17 years ago)
- Branches:
- master
- Children:
- dd14ecc
- Parents:
- 851a8c2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/ssl_client.h
r851a8c2 r8a2221a7 60 60 G_MODULE_EXPORT int ssl_write( void *conn, const char *buf, int len ); 61 61 62 /* See ssl_openssl.c for an explanation. */ 63 G_MODULE_EXPORT int ssl_pending( void *conn ); 64 62 65 /* Abort the SSL connection and disconnect the socket. Do not use close() 63 66 directly, both the SSL library and the peer will be unhappy! */ -
lib/ssl_gnutls.c
r851a8c2 r8a2221a7 211 211 } 212 212 213 /* See ssl_openssl.c for an explanation. */ 214 int ssl_pending( void *conn ) 215 { 216 return 0; 217 } 218 213 219 void ssl_disconnect( void *conn_ ) 214 220 { -
lib/ssl_nss.c
r851a8c2 r8a2221a7 169 169 } 170 170 171 /* See ssl_openssl.c for an explanation. */ 172 int ssl_pending( void *conn ) 173 { 174 return 0; 175 } 176 171 177 void ssl_disconnect( void *conn_ ) 172 178 { -
lib/ssl_openssl.c
r851a8c2 r8a2221a7 62 62 63 63 conn->fd = proxy_connect( host, port, ssl_connected, conn ); 64 if( conn->fd < 0 ) 65 { 66 g_free( conn ); 67 return NULL; 68 } 69 64 70 conn->func = func; 65 71 conn->data = data; 66 72 conn->inpa = -1; 67 68 if( conn->fd < 0 )69 {70 g_free( conn );71 return NULL;72 }73 73 74 74 return conn; … … 231 231 } 232 232 233 /* Only OpenSSL *really* needs this (and well, maybe NSS). See for more info: 234 http://www.gnu.org/software/gnutls/manual/gnutls.html#index-gnutls_005frecord_005fcheck_005fpending-209 235 http://www.openssl.org/docs/ssl/SSL_pending.html 236 237 Required because OpenSSL empties the TCP buffer completely but doesn't 238 necessarily give us all the unencrypted data. 239 240 Returns 0 if there's nothing left or if we don't have to care (GnuTLS), 241 1 if there's more data. */ 242 int ssl_pending( void *conn ) 243 { 244 return ( ((struct scd*)conn) && ((struct scd*)conn)->established ) ? 245 SSL_pending( ((struct scd*)conn)->ssl ) > 0 : 0; 246 } 247 233 248 void ssl_disconnect( void *conn_ ) 234 249 { -
protocols/jabber/io.c
r851a8c2 r8a2221a7 241 241 } 242 242 243 /* EAGAIN/etc or a successful read. */ 244 return TRUE; 243 if( ssl_pending( jd->ssl ) ) 244 /* OpenSSL empties the TCP buffers completely but may keep some 245 data in its internap buffers. select() won't see that, but 246 ssl_pending() does. */ 247 return jabber_read_callback( data, fd, cond ); 248 else 249 return TRUE; 245 250 } 246 251
Note: See TracChangeset
for help on using the changeset viewer.