Changeset 6983
- Timestamp:
- Oct 29, 2008, 4:06:14 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/web.c
r6970 r6983 120 120 } 121 121 122 curl_easy_setopt( easy, CURLOPT_CONNECTTIMEOUT, 60 ); 123 curl_easy_setopt( easy, CURLOPT_FOLLOWLOCATION, 1 ); 124 curl_easy_setopt( easy, CURLOPT_MAXREDIRS, 16 ); 125 curl_easy_setopt( easy, CURLOPT_NOSIGNAL, 1 ); 122 curl_easy_setopt( easy, CURLOPT_DNS_CACHE_TIMEOUT, 360L ); 123 curl_easy_setopt( easy, CURLOPT_CONNECTTIMEOUT, 60L ); 124 curl_easy_setopt( easy, CURLOPT_FOLLOWLOCATION, 1L ); 125 curl_easy_setopt( easy, CURLOPT_MAXREDIRS, 16L ); 126 curl_easy_setopt( easy, CURLOPT_NOSIGNAL, 1L ); 126 127 curl_easy_setopt( easy, CURLOPT_PRIVATE, task ); 127 curl_easy_setopt( easy, CURLOPT_SSL_VERIFYHOST, 0 );128 curl_easy_setopt( easy, CURLOPT_SSL_VERIFYPEER, 0 );128 curl_easy_setopt( easy, CURLOPT_SSL_VERIFYHOST, 0L ); 129 curl_easy_setopt( easy, CURLOPT_SSL_VERIFYPEER, 0L ); 129 130 curl_easy_setopt( easy, CURLOPT_URL, task->url ); 130 131 curl_easy_setopt( easy, CURLOPT_USERAGENT, … … 188 189 remove_finished_tasks( tr_web * g ) 189 190 { 190 191 if( g->prev_running != g->still_running ) 191 CURL * easy; 192 193 do 192 194 { 193 CURL * easy; 194 195 do 196 { 197 CURLMsg * msg; 198 int msgs_left; 199 CURLcode res; 200 201 easy = NULL; 202 while(( msg = curl_multi_info_read( g->multi, &msgs_left ))) { 203 if( msg->msg == CURLMSG_DONE ) { 204 easy = msg->easy_handle; 205 res = msg->data.result; 206 break; 207 } 195 CURLMsg * msg; 196 int msgs_left; 197 CURLcode res; 198 199 easy = NULL; 200 while(( msg = curl_multi_info_read( g->multi, &msgs_left ))) { 201 if( msg->msg == CURLMSG_DONE ) { 202 easy = msg->easy_handle; 203 res = msg->data.result; 204 break; 208 205 } 209 210 if( easy ) { 211 long code;212 struct tr_web_task * task;213 curl_easy_getinfo( easy, CURLINFO_PRIVATE, (void*)&task );214 curl_easy_getinfo( easy, CURLINFO_RESPONSE_CODE, &code);215 curl_multi_remove_handle( g->multi, easy);216 curl_easy_cleanup(easy );217 task_finish( task, code);218 }219 } 220 while ( easy );221 222 g->prev_running = g->still_running; 223 }206 } 207 208 if( easy ) { 209 long code; 210 struct tr_web_task * task; 211 curl_easy_getinfo( easy, CURLINFO_PRIVATE, (void*)&task ); 212 curl_easy_getinfo( easy, CURLINFO_RESPONSE_CODE, &code ); 213 curl_multi_remove_handle( g->multi, easy ); 214 curl_easy_cleanup( easy ); 215 task_finish( task, code ); 216 } 217 } 218 while ( easy ); 219 220 g->prev_running = g->still_running; 224 221 } 225 222
Note: See TracChangeset
for help on using the changeset viewer.