From 9576dd16e20f2e74791e07c156859582de06b3e8 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Wed, 14 Dec 2011 05:58:23 +0000 Subject: [PATCH] (trunk libT) #4666 "webseed downloading never gets downloaded" -- fixed. The webseed in question is downloading from an ubuntuone.com url. We ask for piece-sized ranges in a couple of different concurrent connections, and curl hints to the server that it's okay to gzip the response, or deflate it, or leave it raw. It looks like there's a bug in the server or in libcurl (or, somehow, Transmission) that's not compressing or decompressing these responses correctly -- we never get the right number of bytes in the response from libcurl. If we ask for the contents uncompressed, the download progresses towards completion. As an aside, when testing this I noticed that deluge is a lot faster than Transmission on this torrent. In order for Transmission to reach parity here, webseed.c needs to know when it's appropriate to have more than 4 concurrent tasks and/or be able to request ranges > the torrent's piece size. --- libtransmission/web.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libtransmission/web.c b/libtransmission/web.c index f7c311450..42f9ddc54 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -188,8 +188,11 @@ createEasy( tr_session * s, struct tr_web * web, struct tr_web_task * task ) if( task->cookies != NULL ) curl_easy_setopt( e, CURLOPT_COOKIE, task->cookies ); - if( task->range ) + if( task->range != NULL ) { curl_easy_setopt( e, CURLOPT_RANGE, task->range ); + /* don't bother asking the server to compress webseed fragments */ + curl_easy_setopt( e, CURLOPT_ENCODING, "identity" ); + } return e; }