Ignore:
Timestamp:
2006-05-10T17:34:46Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
13cc96c
Parents:
67b6766
Message:

Moved everything to the BitlBee event handling API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/http_client.c

    r67b6766 rba9edaa  
    3232
    3333
    34 static void http_connected( gpointer data, int source, GaimInputCondition cond );
    35 static void http_ssl_connected( gpointer data, void *source, GaimInputCondition cond );
    36 static void http_incoming_data( gpointer data, int source, GaimInputCondition cond );
     34static gboolean http_connected( gpointer data, int source, b_input_condition cond );
     35static gboolean http_ssl_connected( gpointer data, void *source, b_input_condition cond );
     36static gboolean http_incoming_data( gpointer data, int source, b_input_condition cond );
    3737
    3838
     
    7373/* This one is actually pretty simple... Might get more calls if we can't write
    7474   the whole request at once. */
    75 static void http_connected( gpointer data, int source, GaimInputCondition cond )
     75static gboolean http_connected( gpointer data, int source, b_input_condition cond )
    7676{
    7777        struct http_request *req = data;
     
    8282       
    8383        if( req->inpa > 0 )
    84                 gaim_input_remove( req->inpa );
     84                b_event_remove( req->inpa );
    8585       
    8686        sock_make_nonblocking( req->fd );
     
    117117       
    118118        if( req->bytes_written < req->request_length )
    119                 req->inpa = gaim_input_add( source,
    120                                             req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_WRITE,
    121                                             http_connected, req );
    122         else
    123                 req->inpa = gaim_input_add( source, GAIM_INPUT_READ, http_incoming_data, req );
    124        
    125         return;
     119                req->inpa = b_input_add( source,
     120                                         req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_WRITE,
     121                                         http_connected, req );
     122        else
     123                req->inpa = b_input_add( source, GAIM_INPUT_READ, http_incoming_data, req );
     124       
     125        return FALSE;
    126126       
    127127error:
     
    131131        g_free( req );
    132132       
    133         return;
     133        return FALSE;
    134134}
    135135
    136 static void http_ssl_connected( gpointer data, void *source, GaimInputCondition cond )
     136static gboolean http_ssl_connected( gpointer data, void *source, b_input_condition cond )
    137137{
    138138        struct http_request *req = data;
     
    146146}
    147147
    148 static void http_incoming_data( gpointer data, int source, GaimInputCondition cond )
     148static gboolean http_incoming_data( gpointer data, int source, b_input_condition cond )
    149149{
    150150        struct http_request *req = data;
     
    155155       
    156156        if( req->inpa > 0 )
    157                 gaim_input_remove( req->inpa );
     157                b_event_remove( req->inpa );
    158158       
    159159        if( req->ssl )
     
    202202       
    203203        /* There will be more! */
    204         req->inpa = gaim_input_add( req->fd,
    205                                     req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_READ,
    206                                     http_incoming_data, req );
    207        
    208         return;
     204        req->inpa = b_input_add( req->fd,
     205                                 req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_READ,
     206                                 http_incoming_data, req );
     207       
     208        return FALSE;
    209209
    210210got_reply:
     
    362362                req->reply_headers = req->reply_body = NULL;
    363363               
    364                 return;
     364                return FALSE;
    365365        }
    366366       
     
    380380        g_free( req->reply_headers );
    381381        g_free( req );
     382       
     383        return FALSE;
    382384}
Note: See TracChangeset for help on using the changeset viewer.