Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/ssl_openssl.c

    r19ac9c5 r26fdfc5  
    5252};
    5353
    54 static gboolean ssl_connected( gpointer data, gint source, b_input_condition cond );
     54static void ssl_connected( gpointer data, gint source, GaimInputCondition cond );
     55
    5556
    5657
     
    9495}
    9596
    96 static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond );
    97 
    98 static gboolean ssl_connected( gpointer data, gint source, b_input_condition cond )
     97static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond );
     98
     99static void ssl_connected( gpointer data, gint source, GaimInputCondition cond )
    99100{
    100101        struct scd *conn = data;
     
    103104                return ssl_handshake( data, -1, cond );
    104105       
    105         /* We can do at least the handshake with non-blocking I/O */
     106        /* Make it non-blocking at least during the handshake... */
    106107        sock_make_nonblocking( conn->fd );
    107108        SSL_set_fd( conn->ssl, conn->fd );
     
    110111}       
    111112
    112 static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond )
     113static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond )
    113114{
    114115        struct scd *conn = data;
    115116        int st;
     117       
     118        if( conn->inpa != -1 )
     119        {
     120                gaim_input_remove( conn->inpa );
     121                conn->inpa = -1;
     122        }
    116123       
    117124        if( ( st = SSL_connect( conn->ssl ) ) < 0 )
     
    121128                        goto ssl_connected_failure;
    122129               
    123                 conn->inpa = b_input_add( conn->fd, ssl_getdirection( conn ), ssl_handshake, data );
    124                 return FALSE;
     130                conn->inpa = gaim_input_add( conn->fd, ssl_getdirection( conn ), ssl_handshake, data );
     131                return;
    125132        }
    126133       
     
    128135        sock_make_blocking( conn->fd );         /* For now... */
    129136        conn->func( conn->data, conn, cond );
    130         return FALSE;
     137        return;
    131138       
    132139ssl_connected_failure:
     
    144151        if( source >= 0 ) closesocket( source );
    145152        g_free( conn );
    146        
    147         return FALSE;
    148153}
    149154
     
    199204       
    200205        if( conn->inpa != -1 )
    201                 b_event_remove( conn->inpa );
     206                gaim_input_remove( conn->inpa );
    202207       
    203208        if( conn->established )
     
    216221}
    217222
    218 b_input_condition ssl_getdirection( void *conn )
     223GaimInputCondition ssl_getdirection( void *conn )
    219224{
    220225        return( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ? GAIM_INPUT_WRITE : GAIM_INPUT_READ );
Note: See TracChangeset for help on using the changeset viewer.