From 7e5e4db797723bdf047ffae41e79b21bb4536422 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 24 Jan 2010 19:22:22 +0000 Subject: [PATCH] (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. --- libtransmission/web.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libtransmission/web.c b/libtransmission/web.c index 18db83675..99252ed9b 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -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 );