mirror of
https://github.com/transmission/transmission
synced 2025-02-01 03:43:43 +00:00
(trunk libT) #3077 "add support for cookies files"
This commit is contained in:
parent
1e163ec77d
commit
18498e9c41
1 changed files with 3 additions and 0 deletions
|
@ -152,6 +152,7 @@ createEasy( tr_session * s, struct tr_web_task * task )
|
|||
const tr_address * addr;
|
||||
CURL * e = curl_easy_init( );
|
||||
const long verbose = getenv( "TR_CURL_VERBOSE" ) != NULL;
|
||||
char * cookie_filename = tr_buildPath( s->configDir, "cookies.txt", NULL );
|
||||
|
||||
if( !task->range && s->isProxyEnabled ) {
|
||||
const long proxyType = getCurlProxyType( s->proxyType );
|
||||
|
@ -169,6 +170,7 @@ createEasy( tr_session * s, struct tr_web_task * task )
|
|||
}
|
||||
|
||||
curl_easy_setopt( e, CURLOPT_AUTOREFERER, 1L );
|
||||
curl_easy_setopt( e, CURLOPT_COOKIEFILE, cookie_filename );
|
||||
curl_easy_setopt( e, CURLOPT_ENCODING, "gzip;q=1.0, deflate, identity" );
|
||||
curl_easy_setopt( e, CURLOPT_FOLLOWLOCATION, 1L );
|
||||
curl_easy_setopt( e, CURLOPT_MAXREDIRS, -1L );
|
||||
|
@ -193,6 +195,7 @@ createEasy( tr_session * s, struct tr_web_task * task )
|
|||
if( task->range )
|
||||
curl_easy_setopt( e, CURLOPT_RANGE, task->range );
|
||||
|
||||
tr_free( cookie_filename );
|
||||
return e;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue