test/regress_dns.c


Log

Author Commit Date CI Message
Nick Mathewson a334b31c 2010-01-14T14:46:16 More unit tests for getaddrinfo_async: v4timeout and cancel. One covers the case where the v4 request times out but the v6 request doesn't. The other makes sure that cancelling a request actually works.
Nick Mathewson 72dd6667 2009-12-07T17:21:41 evdns_getaddrinfo() now supports the /etc/hosts file. The regular blocking evutil_getaddrinfo() already supported /etc/hosts by falling back to getaddrinfo() or gethostbyname(). But evdns_getaddrinfo() had no such facility. Now it does. The data structure here isn't very clever. I guess people with huge /etc/hosts files will either need to get out of the 1980s, or submit a patch to this code so that it uses a hashtable instead of a linked list. Includes basic unit tests.
Nick Mathewson 1e56a32d 2009-12-29T16:04:16 Make the initial nameserver probe timeout configurable. When we decide that a nameserver is down, we stop sending queries to it, except to periodically probe it to see if it has come back up. Our previous probe sechedule was an ad-hoc and hard-wired "10 seconds, one minute, 5 minues, 15 minutes, 1 hour, 1 hour, 1 hour...". There was nothing wrong with having it be ad-hoc, but making it hard-wired served no good purpose. Now the user can set the initial timeout via a new "initial-probe-timeout:" option; future timeouts back off by a factor of 3 on every failure to a maximum of 1 hour. As a side-benefit, this lets us cut the runtime of the dns/retry test from about 40 seconds to about 3 seconds. Faster unit tests are always a good thing.
Nick Mathewson 7511b6a9 2009-11-19T00:21:38 Fix a spelling error and remove some dead code svn:r1551
Nick Mathewson 888007f9 2009-11-17T02:38:19 Windows *does* have getservbyname, no matter what autoconf says. TODO: figure out why autoconf is confused about this. svn:r1538
Nick Mathewson 86f57420 2009-11-16T22:25:46 Add two implementations of getaddrinfo: one blocking and one nonblocking. The entry points are evutil_getaddrinfo and evdns_getaddrinfo respectively. There are fairly extensive unit tests. I believe this code conforms to RFC3493 pretty closely, but there are probably more issues. It should get tested on more platforms. This code means we can dump the well-intentioned but weirdly-implemented bufferevent_evdns and evutil_resolve code. svn:r1537
Nick Mathewson 72bafc17 2009-11-16T22:23:55 Remove the stupid brokenness where DNS option names needed to end with a colon. svn:r1536
Nick Mathewson 784b8773 2009-11-06T21:46:57 We do not work any more without an event-config.h; stop pretending that it is meaningful to check for HAVE_CONFIG_H svn:r1516
Nick Mathewson ac633aeb 2009-11-05T21:22:23 Fix some build warnings on MSVC, mostly related to signed/unsigned comparisons. svn:r1510
Nick Mathewson 0b9eb1bf 2009-11-03T20:40:48 Add a bufferevent function to resolve a name then connect to it. This function, bufferevent_socket_connect_hostname() can either use evdns to do the resolve, or use a new function (evutil_resolve) that uses getaddrinfo or gethostbyname, like http.c does now. This function is meant to eventually replace the hostname resolution mess in http.c. svn:r1496
Nick Mathewson 9976f1e7 2009-10-29T17:11:12 reformat weird indentation in dns tests svn:r1478
Nick Mathewson 3c2198cb 2009-10-29T17:10:36 Unit test for reverse ipv6 lookup svn:r1477
Nick Mathewson 50825466 2009-10-21T02:14:16 Fix windows compilation warnings. svn:r1449
Nick Mathewson 0c09fe5a 2009-08-03T20:50:56 Add a couple more evdns tests. Libevent is now, for me, at 80.02% coverage. svn:r1409
Nick Mathewson 94e8f9b9 2009-08-03T20:15:45 Another DNS unit tests, to handle reissues. The evdns module is now up to ~72% coverage; Libevent is up to nearly 80%. svn:r1408
Nick Mathewson dc1f5b1e 2009-08-03T20:15:39 why say fprintf(stdout, X) when you can say printf? svn:r1407
Nick Mathewson 213dc2a2 2009-08-03T20:15:32 Fix an annoying evdns crash bug, and add more unit tests for evdns. svn:r1406
Nick Mathewson a5006d80 2009-08-03T16:15:57 Unit tests for DNS search. svn:r1405
Nick Mathewson 72ea534f 2009-07-28T19:41:57 Export evutil_str[n]casecmp as evutil_ascii_str[n]casecmp. svn:r1387
Nick Mathewson a826a758 2009-07-28T19:41:48 Some tweaks to Brodie Thesfield's MSVC patch. svn:r1386
Nick Mathewson 5b5b880b 2009-07-28T19:41:39 Various MSVC cleanups from Brodie Thiesfield. svn:r1385
Nick Mathewson d866f055 2009-07-13T20:03:00 Patch from Zack Weinberg: normalize perror() tt functions and add tt_fail/tt_abort_printf svn:r1340
Nick Mathewson ea664bf2 2009-04-21T18:46:30 Refactor test wrappers to divide legacy items from useful stuff. svn:r1212
Nick Mathewson 4d8919ec 2009-04-19T01:58:26 Do not try to double-free the nameserver in regression test svn:r1202
Nick Mathewson d2e9caa6 2009-04-06T20:38:19 Fix evdns_cancel to alert callback and free associated RAM. Also, we add a test to make sure evdns_cancel is working properly. svn:r1139
Nick Mathewson d9628ef4 2009-01-31T18:36:08 Add missing initializers svn:r1082
Nick Mathewson eac75f91 2009-01-31T07:32:14 Port DNS tests. svn:r1081
Nick Mathewson b85b710c 2009-01-27T22:34:36 Update copyright statements to reflect the facts that: a) this is 2009 b) niels and nick have been comaintainers for a while c) saying "all rights reserved" when you then go on to explicitly disclaim some rights is sheer cargo-cultism. svn:r1065
Nick Mathewson 8889a770 2009-01-27T22:30:46 Replace all use of config.h with event-config.h. svn:r1064
Niels Provos a077fb8c 2009-01-22T02:47:35 rename sys/signal.h to signal.h; configure m4 macro dir; this assist with compilation on Haiku svn:r1033
Nick Mathewson 169321c9 2009-01-13T20:26:37 Rename four internal headers to follow the -internal.h convention. svn:r1000
Niels Provos 87be18da 2008-12-25T16:25:37 implement evdns_cancel_request; test one of the new evdns_base functions svn:r980
Nick Mathewson dd731685 2008-12-03T20:09:13 Implement increased DSN-poisoning resistance via the 0x20 hack. svn:r958
Nick Mathewson 4e8a339e 2008-05-05T15:46:00 r19602@catbus: nickm | 2008-05-05 11:45:18 -0400 Make most of the tests use the new headers. svn:r776
Nick Mathewson ce4ee418 2007-11-26T19:18:49 r16733@catbus: nickm | 2007-11-26 14:18:25 -0500 Add an --enable-gcc-warnings option (lifted from Tor) to the configure script. When provided, and when we are using GCC, we enable a bunch of extra GCC warnings in the compiler. Also, make the code all build happily with these warnings. svn:r553
Nick Mathewson bab0e6d4 2007-11-07T04:28:54 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
Nick Mathewson 7c507668 2007-11-07T03:52:20 r16489@catbus: nickm | 2007-11-06 22:51:05 -0500 Do not use "class" as identifier in evdns.h; but use a backward-compatible fix. (Should fix bug 1826515, originally reported by Roger Clark) svn:r486
Nick Mathewson 1e1f77c5 2007-09-20T19:08:20 Make the test/ subdirectory buildable under Windows. Well, mingw at least. The tests still don't all pass, but at least now we know that. svn:r447
Nick Mathewson 35983cd6 2007-08-16T21:12:53 r14618@catbus: nickm | 2007-08-16 17:11:47 -0400 In ANSI C, int func() is a function with unspecified arguments, whereas int func(void) is a function that takes no arguments. Using int func() to mean a function with no arguments is a C++ism, so let's not use or generate it. svn:r395
Niels Provos 7c6df310 2007-07-30T23:53:10 remove c++ comments from Jan Kneschke svn:r373
Niels Provos b5d2f9a2 2007-03-01T06:25:18 rolling back r339: evconfig.h does not work svn:r341
Niels Provos 127c260b 2007-02-28T04:02:29 make evconfig.h available as installed header file; not really ideal but good enough for me; from Nick Mathewson svn:r339
Niels Provos faf5f73a 2007-02-08T16:39:15 dns server support from Nick Mathewson; tiny tweaks to the regression test from me to make it run on systems where stack variables get initialized with trash. svn:r321
Niels Provos 121efe65 2007-01-27T08:38:51 small bug fixes to AAAA resolution and regression test; from Nick Mathewson! we love regresson tests. svn:r319
Niels Provos cf47f86b 2006-10-09T00:48:42 put the evdns documentation into the header file. pathetic start of evdns manpage. a little bit more testing and debug output for the DNS regression test. add a BSD copyright to evdns.h with appropriate explanations. svn:r239
Niels Provos fe1dfe0f 2006-10-05T22:59:44 sync evdns changes with tor - from Nick Mathewson svn:r238
Niels Provos e9c1e3f7 2006-08-28T00:57:49 introduce evdns_init() which works on windows and unix. svn:r231
Niels Provos 07c3fb50 2006-08-27T20:04:20 add a simple regression test for the DNS resolver; requires internet access. do some KNF on evdns.c; add checks to prevent potential buffer overflows. fix one memory leak. svn:r230