Ignore:
Timestamp:
2006-06-21T16:34:33Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
59f5c42a
Parents:
3af70b0 (diff), df417ca (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:

Merging libevent branch: Events can now be handles by both glib and libevent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/ssl_openssl.c

    r3af70b0 rb72caac  
    5252};
    5353
    54 static void ssl_connected( gpointer data, gint source, GaimInputCondition cond );
    55 
     54static gboolean ssl_connected( gpointer data, gint source, b_input_condition cond );
    5655
    5756
     
    9594}
    9695
    97 static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond );
    98 
    99 static void ssl_connected( gpointer data, gint source, GaimInputCondition cond )
     96static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond );
     97
     98static gboolean ssl_connected( gpointer data, gint source, b_input_condition cond )
    10099{
    101100        struct scd *conn = data;
     
    104103                return ssl_handshake( data, -1, cond );
    105104       
    106         /* Make it non-blocking at least during the handshake... */
     105        /* We can do at least the handshake with non-blocking I/O */
    107106        sock_make_nonblocking( conn->fd );
    108107        SSL_set_fd( conn->ssl, conn->fd );
     
    111110}       
    112111
    113 static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond )
     112static gboolean ssl_handshake( gpointer data, gint source, b_input_condition cond )
    114113{
    115114        struct scd *conn = data;
    116115        int st;
    117        
    118         if( conn->inpa != -1 )
    119         {
    120                 gaim_input_remove( conn->inpa );
    121                 conn->inpa = -1;
    122         }
    123116       
    124117        if( ( st = SSL_connect( conn->ssl ) ) < 0 )
     
    128121                        goto ssl_connected_failure;
    129122               
    130                 conn->inpa = gaim_input_add( conn->fd, ssl_getdirection( conn ), ssl_handshake, data );
    131                 return;
     123                conn->inpa = b_input_add( conn->fd, ssl_getdirection( conn ), ssl_handshake, data );
     124                return FALSE;
    132125        }
    133126       
     
    135128        sock_make_blocking( conn->fd );         /* For now... */
    136129        conn->func( conn->data, conn, cond );
    137         return;
     130        return FALSE;
    138131       
    139132ssl_connected_failure:
     
    151144        if( source >= 0 ) closesocket( source );
    152145        g_free( conn );
     146       
     147        return FALSE;
    153148}
    154149
     
    204199       
    205200        if( conn->inpa != -1 )
    206                 gaim_input_remove( conn->inpa );
     201                b_event_remove( conn->inpa );
    207202       
    208203        if( conn->established )
     
    221216}
    222217
    223 GaimInputCondition ssl_getdirection( void *conn )
     218b_input_condition ssl_getdirection( void *conn )
    224219{
    225220        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.