From b66af4ab076d5dcd68f005df7266719910d673ce Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 27 Apr 2008 07:15:20 +0000 Subject: [PATCH] curl_easy_getopt(CURLINFO_RESPONSE_CODE) needs a pointer to a long, not an int. --- libtransmission/tracker.c | 2 +- libtransmission/web.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libtransmission/tracker.c b/libtransmission/tracker.c index 91e427055..a97f7bf53 100644 --- a/libtransmission/tracker.c +++ b/libtransmission/tracker.c @@ -62,7 +62,7 @@ enum STOP_TIMEOUT_INTERVAL_SEC = 5, /* the value of the 'numwant' argument passed in tracker requests. */ - NUMWANT = 150, + NUMWANT = 80, /* the length of the 'key' argument passed in tracker requests */ KEYLEN = 10 diff --git a/libtransmission/web.c b/libtransmission/web.c index 2261b09fe..598b229f7 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -74,7 +74,7 @@ processCompletedTasks( tr_web * web ) } if( easy ) { struct tr_web_task * task; - int response_code; + long response_code; curl_easy_getinfo( easy, CURLINFO_PRIVATE, &task ); curl_easy_getinfo( easy, CURLINFO_RESPONSE_CODE, &response_code ); --web->remain; @@ -84,7 +84,6 @@ processCompletedTasks( tr_web * web ) EVBUFFER_DATA(task->response), EVBUFFER_LENGTH(task->response), task->done_func_user_data ); - curl_multi_remove_handle( web->cm, easy ); curl_easy_cleanup( easy ); evbuffer_free( task->response ); @@ -127,8 +126,8 @@ addTask( void * vtask ) struct tr_web * web = task->session->web; CURL * ch; - dbgmsg( "adding task #%lu [%s]", task->tag, task->url ); ++web->remain; + dbgmsg( "adding task #%lu [%s] (%d remain)", task->tag, task->url, web->remain ); ch = curl_easy_init( ); curl_easy_setopt( ch, CURLOPT_PRIVATE, task ); @@ -209,6 +208,7 @@ multi_sock_cb( CURL * easy UNUSED, if( action == CURL_POLL_REMOVE ) { if( ev ) { + dbgmsg( "deleting libevent socket polling" ); event_del( ev ); tr_free( ev ); curl_multi_assign( web->cm, sock, NULL ); @@ -305,9 +305,6 @@ tr_webInit( tr_session * session ) #endif #if CURL_CHECK_VERSION(7,16,3) curl_multi_setopt( web->cm, CURLMOPT_MAXCONNECTS, 10 ); -#endif -#if CURL_CHECK_VERSION(7,16,0) - curl_multi_setopt( web->cm, CURLMOPT_PIPELINING, 1 ); #endif pump( web ); @@ -317,6 +314,7 @@ tr_webInit( tr_session * session ) void tr_webClose( tr_web * web ) { + dbgmsg( "deleting web->timer" ); evtimer_del( &web->timer ); curl_multi_cleanup( web->cm ); tr_free( web );