static void
doDNS( void * vtask )
{
+ tr_address addr;
int port = -1;
char * host = NULL;
struct tr_web_task * task = vtask;
{
task->port = port;
task->host = host;
- lookup_result = dns_cache_lookup( task, host, &task->resolved_host );
+
+ /* If 'host' is an IPv4 or IPv6 address in text form, use it as-is.
+ * Otherwise, see if its resolved name is in our DNS cache */
+ if( tr_pton( task->host, &addr ) != NULL )
+ {
+ task->resolved_host = task->host;
+ lookup_result = TR_DNS_OK;
+ }
+ else
+ {
+ lookup_result = dns_cache_lookup( task, host, &task->resolved_host );
+ }
}
if( lookup_result != TR_DNS_UNTESTED )