aboutsummaryrefslogtreecommitdiff
path: root/src/or/eventdns.c
Commit message (Collapse)AuthorAge
* Be more careful calling wcstombsNick Mathewson2012-06-07
| | | | | | | | | | | The function is not guaranteed to NUL-terminate its output. It *is*, however, guaranteed not to generate more than two bytes per multibyte character (plus terminating nul), so the general approach I'm taking is to try to allocate enough space, AND to manually add a NUL at the end of each buffer just in case I screwed up the "enough space" thing. Fixes bug 5909.
* Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32Nick Mathewson2012-01-31
| | | | | | | | | | | This commit is completely mechanical; I used this perl script to make it: #!/usr/bin/perl -w -i.bak -p if (/^\s*\#/) { s/MS_WINDOWS/_WIN32/g; s/\bWIN32\b/_WIN32/g; }
* Rewrite comment at head of eventdns.cNick Mathewson2011-11-09
| | | | | | | | Let's make it more obvious to the everyday reader that eventdns.c is a) Based on Libevent's evdns.c b) Slated for demolition c) Supposed to keep API-compatibility with Libevent. d) Not worth tweaking unless there's a bug.
* Remove some duplicate includesAndrea Gelmini2011-11-03
|
* Don't shadow parameters with local variablesNick Mathewson2011-07-01
| | | | | | | | This is a little error-prone when the local has a different type from the parameter, and is very error-prone with both have the same type. Let's not do this. Fixes CID #437,438,439,440,441.
* Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-30
|\ | | | | | | | | | | Conflicts: src/common/compat.c src/or/main.c
| * Merge remote-tracking branch 'public/bug3270' into maint-0.2.2Nick Mathewson2011-05-30
| |\
| | * Use a 64-bit type to hold sockets on win64.Nick Mathewson2011-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On win64, sockets are of type UINT_PTR; on win32 they're u_int; elsewhere they're int. The correct windows way to check a socket for being set is to compare it with INVALID_SOCKET; elsewhere you see if it is negative. On Libevent 2, all callbacks take sockets as evutil_socket_t; we've been passing them int. This patch should fix compilation and correctness when built for 64-bit windows. Fixes bug 3270.
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-28
|\| | | | | | | | | | | | | | Conflicts: src/or/eventdns.c
| * | Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-05-28
| |\ \
| | * \ Merge branch 'bug2574' into maint-0.2.1Nick Mathewson2011-05-28
| | |\ \
| | | * | Work correctly if your nameserver is ::1Nick Mathewson2011-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had all the code in place to handle this right... except that we were unconditionally opening a PF_INET socket instead of looking at sa_family. Ow. Fixes bug 2574; not a bugfix on any particular version, since this never worked before.
* | | | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-28
|\| | | |
| * | | | Fix GCC 4.6's new -Wunused-but-set-variable warnings.Nick Mathewson2011-05-23
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most instances were dead code; for those, I removed the assignments. Some were pieces of info we don't currently plan to use, but which we might in the future. For those, I added an explicit cast-to-void to indicate that we know that the thing's unused. Finally, one was a case where we were testing the wrong variable in a unit test. That one I fixed. This resolves bug 3208.
* | | | Merge remote-tracking branch 'public/bug3122_memcmp_022' into bug3122_memcmp_023Nick Mathewson2011-05-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts in various places, mainly node-related. Resolved them in favor of HEAD, with copying of tor_mem* operations from bug3122_memcmp_022. src/common/Makefile.am src/or/circuitlist.c src/or/connection_edge.c src/or/directory.c src/or/microdesc.c src/or/networkstatus.c src/or/router.c src/or/routerlist.c src/test/test_util.c
| * | | Hand-tune the new tor_memcmp instances in 0.2.2Nick Mathewson2011-05-11
| | | |
| * | | Re-apply the automated conversion to 0.2.2 to make handle any memcmps that ↵Nick Mathewson2011-05-11
| | | | | | | | | | | | | | | | snuck in
| * | | Merge remote-tracking branch 'public/3122_memcmp_squashed' into ↵Nick Mathewson2011-05-11
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug3122_memcmp_022 Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
| | * | Hand-conversion and audit phase of memcmp transitionNick Mathewson2011-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here I looked at the results of the automated conversion and cleaned them up as follows: If there was a tor_memcmp or tor_memeq that was in fact "safe"[*] I changed it to a fast_memcmp or fast_memeq. Otherwise if there was a tor_memcmp that could turn into a tor_memneq or tor_memeq, I converted it. This wants close attention. [*] I'm erring on the side of caution here, and leaving some things as tor_memcmp that could in my opinion use the data-dependent fast_memcmp variant.
| | * | Automated conversion of memcmp to tor_memcmp/tor_mem[n]eqNick Mathewson2011-05-11
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-04-26
|\| |
| * | Merge remote-tracking branch 'public/bug2332' into maint-0.2.2Nick Mathewson2011-04-26
| |\ \
| | * | Make eventdns server functions const void* to match libeventNick Mathewson2011-01-10
| | | | | | | | | | | | | | | | partial fix for bug 2332
* | | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-04-21
|\| | |
| * | | Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-04-21
| |\ \ \ | | | |/ | | |/|
| | * | Fix a bug in removing DNSPort requests from their circular listNick Mathewson2011-04-21
| | | | | | | | | | | | | | | | | | | | Under heavy load, this could result in an assertion failure. Fix for bug 2933; bugfix on 0.2.0.10-alpha.
* | | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-04-07
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/common/address.c src/common/compat_libevent.c src/common/memarea.c src/common/util.h src/or/buffers.c src/or/circuitbuild.c src/or/circuituse.c src/or/connection.c src/or/directory.c src/or/networkstatus.c src/or/or.h src/or/routerlist.c
| * | | Triage the XXX022 and XXX021 comments remaining in the codeNick Mathewson2011-03-25
| | |/ | |/| | | | | | | | | | Remove some, postpone others, leave some alone. Now the only remaining XXX022s are ones that seem important to fix or investigate.
* | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-03
|\| |
| * | Fix compile wanrings revealed by gcc 4.5 on mingwSebastian Hahn2010-12-27
| | |
* | | Open connection to DNS resolvers with CLOEXEC flag setSteven Murdoch2010-12-01
| | | | | | | | | | | | NB: this will now register the socket with the socket accounting code
* | | Initial work to set CLOEXEC on all possible fdsNick Mathewson2010-11-20
|/ / | | | | | | Still to go: some pipes, all stdio files.
* | Consistency issues in load_windows_system_library patch. Thanks SebastianNick Mathewson2010-09-24
| |
* | Use load_windows_system_library in place of LoadLibraryNick Mathewson2010-09-21
| |
* | Attempt to fix compilation on WindowsSebastian Hahn2010-09-19
| | | | | | | | | | | | | | Our attempt to make compilation work on old versions of Windows again while keeping wince compatibility broke the build for Win2k+. helix reports this patch fixes the issue for WinXP. Bugfix on 0.2.2.15-alpha; related to bug 1797.
* | Make the windows build succeed with or without -DUNICODE enabled.Nick Mathewson2010-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This should keep WinCE working (unicode always-on) and get Win98 working again (unicode never-on). There are two places where we explicitly use ASCII-only APIs, still: in ntmain.c and in the unit tests. This patch also fixes a bug in windoes tor_listdir that would cause the first file to be listed an arbitrary number of times that was also introduced with WinCE support. Should fix bug 1797.
* | Port Tor to work on Windows CEvalerino2010-05-24
| | | | | | | | | | | | | | | | | | | | | | | | Most of the changes here are switches to use APIs available on Windows CE. The most pervasive change is that Windows CE only provides the wide-character ("FooW") variants of most of the windows function, and doesn't support the older ASCII verions at all. This patch will require use of the wcecompat library to get working versions of the posix-style fd-based file IO functions. [commit message by nickm]
* | Try to untangle the logic in server_port_flushNick Mathewson2010-01-25
| | | | | | | | | | | | | | | | | | | | | | It's a bit confusing to have a loop where another function, confusingly named "*_free", is responsible for advancing the loop variable (or rather, for altering a structure so that the next time the loop variable's initializer is evaluated it evaluates to something different.) Not only has this confused people: it's also confused coverity scan. Let's fix that.
* | Don't use OutboundBindAddress to connect to localhostNick Mathewson2010-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OutboundBindAddress option is useful for making sure that all of your outbond connections use a given interface. But when connecting to 127.0.0.1 (or ::1 even) it's important to actually have the connection come _from_ localhost, since lots of programs running on localhost use the source address to authenticate that the connection is really coming from the same host. Our old code always bound to OutboundBindAddress, whether connecting to localhost or not. This would potentially break DNS servers on localhost, and socks proxies on localhost. This patch changes the behavior so that we only look at OutboundBindAddress when connecting to a non-loopback address.
* | Include util.h and log.h as relative paths.Nathan Freitas2009-09-29
| | | | | | | | | | | | | | This shouldn't be necessary, but apparently the Android cross-compiler doesn't respect -I as well as it should. (-I is supposed to add to the *front* of the search path. Android's gcc wrapper apparently likes to add to the end. This is broken, but we need to work around it.)
* | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-09-01
|\|
| * Fix compile warnings on Snow LeopardSebastian Hahn2009-09-01
| | | | | | | | Big thanks to nickm and arma for helping me with this!
* | Switch over to tor_strtok_r instead of strtok_r.Mike Perry2009-08-09
| |
* | Merge commit 'origin/maint-0.2.1'Nick Mathewson2009-06-30
|\|
| * Have eventdns set the "truncated" bit correctly.Nick Mathewson2009-06-30
| | | | | | | | | | Fixed bug 1022; This isn't actually a live bug in Tor, since in Tor we never generate large DNS replies.
* | Update Tor to use Libevent 2.0 APIs when available.Nick Mathewson2009-06-12
| | | | | | | | | | | | | | | | | | | | This patch adds a new compat_libevent.[ch] set of files, and moves our Libevent compatibility and utilitity functions there. We build them into a separate .a so that nothing else in src/commmon depends on Libevent (partially fixing bug 507). Also, do not use our own built-in evdns copy when we have Libevent 2.0, whose evdns is finally good enough (thus fixing Bug 920).
* | Merge commit 'origin/maint-0.2.1' into master.Nick Mathewson2009-05-25
|\| | | | | | | | | | | | | | | Conflicts: ChangeLog configure.in contrib/tor-mingw.nsi.in src/win32/orconfig.h
| * Use tor_socket_strerror in eventdns.c. Fixes bug 987.Nick Mathewson2009-05-25
| |
* | Improved bug-957 fix for 0.2.2.Nick Mathewson2009-05-22
|/ | | | | | | | | Really, our idiocy was that we were calling event_set() on the same event more than once, which sometimes led to us calling event_set() on an event that was already inserted, thus making it look uninserted. With this patch, we just initialize the timeout events when we create the requests and nameservers, and we don't need to worry about double-add and double-del cases at all.
* Finish up the 0.2.1 version of the bug 957 fix.Nick Mathewson2009-05-22
| | | | | | Basically, all this means is downgrading our warning messages to debug messages, since the bug workaround code here is adequate to stop the bug.