Changeset 6738a67 for lib/ssl_openssl.c


Ignore:
Timestamp:
2008-07-16T23:22:52Z (17 years ago)
Author:
Sven Moritz Hallberg <pesco@…>
Branches:
master
Children:
9b55485
Parents:
9730d72 (diff), 6a78c0e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge in latest trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/ssl_openssl.c

    r9730d72 r6738a67  
    6868       
    6969        conn->fd = proxy_connect( host, port, ssl_connected, conn );
     70        if( conn->fd < 0 )
     71        {
     72                g_free( conn );
     73                return NULL;
     74        }
     75       
    7076        conn->func = func;
    7177        conn->data = data;
    7278        conn->inpa = -1;
    73        
    74         if( conn->fd < 0 )
    75         {
    76                 g_free( conn );
    77                 return NULL;
    78         }
    7979       
    8080        return conn;
     
    236236}
    237237
     238/* Only OpenSSL *really* needs this (and well, maybe NSS). See for more info:
     239   http://www.gnu.org/software/gnutls/manual/gnutls.html#index-gnutls_005frecord_005fcheck_005fpending-209
     240   http://www.openssl.org/docs/ssl/SSL_pending.html
     241   
     242   Required because OpenSSL empties the TCP buffer completely but doesn't
     243   necessarily give us all the unencrypted data.
     244   
     245   Returns 0 if there's nothing left or if we don't have to care (GnuTLS),
     246   1 if there's more data. */
     247int ssl_pending( void *conn )
     248{
     249        return ( ((struct scd*)conn) && ((struct scd*)conn)->established ) ?
     250               SSL_pending( ((struct scd*)conn)->ssl ) > 0 : 0;
     251}
     252
    238253void ssl_disconnect( void *conn_ )
    239254{
Note: See TracChangeset for help on using the changeset viewer.