Ticket #1359: web.patch
File web.patch, 1.4 KB (added by fulgas, 14 years ago) |
---|
-
web.c
34 34 struct tr_web 35 35 { 36 36 unsigned int dying : 1; 37 int prev_running;38 37 int still_running; 39 38 CURLM * multi; 40 39 tr_session * session; … … 177 176 { 178 177 int added_from_queue = FALSE; 179 178 180 dbgmsg( "check_run_count: prev_running %d,still_running %d",181 g-> prev_running, g->still_running );179 dbgmsg( "check_run_count: still_running %d", 180 g->still_running ); 182 181 183 if( 1 )182 if( g->still_running > 0 ) /* there is still tasks to run, either on queue or not */ 184 183 { 185 184 CURLMsg * msg; 186 185 int msgs_left; … … 203 202 curl_easy_getinfo( easy, CURLINFO_RESPONSE_CODE, &code ); 204 203 curl_multi_remove_handle( g->multi, easy ); 205 204 curl_easy_cleanup( easy ); 205 --g->still_running; 206 206 finish_task( task, code ); 207 207 } 208 208 } while ( easy ); 209 209 } 210 210 211 g->prev_running = g->still_running;211 dbgmsg( "--> still running: %d ... max: %d ... queue size: %d", g->still_running, MAX_CONCURRENT_TASKS, tr_list_size( g->easy_queue ) ); 212 212 213 dbgmsg( "--> still running: %d ... max: %d ... queue size: %d", g->still_running, MAX_CONCURRENT_TASKS, tr_list_size( g->easy_queue ) );214 215 213 while( ( g->still_running < MAX_CONCURRENT_TASKS ) 216 214 && ( tr_list_size( g->easy_queue ) > 0 ) ) 217 215 {