Changeset 7885d0f


Ignore:
Timestamp:
2010-07-15T23:23:04Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
516a9c6
Parents:
e4e0b37
Message:

Don't be a dumbass and stop following redirects if there doesn't seem to
be an end.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/http_client.c

    re4e0b37 r7885d0f  
    6767        req->request = g_strdup( request );
    6868        req->request_length = strlen( request );
     69        req->redir_ttl = 3;
    6970       
    7071        return( req );
     
    311312        }
    312313       
    313         if( req->status_code == 301 || req->status_code == 302 )
     314        if( ( req->status_code == 301 || req->status_code == 302 ) && req->redir_ttl-- > 0 )
    314315        {
    315316                char *loc, *new_request, *new_host;
  • lib/http_client.h

    re4e0b37 r7885d0f  
    6161        int finished;           /* Set to non-0 if the request was completed
    6262                                   successfully. */
     63        int redir_ttl;          /* You can set it to 0 if you don't want
     64                                   http_client to follow them. */
    6365       
    6466        http_input_function func;
Note: See TracChangeset for help on using the changeset viewer.