Changeset 80acb6d
- Timestamp:
- 2011-11-14T10:43:03Z (13 years ago)
- Branches:
- master
- Children:
- 5dd725d
- Parents:
- 03a8f8e
- Location:
- lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/http_client.c
r03a8f8e r80acb6d 240 240 http_incoming_data, req ); 241 241 242 return FALSE; 242 if( ssl_pending( req->ssl ) ) 243 return http_incoming_data( data, source, cond ); 244 else 245 return FALSE; 243 246 244 247 got_reply: -
lib/ssl_client.h
r03a8f8e r80acb6d 63 63 G_MODULE_EXPORT int ssl_write( void *conn, const char *buf, int len ); 64 64 65 /* See ssl_openssl.c for an explanation. */ 65 /* Now needed by most SSL libs. See for more info: 66 http://www.gnu.org/software/gnutls/manual/gnutls.html#index-gnutls_005frecord_005fcheck_005fpending-209 67 http://www.openssl.org/docs/ssl/SSL_pending.html 68 69 Required because OpenSSL empties the TCP buffer completely but doesn't 70 necessarily give us all the unencrypted data. Or maybe you didn't ask 71 for all of it because your buffer is too small. 72 73 Returns 0 if there's nothing left, 1 if there's more data. */ 66 74 G_MODULE_EXPORT int ssl_pending( void *conn ); 67 75 -
lib/ssl_gnutls.c
r03a8f8e r80acb6d 135 135 gnutls_certificate_allocate_credentials( &conn->xcred ); 136 136 gnutls_init( &conn->session, GNUTLS_CLIENT ); 137 gnutls_transport_set_lowat( conn->session, 1 ); 137 #if GNUTLS_VERSION_NUMBER < 0x020c00 138 gnutls_transport_set_lowat( conn->session, 0 ); 139 #endif 138 140 gnutls_set_default_priority( conn->session ); 139 141 gnutls_credentials_set( conn->session, GNUTLS_CRD_CERTIFICATE, conn->xcred ); … … 187 189 { 188 190 ssl_errno = SSL_NOHANDSHAKE; 189 return ( -1 );191 return -1; 190 192 } 191 193 … … 208 210 { 209 211 ssl_errno = SSL_NOHANDSHAKE; 210 return ( -1 );212 return -1; 211 213 } 212 214 … … 222 224 } 223 225 224 /* See ssl_openssl.c for an explanation. */225 226 int ssl_pending( void *conn ) 226 227 { 227 return 0; 228 if( conn == NULL ) 229 return 0; 230 231 if( !((struct scd*)conn)->established ) 232 { 233 ssl_errno = SSL_NOHANDSHAKE; 234 return 0; 235 } 236 237 return gnutls_record_check_pending( ((struct scd*)conn)->session ) != 0; 228 238 } 229 239 -
lib/ssl_nss.c
r03a8f8e r80acb6d 207 207 } 208 208 209 /* See ssl_openssl.c for an explanation. */210 209 int ssl_pending( void *conn ) 211 210 { -
lib/ssl_openssl.c
r03a8f8e r80acb6d 241 241 } 242 242 243 /* Only OpenSSL *really* needs this (and well, maybe NSS). See for more info:244 http://www.gnu.org/software/gnutls/manual/gnutls.html#index-gnutls_005frecord_005fcheck_005fpending-209245 http://www.openssl.org/docs/ssl/SSL_pending.html246 247 Required because OpenSSL empties the TCP buffer completely but doesn't248 necessarily give us all the unencrypted data.249 250 Returns 0 if there's nothing left or if we don't have to care (GnuTLS),251 1 if there's more data. */252 243 int ssl_pending( void *conn ) 253 244 {
Note: See TracChangeset
for help on using the changeset viewer.