Changeset 10009


Ignore:
Timestamp:
Jan 24, 2010, 7:22:22 PM (12 years ago)
Author:
charles
Message:

(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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/web.c

    r10003 r10009  
    274274            evbuffer_free( buf );
    275275
    276             host = tr_strdup_printf( "Host: %s:%d", task->host, task->port );
     276            if( ( ( task->port <= 0 ) ) ||
     277                ( ( task->port == 80 ) && !strncmp( task->url, "http://", 7 ) ) ||
     278                ( ( task->port == 443 ) && !strncmp( task->url, "https://", 8 ) ) )
     279                host = tr_strdup_printf( "Host: %s", task->host );
     280            else
     281                host = tr_strdup_printf( "Host: %s:%d", task->host, task->port );
     282
    277283            task->slist = curl_slist_append( NULL, host );
    278284            curl_easy_setopt( e, CURLOPT_HTTPHEADER, task->slist );
Note: See TracChangeset for help on using the changeset viewer.