evdns.c


Log

Author Commit Date CI Message
Nick Mathewson 5b5b880b 2009-07-28T19:41:39 Various MSVC cleanups from Brodie Thiesfield. svn:r1385
Nick Mathewson 12199fa7 2009-07-28T17:11:03 Fix segfault during failed allocatino of locked evdns base. We need to comb the rest of the code to make sure that we don't blindly wrap functions in LOCK(x), UNLOCK(x) when those functions might contain a FREE(x) in the middle. Rocco Carbone found and reported this bug. svn:r1384
Nick Mathewson b06b2649 2009-07-26T01:29:39 Make "deferred callback queue" independent of event_base. This way, we can more easily have an IOCP bufferevent implementation that does not need an event_base at all. Woot. svn:r1381
Nick Mathewson 670658eb 2009-07-21T18:32:57 Correct the signatures for evdns_configure_windows_nameservers(), now that it is exposed. svn:r1369
Nick Mathewson e83a32df 2009-07-14T19:31:20 Do not define _FORTIFY_SOURCE if the platform GCC already defined it for us. svn:r1346
Nick Mathewson 342ad355 2009-06-30T14:23:18 The truncated bit is in the 3rd byte of a dns reply, not the 4th. [fwd-port] svn:r1332
Nick Mathewson f901f986 2009-06-24T22:40:15 When our IP address changes, do not break all existing dns server sockets. Patch from Christopher Davis svn:r1329
Nick Mathewson 7289d7f8 2009-05-22T18:20:59 Fix a potentially very annoying evdns bug that we found in Tor. Generally speaking, it way better to event_assign() an event when you allocate it than to assign it before every time you event_add it: if it is already event_add()ed, the assign will mess it up so that it doesn't _look_ added, and event_add() will insert a second copy. Later, event_del() will only delete the second copy. Eventually, the event_base will have a dangling pointer to freed memory. Ouch! svn:r1307
Nick Mathewson f11dff2c 2009-05-07T03:45:51 Add and use locale-independent strcasecmp functions. svn:r1280
Nick Mathewson 7b24d72a 2009-05-02T16:22:55 Remove some duplicated includes in evdns.c svn:r1265
Nick Mathewson e865eb93 2009-05-01T00:54:14 More msvc build tweaks. svn:r1262
Nick Mathewson 1ad03264 2009-04-23T18:04:50 Fix win32 compilation issues. svn:r1234
Nick Mathewson 9516df0e 2009-04-23T05:40:06 Fix c89 bugs reported by Cory Stup. Others may remain. I wasn't able to get gcc --std=c89 to build libevent at all, so I don't know what compiler the original reporter is using here. Note that this change requires us to disable the part of our rpc code that uses variadic macros when using a non-gcc compiler. This is a problem if we want our rpc api to be portable. svn:r1231
Nick Mathewson 2d9619d7 2009-04-19T01:59:09 Make dns callbacks run deferred svn:r1205
Nick Mathewson 327165b3 2009-04-19T01:58:54 Add locks to evdns. svn:r1204
Nick Mathewson ac3fc991 2009-04-19T01:58:41 Use new-style headers in evdns.c svn:r1203
Nick Mathewson 684c022a 2009-04-06T20:38:42 Avoid a double event_del() in evdns.c. The bug could occur when a nameserver was marked as up, but then an outstanding probe sent to the nameserver failed. Now, evdns_up() cancels any outstanding probe. svn:r1140
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 0f3c0983 2009-04-05T17:50:18 Fix a double-delete on the request timeout event. Port from Tor. svn:r1138
Nick Mathewson d0a9c90e 2009-02-11T17:29:17 Fix some of the crazier indentation and tabbing choices in evdns.c svn:r1120
Nick Mathewson 77c80b8d 2009-02-11T17:24:11 New bind-to option to allow DNS clients to bind to arbitrary ports for their outgoing addresses. svn:r1119
Nick Mathewson acaf65c3 2009-02-11T17:23:32 Make evutil_parse_sockaddr_port give a useful socket-length output. svn:r1118
Nick Mathewson f2a24d6e 2009-02-11T17:22:40 Better comments for some confusing-to-me code. svn:r1117
Nick Mathewson c6f4dc98 2009-02-11T17:21:48 Port some evdns changes over from Tor. svn:r1116
Nick Mathewson cd731b77 2009-02-10T21:40:12 Do not use ctypes functions in cases when we need the "net" locale. This patch adds a new set of EVUTIL_IS* functions to replace use of the ctypes is* functions in all cases where we care about characters' interpretations in net ascii rather than in the locale. For example, when we're working with DNS hostnames, we don't want to do the 0x20 hack on non-ascii characters, even if the host thinks they should be isalpha. svn:r1114
Nick Mathewson 1ed27048 2009-02-10T21:39:56 Stop rolling our own offsetof twice. svn:r1113
Nick Mathewson f04b90e5 2009-02-10T19:43:19 Make a couple of newer evdns functions more bulletproof. svn:r1112
Nick Mathewson 4d92e426 2009-02-02T19:22:27 forward-port: Make evdns_resolve_reverse args const. svn:r1096
Nick Mathewson 52eb4951 2009-01-31T07:31:47 Build with the -fno-strict-aliasing flag on GCC. You do not want to know about the 2 hours I just spent tracking down an evdns bug that only affected me on some platforms to the way we were using sockaddr* and sockaddr_in*. Suffice it to say that I do not think this is the only C99-aliasing-dubiousness in our code, nor that I am smart enough to keep my code correct with the GCC's strict aliasing optimizations in place. svn:r1079
Nick Mathewson 2546ea66 2009-01-31T05:45:26 Do not attempt to pass a va_args to regular snprintf. Hilarity will ensue. Fortunately, 1.4 does not have this bug. svn:r1078
Nick Mathewson e3e696c8 2009-01-28T20:24:12 Use size_t for name length in DNS requests. Not that it matters much. svn:r1066
Nick Mathewson 8889a770 2009-01-27T22:30:46 Replace all use of config.h with event-config.h. svn:r1064
Nick Mathewson 9993137c 2009-01-27T21:10:31 Remove all trailing whitespace in all the source files. svn:r1063
Nick Mathewson 2b1d535e 2009-01-26T17:29:27 Accept evutil_socket_t for evdns_server_ports. svn:r1053
Nick Mathewson 9935d5b0 2009-01-13T21:39:32 Fix win32 compilation. Surprisingly, unit tests pass too. svn:r1002
Nick Mathewson 169321c9 2009-01-13T20:26:37 Rename four internal headers to follow the -internal.h convention. svn:r1000
Nick Mathewson 81ab45ad 2009-01-13T19:20:04 Use new EVUTIL_ERR_*_RETRIABLE macros when we're testing an errno for blocking. Previously, we used inconsistent and incompletely ported ifdefs. (We don't use these macros in platform-specific files like evpoll.c, since they don't need to work on win32.) svn:r995
Nick Mathewson 980bcd68 2009-01-02T21:21:58 Work better with platforms that do not have ipv6 structures, or that do not have sin_len fields, etc. svn:r986
Nick Mathewson 135591ae 2009-01-02T20:46:35 Change the type of nameserver.address from u32 to sockaddr_storage, so that we can handle nameservers at IPv6 addresses. svn:r985
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
Niels Provos 1eeb96aa 2008-11-29T01:12:41 move cirular queue removal into its own function svn:r957
Nick Mathewson de069b99 2008-09-05T16:29:56 On win32, errno is not the last socket error. Worse, WSAGetLastError() is not the last socket error sometimes (i.e., EWOULDBLOCK). Also, strerror() does not handle winsock errors. Therefore, event_err() and event_warn() are completely wrong for windows socket errors. Fix that. svn:r936
Niels Provos a710d817 2008-08-30T23:19:49 Match the query in DNS replies to the query in the request; from Vsevolod Stakhov svn:r930
Niels Provos 12077b4e 2008-07-16T03:47:47 support setting of AA or RD in dns server response svn:r910
Niels Provos 506f3d0c 2008-07-13T20:18:41 fix cname replies svn:r907
Niels Provos 409236a7 2008-07-02T04:39:09 detect CLOCK_MONOTONIC at runtime for evdns svn:r896
Niels Provos 52161b47 2008-06-25T14:56:35 fix a bug in which nameservers would not be added to the correct base in windows. svn:r873
Niels Provos 0bee2ff3 2008-06-25T00:34:24 void function should not return a value svn:r868
Nick Mathewson c6da86ff 2008-05-12T16:44:24 r19709@catbus: nickm | 2008-05-12 12:42:48 -0400 Possible fix for [1960723] snprintf and vsnprintf return values are wrong on win32 svn:r813
Nick Mathewson 6bf1ca78 2008-05-12T00:40:04 r19675@catbus: nickm | 2008-05-11 20:39:39 -0400 Stop pretending that u_char and u_short are standard types that win32 is dumb not to have. In fact, u_char can really just be spelled out, and u_short was usually just a bad way of saying ev_uint16_t. svn:r808
Nick Mathewson 3d60bccc 2008-05-08T14:25:44 r19656@catbus: nickm | 2008-05-08 10:25:08 -0400 forward-port: Remove #include "misc.h"s. svn:r795
Nick Mathewson a26442c5 2008-05-08T14:06:33 r19649@catbus: nickm | 2008-05-08 10:00:14 -0400 Replace gettimeofday() usage with a new evutil_gettimeofday(). This removes all previous need for win32-code/misc.[ch] svn:r792
Nick Mathewson 803dc36a 2008-05-05T19:19:08 r19609@catbus: nickm | 2008-05-05 15:16:52 -0400 Reename evdns-internal struct request to evdns_request, and expose the name. switch new evdns resolve APIs to return evdns_request*. This is a prereq to making evdns requests cancelable. svn:r778
Nick Mathewson 5fbc7f0a 2008-05-02T16:28:25 r15439@tombo: nickm | 2008-05-02 12:28:08 -0400 use event_assign internall; switch uses of event_set to use event_assign instead. svn:r755
Nick Mathewson 49868b61 2008-04-25T01:18:08 r15316@tombo: nickm | 2008-04-24 20:58:36 -0400 Rename internal memory management functions from event_malloc() etc to mm_malloc() etc. svn:r725
Nick Mathewson e688a88a 2008-04-17T17:55:35 r15216@tombo: nickm | 2008-04-17 13:55:05 -0400 Add new thread-safe interfaces to evdns functions. Needs review. svn:r714
Niels Provos 3ef1f504 2008-03-31T00:33:46 do not delete uninitialized timeout event in evdns svn:r697
Nick Mathewson 72105927 2008-02-28T20:57:01 r18490@catbus: nickm | 2008-02-28 15:56:55 -0500 Replace www.google.com with google.com; fix EVDNS_MAIN code. svn:r679
Nick Mathewson 69717730 2008-02-28T20:41:34 r18488@catbus: nickm | 2008-02-28 15:41:27 -0500 Define reentrant in evdns.c so that we get a declaration for strtok_r svn:r678
Nick Mathewson 11230f7e 2008-02-18T20:04:01 r18145@catbus: nickm | 2008-02-18 15:02:20 -0500 Stop using deprecated autoconf code to set integer types; detect actual files to include more thoroughly. This should make us work on solaris 9 again. This should be a backport candidate, if it works. Also, make all libevent code use ev_uint32_t etc, rather than uint_32_t. svn:r649
Niels Provos 506d4dbc 2008-02-17T01:31:31 remove NDEBUG ifdefs from evdns.c svn:r647
Nick Mathewson 7ab26a2c 2007-12-16T18:55:16 r15519@tombo: nickm | 2007-12-16 13:54:12 -0500 Fix for bug 1846282: accept as well-formed DNS replies with questions but no answers. svn:r595
Nick Mathewson 78d0de30 2007-12-06T18:38:50 Fix compile warnings and errors in win32 build. svn:r575
Nick Mathewson 1120f04f 2007-11-25T21:53:06 r16731@catbus: nickm | 2007-11-25 16:52:53 -0500 Replace all fds on non-unix-specific APIs with evutil_socket_t, which is int on unix and intptr_t on win32. svn:r552
Nick Mathewson 7eb250e9 2007-11-25T17:14:19 r14939@tombo: nickm | 2007-11-25 11:59:26 -0500 New function event_set_mem_functions to replace internal calls to malloc, free, etc with a user-supplied functions. svn:r541
Nick Mathewson 4e1ec3e0 2007-11-07T21:01:26 Make all the C files in the libraries compile under MSVC 2005 Express. There are still a few warnings, and probably some subtle issues, but it's better than nothing. svn:r499
Nick Mathewson 45c7ab25 2007-11-07T07:33:36 r16510@catbus: nickm | 2007-11-07 02:29:42 -0500 Try not to shadow local variables or function arguments. svn:r498
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 81802bf9 2007-11-06T20:57:37 r16473@catbus: nickm | 2007-11-06 15:55:35 -0500 Increment MAX_ADDRS in evdns so as to be quite large. This is not as good as a general solution, but it may be good enough for practical use. svn:r479
Nick Mathewson 8b256b8e 2007-09-20T18:26:51 r15218@catbus: nickm | 2007-09-20 14:14:05 -0400 More win32 fixes: Use evutil_make_socket_nonblocking and EVUTIL_CLOSESOCKET consistently throughout the code. svn:r443
Nick Mathewson 626cc5f9 2007-09-19T15:27:53 r15168@catbus: nickm | 2007-09-19 11:24:30 -0400 Add a new function to evdns to override the default transaction ID generation code. svn:r440
Nick Mathewson 82153e6e 2007-09-10T14:56:00 r15025@catbus: nickm | 2007-09-10 10:54:46 -0400 More DNS standard correctness changes: we preserve the CD flag,not the TC flag on responses. When we get a nonstandard query, we should say "NOTIMPL" rather than ignoring it. svn:r428
Nick Mathewson 8b392549 2007-09-10T14:55:55 r15024@catbus: nickm | 2007-09-10 10:49:15 -0400 Fix evdns_resolve_reverse_ipv6() so buffer is bug enough, and so the string ends with ".ip6.arpa" rather than "..ip6.arpa". svn:r427
Nick Mathewson c396c767 2007-09-10T14:55:50 r15023@catbus: nickm | 2007-09-10 10:46:16 -0400 Add a missing begin-comment to the DNS_USE_OPENSSL_FOR_ID code in evdns.c. svn:r426
Niels Provos fc1211ed 2007-09-10T01:37:57 fix another memory leak svn:r424
Niels Provos 7c66bf33 2007-09-10T01:30:11 fix a memory leak in the dns server; found by valgrind svn:r422
Nick Mathewson 3d2320b2 2007-08-19T17:25:52 r14697@catbus: nickm | 2007-08-19 13:24:39 -0400 Remove redundant typedef of socklen_t in evdns.c: On windows, it is already defined by autoconf in config.h. svn:r398
Niels Provos 7c6df310 2007-07-30T23:53:10 remove c++ comments from Jan Kneschke svn:r373
Niels Provos f0ff792a 2007-06-30T18:58:34 fixes from Joerg Sonnenberger: http.c is a violation of the ctype(3) interface and an unused function. test/regress_http.c are incorrect format strings. test/regress.c uses raise(3) from signal.h. evdns.c: evdns_error_strings is unused. The GET* macros can eat the semicolon from the expression. pos is passed in as off_t, so just pass that down. When assigning negativ values to unsigned variables, an explicit cast is considered good style. svn:r367
Niels Provos f0d0559c 2007-05-28T21:21:59 allow DNS server to get access to the IP address for the requestor; from tor cvs via Nick Mathewson svn:r362
Niels Provos 5d3b6a83 2007-05-28T21:20:57 fail quicker on bad replies; from tor cvs via Nick Mathewson svn:r361
Niels Provos d06ab856 2007-05-28T21:19:18 fix bug where req was freed and dereferenced afterwards; from tor cvs via Nick Mathewson svn:r360
Niels Provos 28246587 2007-05-28T21:17:35 treat SERVERFAILED as a timeout; from tor cvs via Nick Mathewson svn:r359
Niels Provos 5be24333 2007-05-28T21:09:00 solaris may return short reads on resolve.conf; fix from tor cvs via Nick Mathewson svn:r358
Niels Provos d0111a29 2007-05-27T06:27:11 evdns_shutdown fix from Adam Langley svn:r357
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 78f2aa30 2007-01-27T04:27:59 Allow setting of more DNS options via API; from Nick Mathewson!!! svn:r318
Niels Provos b776b2da 2007-01-27T04:25:46 dns name compression; from Nick Mathewson!! svn:r317
Niels Provos 5baf8ecf 2007-01-27T04:23:33 minor fixes; spelling corrections; compatibility from Nick Mathewson! svn:r316
Niels Provos 6318fca2 2007-01-27T04:22:36 AAAA support for DNS; from Nick Mathewson. unfortunately, no regression test svn:r315
Niels Provos b04043ae 2007-01-21T17:28:55 fix ddos in dns parsing due to infinite loop; patch from Nick Mathewson; also received notification from Jon Oberheide. svn:r311
Niels Provos 0147ef3a 2006-12-12T04:02:07 From Nick Mathewson: This patch resets the successive timeout count to zero when: - A nameserver comes up - We receive a reply from a nameserver - We decide to not use the nameserver for a while because of its timeout count. This patch also changes the timeout threshold from 3 to 5 seconds. svn:r303
Niels Provos 7fe5edf5 2006-12-02T21:25:21 use CLOCK_REALTIME when CLOCK_MONOTONIC is not available; from Phil Oleson svn:r290
Niels Provos 3882669d 2006-11-23T05:27:15 transaction id fixes from richard nyberg; return correct error code when file for resolv.conf cannot be found. svn:r276
Niels Provos 868f10e7 2006-11-22T01:21:10 mingw fixes from Nick svn:r271
Niels Provos ddf70659 2006-11-18T03:52:27 forgot ifdef guard around stdint.h svn:r263