# HG changeset patch # User Matti Hamalainen # Date 1403407203 -10800 # Node ID 8efebf863404fbbad8aa04ef7fbfa7a32582358f # Parent 0ac59c798773c2a93bcf0dfaa58c744b799c7400 Fix host handling. diff -r 0ac59c798773 -r 8efebf863404 th_network.c --- a/th_network.c Sun Jun 22 03:34:00 2014 +0300 +++ b/th_network.c Sun Jun 22 06:20:03 2014 +0300 @@ -578,11 +578,12 @@ return THERR_NULLPTR; conn->port = port; - if (host != NULL) - { - conn->host = th_strdup(host); - conn->hst = th_resolve_host(conn, host); - } + conn->host = th_strdup(host); + conn->hst = th_resolve_host(conn, host); + + // If name resolving locally fails, force to domain addr type + if (conn->hst == NULL) + conn->proxy.addr_type = TH_PROXY_ADDR_DOMAIN; th_get_addr(&(conn->addr), conn->hst);