Changeset 7557
- Timestamp:
- Dec 31, 2008, 2:28:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/web.c
r7536 r7557 129 129 curl_easy_setopt( easy, CURLOPT_CONNECTTIMEOUT, 120L ); 130 130 curl_easy_setopt( easy, CURLOPT_FOLLOWLOCATION, 1L ); 131 curl_easy_setopt( easy, CURLOPT_FORBID_REUSE, 1L );132 curl_easy_setopt( easy, CURLOPT_MAXREDIRS, 16L );133 131 curl_easy_setopt( easy, CURLOPT_NOSIGNAL, 1L ); 134 132 curl_easy_setopt( easy, CURLOPT_PRIVATE, task ); 135 133 curl_easy_setopt( easy, CURLOPT_SSL_VERIFYHOST, 0L ); 136 134 curl_easy_setopt( easy, CURLOPT_SSL_VERIFYPEER, 0L ); 137 curl_easy_setopt( easy, CURLOPT_TIMEOUT, 240L );138 135 curl_easy_setopt( easy, CURLOPT_URL, task->url ); 139 136 curl_easy_setopt( easy, CURLOPT_USERAGENT, … … 282 279 after calling this function */ 283 280 static void 284 tr_multi_socket_action( tr_web * g, int fd , int mask)281 tr_multi_socket_action( tr_web * g, int fd ) 285 282 { 286 283 int closed = FALSE; … … 292 289 /* invoke libcurl's processing */ 293 290 do { 294 rc = curl_multi_socket_action( g->multi, fd, mask, &g->still_running );295 dbgmsg( "event_cb(): fd %d, mask %d,still_running is %d",296 fd, mask,g->still_running );291 rc = curl_multi_socket_action( g->multi, fd, 0, &g->still_running ); 292 dbgmsg( "event_cb(): fd %d, still_running is %d", 293 fd, g->still_running ); 297 294 } while( rc == CURLM_CALL_MULTI_PERFORM ); 298 295 if( rc != CURLM_OK ) … … 319 316 /* libevent says that sock is ready to be processed, so wake up libcurl */ 320 317 static void 321 event_cb( int fd, short kind, void * g ) 322 { 323 int error; 324 int mask; 325 socklen_t errsz; 326 327 error = 0; 328 errsz = sizeof( error ); 329 getsockopt( fd, SOL_SOCKET, SO_ERROR, &error, &errsz ); 330 if( error ) 331 mask = CURL_CSELECT_ERR; 332 else { 333 mask = 0; 334 if( kind & EV_READ ) mask |= CURL_CSELECT_IN; 335 if( kind & EV_WRITE ) mask |= CURL_CSELECT_OUT; 336 } 337 338 tr_multi_socket_action( g, fd, mask ); 318 event_cb( int fd, short kind UNUSED, void * g ) 319 { 320 tr_multi_socket_action( g, fd ); 339 321 } 340 322 … … 344 326 { 345 327 dbgmsg( "libevent timer is done" ); 346 tr_multi_socket_action( g, CURL_SOCKET_TIMEOUT , 0);328 tr_multi_socket_action( g, CURL_SOCKET_TIMEOUT ); 347 329 } 348 330
Note: See TracChangeset
for help on using the changeset viewer.