Changeset 7651


Ignore:
Timestamp:
Jan 9, 2009, 7:24:40 PM (12 years ago)
Author:
charles
Message:

(trunk libT) undo r7645 based on feedback that the experimental code did improve performance.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/web.c

    r7645 r7651  
    2525#include "web.h"
    2626
    27 enum 
     27enum
    2828{
    2929    /* arbitrary number */
    30     MAX_CONCURRENT_TASKS = 24,
     30    MAX_CONCURRENT_TASKS = 100,
    3131
    3232    /* arbitrary number */
    33     DEFAULT_TIMER_MSEC = 2000
     33    DEFAULT_TIMER_MSEC = 2500
    3434};
    3535
     
    5050struct tr_web
    5151{
    52     tr_bool isClosing;
     52    tr_bool closing;
    5353    int prev_running;
    5454    int still_running;
     
    5656    CURLM * multi;
    5757    tr_session * session;
     58#if 0
    5859    tr_list * easy_queue;
     60#endif
    5961    struct event timer_event;
    6062};
     
    124126        }
    125127
    126         curl_easy_setopt( easy, CURLOPT_DNS_CACHE_TIMEOUT, 360L );
    127         curl_easy_setopt( easy, CURLOPT_CONNECTTIMEOUT, 60L );
     128        curl_easy_setopt( easy, CURLOPT_DNS_CACHE_TIMEOUT, 3600L );
     129        curl_easy_setopt( easy, CURLOPT_CONNECTTIMEOUT, 120L );
    128130        curl_easy_setopt( easy, CURLOPT_FOLLOWLOCATION, 1L );
    129         curl_easy_setopt( easy, CURLOPT_MAXREDIRS, 16L );
    130131        curl_easy_setopt( easy, CURLOPT_NOSIGNAL, 1L );
    131132        curl_easy_setopt( easy, CURLOPT_PRIVATE, task );
     
    144145            curl_easy_setopt( easy, CURLOPT_ENCODING, "" );
    145146
    146         if( web->still_running >= MAX_CONCURRENT_TASKS ) {
     147#if 0
     148        if( web->still_running >= MAX_CONCURRENT_TASKS )
     149        {
    147150            tr_list_append( &web->easy_queue, easy );
    148151            dbgmsg( " >> enqueueing a task ... size is now %d",
    149152                                           tr_list_size( web->easy_queue ) );
    150         } else {
     153        }
     154        else
     155#endif
     156        {
    151157            const CURLMcode rc = curl_multi_add_handle( web->multi, easy );
    152158            if( rc == CURLM_OK )
     
    209215            curl_easy_getinfo( easy, CURLINFO_PRIVATE, (void*)&task );
    210216            curl_easy_getinfo( easy, CURLINFO_RESPONSE_CODE, &code );
     217            task_finish( task, code );
    211218            curl_multi_remove_handle( g->multi, easy );
    212219            curl_easy_cleanup( easy );
    213             task_finish( task, code );
    214220        }
    215221    }
     
    238244}
    239245
     246#if 0
    240247static void
    241248add_tasks_from_queue( tr_web * g )
     
    258265    }
    259266}
     267#endif
    260268
    261269static void
     
    267275}
    268276
    269 /* note: this function can free the tr_web if its 'isClosing' flag is set
     277/* note: this function can free the tr_web if its 'closing' flag is set
    270278   and no tasks remain.  callers must not reference their g pointer
    271279   after calling this function */
     
    290298    remove_finished_tasks( g );
    291299
     300#if 0
    292301    add_tasks_from_queue( g );
     302#endif
    293303
    294304    if( !g->still_running ) {
    295305        stop_timer( g );
    296         if( g->isClosing ) {
     306        if( g->closing ) {
    297307            web_close( g );
    298308            closed = TRUE;
     
    467477        web_close( web );
    468478    else
    469         web->isClosing = 1;
     479        web->closing = 1;
    470480}
    471481
Note: See TracChangeset for help on using the changeset viewer.