82 Commits

Author SHA1 Message Date
Nick Mathewson
1ed27048e4 Stop rolling our own offsetof twice.
svn:r1113
2009-02-10 21:39:56 +00:00
Nick Mathewson
f04b90e5b3 Make a couple of newer evdns functions more bulletproof.
svn:r1112
2009-02-10 19:43:19 +00:00
Nick Mathewson
4d92e4261b forward-port: Make evdns_resolve_reverse args const.
svn:r1096
2009-02-02 19:22:27 +00:00
Nick Mathewson
52eb495130 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
2009-01-31 07:31:47 +00:00
Nick Mathewson
2546ea665e Do not attempt to pass a va_args to regular snprintf. Hilarity will ensue. Fortunately, 1.4 does not have this bug.
svn:r1078
2009-01-31 05:45:26 +00:00
Nick Mathewson
e3e696c822 Use size_t for name length in DNS requests. Not that it matters much.
svn:r1066
2009-01-28 20:24:12 +00:00
Nick Mathewson
8889a77039 Replace all use of config.h with event-config.h.
svn:r1064
2009-01-27 22:30:46 +00:00
Nick Mathewson
9993137cbb Remove all trailing whitespace in all the source files.
svn:r1063
2009-01-27 21:10:31 +00:00
Nick Mathewson
2b1d535e0d Accept evutil_socket_t for evdns_server_ports.
svn:r1053
2009-01-26 17:29:27 +00:00
Nick Mathewson
9935d5b01e Fix win32 compilation. Surprisingly, unit tests pass too.
svn:r1002
2009-01-13 21:39:32 +00:00
Nick Mathewson
169321c9e6 Rename four internal headers to follow the -internal.h convention.
svn:r1000
2009-01-13 20:26:37 +00:00
Nick Mathewson
81ab45add5 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
2009-01-13 19:20:04 +00:00
Nick Mathewson
980bcd68f7 Work better with platforms that do not have ipv6 structures, or that do not have sin_len fields, etc.
svn:r986
2009-01-02 21:21:58 +00:00
Nick Mathewson
135591aeab Change the type of nameserver.address from u32 to sockaddr_storage, so that we can handle nameservers at IPv6 addresses.
svn:r985
2009-01-02 20:46:35 +00:00
Niels Provos
87be18daa1 implement evdns_cancel_request; test one of the new evdns_base functions
svn:r980
2008-12-25 16:25:37 +00:00
Nick Mathewson
dd73168556 Implement increased DSN-poisoning resistance via the 0x20 hack.
svn:r958
2008-12-03 20:09:13 +00:00
Niels Provos
1eeb96aa88 move cirular queue removal into its own function
svn:r957
2008-11-29 01:12:41 +00:00
Nick Mathewson
de069b9977 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
2008-09-05 16:29:56 +00:00
Niels Provos
a710d817ad Match the query in DNS replies to the query in the request; from Vsevolod Stakhov
svn:r930
2008-08-30 23:19:49 +00:00
Niels Provos
12077b4e2e support setting of AA or RD in dns server response
svn:r910
2008-07-16 03:47:47 +00:00
Niels Provos
506f3d0c8d fix cname replies
svn:r907
2008-07-13 20:18:41 +00:00
Niels Provos
409236a77d detect CLOCK_MONOTONIC at runtime for evdns
svn:r896
2008-07-02 04:39:09 +00:00
Niels Provos
52161b47b6 fix a bug in which nameservers would not be added to the correct base in windows.
svn:r873
2008-06-25 14:56:35 +00:00
Niels Provos
0bee2ff383 void function should not return a value
svn:r868
2008-06-25 00:34:24 +00:00
Nick Mathewson
c6da86ffcb 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
2008-05-12 16:44:24 +00:00
Nick Mathewson
6bf1ca780c 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
2008-05-12 00:40:04 +00:00
Nick Mathewson
3d60bccc8e r19656@catbus: nickm | 2008-05-08 10:25:08 -0400
forward-port: Remove #include "misc.h"s.


svn:r795
2008-05-08 14:25:44 +00:00
Nick Mathewson
a26442c5ac 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
2008-05-08 14:06:33 +00:00
Nick Mathewson
803dc36ad8 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
2008-05-05 19:19:08 +00:00
Nick Mathewson
5fbc7f0aee 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
2008-05-02 16:28:25 +00:00
Nick Mathewson
49868b618a 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
2008-04-25 01:18:08 +00:00
Nick Mathewson
e688a88a82 r15216@tombo: nickm | 2008-04-17 13:55:05 -0400
Add new thread-safe interfaces to evdns functions. Needs review.


svn:r714
2008-04-17 17:55:35 +00:00
Niels Provos
3ef1f50415 do not delete uninitialized timeout event in evdns
svn:r697
2008-03-31 00:33:46 +00:00
Nick Mathewson
7210592777 r18490@catbus: nickm | 2008-02-28 15:56:55 -0500
Replace www.google.com with google.com; fix EVDNS_MAIN code.


svn:r679
2008-02-28 20:57:01 +00:00
Nick Mathewson
697177306f 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
2008-02-28 20:41:34 +00:00
Nick Mathewson
11230f7e16 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
2008-02-18 20:04:01 +00:00
Niels Provos
506d4dbcf4 remove NDEBUG ifdefs from evdns.c
svn:r647
2008-02-17 01:31:31 +00:00
Nick Mathewson
7ab26a2c32 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
2007-12-16 18:55:16 +00:00
Nick Mathewson
78d0de30b8 Fix compile warnings and errors in win32 build.
svn:r575
2007-12-06 18:38:50 +00:00
Nick Mathewson
1120f04f3e 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
2007-11-25 21:53:06 +00:00
Nick Mathewson
7eb250e9c5 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
2007-11-25 17:14:19 +00:00
Nick Mathewson
4e1ec3e05e 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
2007-11-07 21:01:26 +00:00
Nick Mathewson
45c7ab25de r16510@catbus: nickm | 2007-11-07 02:29:42 -0500
Try not to shadow local variables or function arguments.


svn:r498
2007-11-07 07:33:36 +00:00
Nick Mathewson
7c507668d7 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
2007-11-07 03:52:20 +00:00
Nick Mathewson
81802bf98c 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
2007-11-06 20:57:37 +00:00
Nick Mathewson
8b256b8e86 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
2007-09-20 18:26:51 +00:00
Nick Mathewson
626cc5f982 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
2007-09-19 15:27:53 +00:00
Nick Mathewson
82153e6e92 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
2007-09-10 14:56:00 +00:00
Nick Mathewson
8b39254926 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
2007-09-10 14:55:55 +00:00
Nick Mathewson
c396c767e2 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
2007-09-10 14:55:50 +00:00