Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/http_client.c

    re046390 r516a9c6  
    3535static gboolean http_ssl_connected( gpointer data, void *source, b_input_condition cond );
    3636static gboolean http_incoming_data( gpointer data, int source, b_input_condition cond );
    37 
    38 
    39 void *http_dorequest( char *host, int port, int ssl, char *request, http_input_function func, gpointer data )
     37static void http_free( struct http_request *req );
     38
     39
     40struct http_request *http_dorequest( char *host, int port, int ssl, char *request, http_input_function func, gpointer data )
    4041{
    4142        struct http_request *req;
     
    6768        req->request = g_strdup( request );
    6869        req->request_length = strlen( request );
     70        req->redir_ttl = 3;
    6971       
    7072        return( req );
    7173}
    7274
    73 void *http_dorequest_url( char *url_string, http_input_function func, gpointer data )
     75struct http_request *http_dorequest_url( char *url_string, http_input_function func, gpointer data )
    7476{
    7577        url_t *url = g_new0( url_t, 1 );
     
    149151        if( req->bytes_written < req->request_length )
    150152                req->inpa = b_input_add( source,
    151                                          req->ssl ? ssl_getdirection( req->ssl ) : B_EV_IO_WRITE,
     153                                         req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_WRITE,
    152154                                         http_connected, req );
    153155        else
    154                 req->inpa = b_input_add( source, B_EV_IO_READ, http_incoming_data, req );
     156                req->inpa = b_input_add( source, GAIM_INPUT_READ, http_incoming_data, req );
    155157       
    156158        return FALSE;
     
    234236        /* There will be more! */
    235237        req->inpa = b_input_add( req->fd,
    236                                  req->ssl ? ssl_getdirection( req->ssl ) : B_EV_IO_READ,
     238                                 req->ssl ? ssl_getdirection( req->ssl ) : GAIM_INPUT_READ,
    237239                                 http_incoming_data, req );
    238240       
     
    311313        }
    312314       
    313         if( req->status_code == 301 || req->status_code == 302 )
     315        if( ( req->status_code == 301 || req->status_code == 302 ) && req->redir_ttl-- > 0 )
    314316        {
    315317                char *loc, *new_request, *new_host;
     
    445447}
    446448
    447 void http_free( struct http_request *req )
     449static void http_free( struct http_request *req )
    448450{
    449451        g_free( req->request );
Note: See TracChangeset for help on using the changeset viewer.