Added -n option.

This commit is contained in:
pdw
2002-03-31 22:57:51 +00:00
parent 94a696b7fb
commit a248b6046e
9 changed files with 259 additions and 134 deletions

View File

@@ -74,20 +74,15 @@ void resolver_worker(void* ptr) {
/* Check for errors. */
if (res || hp == NULL) {
/* failed */
//printf("[ Did not resolve %s ]\n", inet_ntoa(addr));
/* Leave the unresolved IP in the hash */
}
else {
/* success */
char* hostname;
//printf("[ Resolved: %s ]\n", hp->h_name);
if(hash_find(ns_hash, &addr, (void**)&hostname) == HASH_STATUS_OK) {
hash_delete(ns_hash, &addr);
xfree(hostname);
}
else {
//printf("[ Warning: Could not find hash entry for key: %s ]\n", inet_ntoa(addr));
}
hostname = strdup(hp->h_name);
hash_insert(ns_hash, &addr, (void*)hostname);