Changeset 1167


Ignore:
Timestamp:
Dec 7, 2006, 7:08:45 PM (15 years ago)
Author:
livings124
Message:

patch to avoid scraping if response code 4xx is received

Location:
branches/multitracker/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/multitracker/libtransmission/http.h

    r920 r1167  
    3737int         tr_httpResponseCode( const char * data, int len );
    3838
    39 #define TR_HTTP_STATUS_OK( st )       ( 200 <= (st) && 299 >= (st) )
    40 #define TR_HTTP_STATUS_REDIRECT( st ) ( 300 <= (st) && 399 >= (st) )
    41 #define TR_HTTP_STATUS_FAIL( st )     ( 400 <= (st) && 599 >= (st) )
     39#define TR_HTTP_STATUS_OK( st )             ( 200 <= (st) && 299 >= (st) )
     40#define TR_HTTP_STATUS_REDIRECT( st )       ( 300 <= (st) && 399 >= (st) )
     41#define TR_HTTP_STATUS_FAIL( st )           ( 400 <= (st) && 599 >= (st) )
     42#define TR_HTTP_STATUS_FAIL_CLIENT( st )    ( 400 <= (st) && 499 >= (st) )
     43#define TR_HTTP_STATUS_FAIL_SERVER( st )    ( 500 <= (st) && 599 >= (st) )
    4244
    4345/*
  • branches/multitracker/libtransmission/tracker.c

    r1164 r1167  
    763763        /* we didn't get a 2xx status code */
    764764        tr_err( "Scrape: invalid HTTP status code: %i", code );
     765        if( TR_HTTP_STATUS_FAIL_CLIENT( code ) )
     766            tc->tor->info.trackerCanScrape = 0;
    765767        tc->lastScrapeFailed = 1;
    766768        return;
Note: See TracChangeset for help on using the changeset viewer.