Changeset dff732d for lib


Ignore:
Timestamp:
2011-11-12T15:49:52Z (8 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
03a8f8e
Parents:
dac74bd
Message:

Undoing old workaround for MSN troubles and added more proper fix. The
http_client module needs some refactoring though. Will do that later..
This should hopefully fix bug #850.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/http_client.c

    rdac74bd rdff732d  
    314314        }
    315315       
    316         if( ( req->status_code == 301 || req->status_code == 302 ) && req->redir_ttl-- > 0 )
     316        if( ( req->status_code >= 301 && req->status_code <= 303 ) && req->redir_ttl-- > 0 )
    317317        {
    318318                char *loc, *new_request, *new_host;
     
    375375                           going to use strcat(), whether you like it or not. :-) */
    376376                       
    377                         sprintf( new_request, "GET %s HTTP/1.0", url->file );
    378                        
    379                         s = strstr( req->request, "\r\n" );
    380                         if( s == NULL )
     377                        *s = 0;
     378                        sprintf( new_request, "%s %s HTTP/1.0\r\nHost: %s",
     379                                 req->status_code == 303 || req->request[0] == 'G' ? "GET" : "POST", url->file, url->host );
     380                        *s = ' ';
     381                       
     382                        if( !( ( s = strstr( req->request, "\r\nHost: " ) ) &&
     383                               ( s = strstr( s + strlen( "\r\nHost: " ), "\r\n" ) ) ) )
    381384                        {
    382385                                req->status_string = g_strdup( "Error while rebuilding request string" );
Note: See TracChangeset for help on using the changeset viewer.