summaryrefslogtreecommitdiff
path: root/ares_gethostbyname.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-05-26 21:16:28 (GMT)
committerDaniel Stenberg <daniel@haxx.se>2010-06-02 21:10:21 (GMT)
commit0e8dc6f18eeb8a54115af2b2bd5693f933b6c27f (patch)
tree431a988990cc899ec3eb500d03217d9d7a81d04a /ares_gethostbyname.c
parentcd59ae213f9adbe53e8cbade8e3159b56e618dc2 (diff)
downloadc-ares-0e8dc6f18eeb8a54115af2b2bd5693f933b6c27f.zip
c-ares-0e8dc6f18eeb8a54115af2b2bd5693f933b6c27f.tar.gz
c-ares-0e8dc6f18eeb8a54115af2b2bd5693f933b6c27f.tar.bz2
style: make code less than 80 columns wide
Diffstat (limited to 'ares_gethostbyname.c')
-rw-r--r--ares_gethostbyname.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/ares_gethostbyname.c b/ares_gethostbyname.c
index 8d912ac..4469ffe 100644
--- a/ares_gethostbyname.c
+++ b/ares_gethostbyname.c
@@ -150,8 +150,8 @@ static void next_lookup(struct host_query *hquery, int status_code)
}
else {
hquery->sent_family = AF_INET;
- ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
- hquery);
+ ares_search(hquery->channel, hquery->name, C_IN, T_A,
+ host_callback, hquery);
}
return;
@@ -194,9 +194,10 @@ static void host_callback(void *arg, int status, int timeouts,
{
status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
if (status == ARES_ENODATA || status == ARES_EBADRESP) {
- /* The query returned something but either there were no AAAA records (e.g. just CNAME)
- or the response was malformed. Try looking up A instead.
- We should possibly limit this attempt-next logic to AF_UNSPEC lookups only. */
+ /* The query returned something but either there were no AAAA
+ records (e.g. just CNAME) or the response was malformed. Try
+ looking up A instead. We should possibly limit this
+ attempt-next logic to AF_UNSPEC lookups only. */
hquery->sent_family = AF_INET;
ares_search(hquery->channel, hquery->name, C_IN, T_A,
host_callback, hquery);
@@ -207,10 +208,12 @@ static void host_callback(void *arg, int status, int timeouts,
}
end_hquery(hquery, status, host);
}
- else if ((status == ARES_ENODATA || status == ARES_EBADRESP || status == ARES_ETIMEOUT) && hquery->sent_family == AF_INET6)
+ else if ((status == ARES_ENODATA || status == ARES_EBADRESP ||
+ status == ARES_ETIMEOUT) && hquery->sent_family == AF_INET6)
{
- /* The AAAA query yielded no useful result. Now look up an A instead.
- We should possibly limit this attempt-next logic to AF_UNSPEC lookups only. */
+ /* The AAAA query yielded no useful result. Now look up an A instead.
+ We should possibly limit this attempt-next logic to AF_UNSPEC lookups
+ only. */
hquery->sent_family = AF_INET;
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
hquery);
@@ -234,8 +237,8 @@ static void end_hquery(struct host_query *hquery, int status,
/* If the name looks like an IP address, fake up a host entry, end the
* query immediately, and return true. Otherwise return false.
*/
-static int fake_hostent(const char *name, int family, ares_host_callback callback,
- void *arg)
+static int fake_hostent(const char *name, int family,
+ ares_host_callback callback, void *arg)
{
struct hostent hostent;
char *aliases[1] = { NULL };
@@ -345,8 +348,8 @@ static int file_lookup(const char *name, int family, struct hostent **host)
char tmp[MAX_PATH];
HKEY hkeyHosts;
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts)
- == ERROR_SUCCESS)
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
+ &hkeyHosts) == ERROR_SUCCESS)
{
DWORD dwLength = MAX_PATH;
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
@@ -407,8 +410,8 @@ static int file_lookup(const char *name, int family, struct hostent **host)
return status;
}
-static void sort_addresses(struct hostent *host, const struct apattern *sortlist,
- int nsort)
+static void sort_addresses(struct hostent *host,
+ const struct apattern *sortlist, int nsort)
{
struct in_addr a1, a2;
int i1, i2, ind1, ind2;
@@ -463,8 +466,8 @@ static int get_address_index(const struct in_addr *addr,
return i;
}
-static void sort6_addresses(struct hostent *host, const struct apattern *sortlist,
- int nsort)
+static void sort6_addresses(struct hostent *host,
+ const struct apattern *sortlist, int nsort)
{
struct ares_in6_addr a1, a2;
int i1, i2, ind1, ind2;