mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-15 15:25:09 -04:00
r16492@catbus: nickm | 2007-11-06 23:27:32 -0500
Fix unit tests so that an outdated nameserver means "Skip IPv6 tests", not "Abort." svn:r487
This commit is contained in:
parent
7c507668d7
commit
bab0e6d440
@ -38,4 +38,6 @@ Changes in current version:
|
|||||||
o Small code cleanups in epoll_dispatch().
|
o Small code cleanups in epoll_dispatch().
|
||||||
o Increase the maximum number of addresses read from a packet in evdns to 32.
|
o Increase the maximum number of addresses read from a packet in evdns to 32.
|
||||||
o Remove support for the rtsig method: it hasn't compiled for a while, and nobody seems to miss it very much. Let us know if there's a good reason to put it back in.
|
o Remove support for the rtsig method: it hasn't compiled for a while, and nobody seems to miss it very much. Let us know if there's a good reason to put it back in.
|
||||||
o Rename the "class" field in evdns_server_request to dns_question_class, so that it won't break compilation under C++. Use a macro so that old code won't break. Mark the macro as deprecated.
|
o Rename the "class" field in evdns_server_request to dns_question_class, so that it won't break compilation under C++. Use a macro so that old code won't break. Mark the macro as deprecated.
|
||||||
|
o Fix DNS unit tests so that having a DNS server with broken IPv6 support is no longer cause for aborting the unit tests.
|
||||||
|
|
||||||
|
@ -64,15 +64,24 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
static int dns_ok = 0;
|
static int dns_ok = 0;
|
||||||
|
static int dns_err = 0;
|
||||||
|
|
||||||
void
|
void
|
||||||
dns_gethostbyname_cb(int result, char type, int count, int ttl,
|
dns_gethostbyname_cb(int result, char type, int count, int ttl,
|
||||||
void *addresses, void *arg)
|
void *addresses, void *arg)
|
||||||
{
|
{
|
||||||
dns_ok = 0;
|
dns_ok = dns_err = 0;
|
||||||
|
|
||||||
if (result != DNS_ERR_NONE)
|
if (result == DNS_ERR_TIMEOUT) {
|
||||||
|
fprintf(stdout, "[Timed out] ");
|
||||||
|
dns_err = result;
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result != DNS_ERR_NONE) {
|
||||||
|
fprintf(stdout, "[Error code %d] ", result);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
fprintf(stderr, "type: %d, count: %d, ttl: %d: ", type, count, ttl);
|
fprintf(stderr, "type: %d, count: %d, ttl: %d: ", type, count, ttl);
|
||||||
|
|
||||||
@ -148,8 +157,10 @@ dns_gethostbyname6(void)
|
|||||||
|
|
||||||
if (dns_ok == DNS_IPv6_AAAA) {
|
if (dns_ok == DNS_IPv6_AAAA) {
|
||||||
fprintf(stdout, "OK\n");
|
fprintf(stdout, "OK\n");
|
||||||
|
} else if (!dns_ok && dns_err == DNS_ERR_TIMEOUT) {
|
||||||
|
fprintf(stdout, "SKIPPED\n");
|
||||||
} else {
|
} else {
|
||||||
fprintf(stdout, "FAILED\n");
|
fprintf(stdout, "FAILED (%d)\n", dns_ok);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user