(trunk libT) #2783 "blocklist is empty" -- fix this 1.82 regression. apparently update.transmissionbt.com doesn't like it when you make the ":80" in the Host: header explicit instead of implicit... so probably other web servers have the same problem too.

This commit is contained in:
Charles Kerr 2010-01-24 19:22:22 +00:00
parent bf2a6d8f09
commit 7e5e4db797
1 changed files with 7 additions and 1 deletions

View File

@ -273,7 +273,13 @@ addTask( void * vtask )
dbgmsg( "old url: \"%s\" -- new url: \"%s\"", task->url, url );
evbuffer_free( buf );
host = tr_strdup_printf( "Host: %s:%d", task->host, task->port );
if( ( ( task->port <= 0 ) ) ||
( ( task->port == 80 ) && !strncmp( task->url, "http://", 7 ) ) ||
( ( task->port == 443 ) && !strncmp( task->url, "https://", 8 ) ) )
host = tr_strdup_printf( "Host: %s", task->host );
else
host = tr_strdup_printf( "Host: %s:%d", task->host, task->port );
task->slist = curl_slist_append( NULL, host );
curl_easy_setopt( e, CURLOPT_HTTPHEADER, task->slist );
tr_free( host );