Changeset 12001


Ignore:
Timestamp:
Feb 21, 2011, 1:13:28 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) web.c: free the unprocessed tasks before exiting the libcurl thread.

This is rare but can happen during shutdown if there are unresponsive trackers. Cleaning up the tasks improves the S/N ratio in valgrind a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/web.c

    r11896 r12001  
    293293tr_webThreadFunc( void * vsession )
    294294{
    295     int unused;
    296295    CURLM * multi;
    297296    struct tr_web * web;
    298297    int taskCount = 0;
     298    struct tr_web_task * task;
    299299    tr_session * session = vsession;
    300300
     
    314314    {
    315315        long msec;
     316        int unused;
    316317        CURLMsg * msg;
    317318        CURLMcode mcode;
    318         struct tr_web_task * task;
    319319
    320320        if( web->close_mode == TR_WEB_CLOSE_NOW )
     
    389389            }
    390390        }
     391    }
     392
     393    /* Discard any remaining tasks.
     394     * This is rare, but can happen on shutdown with unresponsive trackers. */
     395    while(( task = tr_list_pop_front( &web->tasks ))) {
     396        dbgmsg( "Discarding task \"%s\"", task->url );
     397        task_free( task );
    391398    }
    392399
Note: See TracChangeset for help on using the changeset viewer.