summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2015-05-18 14:05:27 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2015-05-18 16:44:38 +0100
commit1fb7660fc893265f0e37ceb965396d9e005a0b74 (patch)
tree797fa6773121997c7ab701338fb5bf41263ffe01 /src
parent1f12df4d41f546751e14d52df36172f9bb54cce8 (diff)
Testsuite: move manyhome.test,ex handling from exim to fakens
Diffstat (limited to 'src')
-rw-r--r--src/src/dns.c7
-rw-r--r--src/src/host.c31
2 files changed, 8 insertions, 30 deletions
diff --git a/src/src/dns.c b/src/src/dns.c
index 33520183b..51029d4a5 100644
--- a/src/src/dns.c
+++ b/src/src/dns.c
@@ -112,6 +112,13 @@ if (stat(CS utilname, &statbuf) >= 0)
asize -= rc; /* may need to be passed on to res_search(). */
}
+ /* If we ran out of output buffer before exhasting the return,
+ carry on reading and counting it. */
+
+ if (asize == 0)
+ while ((rc = read(outfd, name, sizeof(name))) > 0)
+ len += rc;
+
if (rc < 0)
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "read from fakens failed: %s",
strerror(errno));
diff --git a/src/src/host.c b/src/src/host.c
index 0a7a212b4..d65da7578 100644
--- a/src/src/host.c
+++ b/src/src/host.c
@@ -148,8 +148,7 @@ return retval;
*************************************************/
/* This function is called instead of gethostbyname(), gethostbyname2(), or
-getipnodebyname() when running in the test harness. It recognizes the name
-"manyhome.test.ex" and generates a humungous number of IP addresses. It also
+getipnodebyname() when running in the test harness. . It also
recognizes an unqualified "localhost" and forces it to the appropriate loopback
address. IP addresses are treated as literals. For other names, it uses the DNS
to find the host name. In the test harness, this means it will access only the
@@ -186,34 +185,6 @@ DEBUG(D_host_lookup)
debug_printf("using host_fake_gethostbyname for %s (%s)\n", name,
(af == AF_INET)? "IPv4" : "IPv6");
-/* Handle the name that needs a vast number of IP addresses */
-
-if (Ustrcmp(name, "manyhome.test.ex") == 0 && af == AF_INET)
- {
- int i, j;
- yield = store_get(sizeof(struct hostent));
- alist = store_get(2049 * sizeof(char *));
- adds = store_get(2048 * alen);
- yield->h_name = CS name;
- yield->h_aliases = NULL;
- yield->h_addrtype = af;
- yield->h_length = alen;
- yield->h_addr_list = CSS alist;
- for (i = 104; i <= 111; i++)
- {
- for (j = 0; j <= 255; j++)
- {
- *alist++ = adds;
- *adds++ = 10;
- *adds++ = 250;
- *adds++ = i;
- *adds++ = j;
- }
- }
- *alist = NULL;
- return yield;
- }
-
/* Handle unqualified "localhost" */
if (Ustrcmp(name, "localhost") == 0)