Changeset 10032


Ignore:
Timestamp:
Jan 28, 2010, 5:24:23 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #2819 "announce URLs containing raw IP addresses won't announce/scrape in 1.82" -- possible fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/web.c

    r10031 r10032  
    442442doDNS( void * vtask )
    443443{
     444    tr_address addr;
    444445    int port = -1;
    445446    char * host = NULL;
     
    453454        task->port = port;
    454455        task->host = host;
    455         lookup_result = dns_cache_lookup( task, host, &task->resolved_host );
     456
     457        /* If 'host' is an IPv4 or IPv6 address in text form, use it as-is.
     458         * Otherwise, see if its resolved name is in our DNS cache */
     459        if( tr_pton( task->host, &addr ) != NULL )
     460        {
     461            task->resolved_host = task->host;
     462            lookup_result = TR_DNS_OK;
     463        }
     464        else
     465        {
     466            lookup_result = dns_cache_lookup( task, host, &task->resolved_host );
     467        }
    456468    }
    457469
Note: See TracChangeset for help on using the changeset viewer.