Changeset 80acb6d for lib/ssl_gnutls.c


Ignore:
Timestamp:
2011-11-14T10:43:03Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
5dd725d
Parents:
03a8f8e
Message:

GnuTLS now also needs ssl_pending() implemented. Bug #860.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/ssl_gnutls.c

    r03a8f8e r80acb6d  
    135135        gnutls_certificate_allocate_credentials( &conn->xcred );
    136136        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
    138140        gnutls_set_default_priority( conn->session );
    139141        gnutls_credentials_set( conn->session, GNUTLS_CRD_CERTIFICATE, conn->xcred );
     
    187189        {
    188190                ssl_errno = SSL_NOHANDSHAKE;
    189                 return( -1 );
     191                return -1;
    190192        }
    191193       
     
    208210        {
    209211                ssl_errno = SSL_NOHANDSHAKE;
    210                 return( -1 );
     212                return -1;
    211213        }
    212214       
     
    222224}
    223225
    224 /* See ssl_openssl.c for an explanation. */
    225226int ssl_pending( void *conn )
    226227{
    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;
    228238}
    229239
Note: See TracChangeset for help on using the changeset viewer.