Changeset 632f3d4


Ignore:
Timestamp:
2012-04-10T09:14:58Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
58b65b33, 6d23c68
Parents:
9b767e9
Message:

Work-around for what turned out to be a GnuTLS bug (#938). From 3.0.13
until 3.0.18 gnutls_record_check_pending() returns non-0 even if the data
read so far is an incomplete record and can not yet be read. This can get
BitlBee's http_client stuck in a semi-infinite loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/ssl_gnutls.c

    r9b767e9 r632f3d4  
    6969static void ssl_deinit( void );
    7070
     71static void ssl_log( int level, const char *line )
     72{
     73        printf( "%d %s", level, line );
     74}
     75
    7176void ssl_init( void )
    7277{
     
    8489        }
    8590        initialized = TRUE;
     91       
     92        gnutls_global_set_log_function( ssl_log );
     93        /*
     94        gnutls_global_set_log_level( 3 );
     95        */
    8696       
    8797        atexit( ssl_deinit );
     
    367377                return 0;
    368378        }
     379
     380#if GNUTLS_VERSION_NUMBER >= 0x03000d && GNUTLS_VERSION_NUMBER <= 0x030012
     381        if( ssl_errno == SSL_AGAIN )
     382                return 0;
     383#endif
    369384       
    370385        return gnutls_record_check_pending( ((struct scd*)conn)->session ) != 0;
Note: See TracChangeset for help on using the changeset viewer.