summaryrefslogtreecommitdiff
path: root/src/or/dns.c
AgeCommit message (Collapse)Author
2012-01-17Use SOCKET_OK macros in even more placesNick Mathewson
Add a TOR_INVALID_SOCKET macro to wrap -1/INVALID_SOCKET. Partial work for bug4533.
2011-11-29Make sure we never launch an evdns resolve when DisableNetwork is 1Nick Mathewson
2011-10-11Change "reverse_lookup_name" functions to refer to "PTR_name"sNick Mathewson
Under the new convention, having a tor_addr.*lookup function that doesn't do hostname resolution is too close for comfort. I used this script here, and have made no other changes. s/tor_addr_parse_reverse_lookup_name/tor_addr_parse_PTR_name/g; s/tor_addr_to_reverse_lookup_name/tor_addr_to_PTR_name/g;
2011-10-11Fix names of functions that convert strings to addrsNick Mathewson
Now let's have "lookup" indicate that there can be a hostname resolution, and "parse" indicate that there wasn't. Previously, we had one "lookup" function that did resolution; four "parse" functions, half of which did resolution; and a "from_str()" function that didn't do resolution. That's confusing and error-prone! The code changes in this commit are exactly the result of this perl script, run under "perl -p -i.bak" : s/tor_addr_port_parse/tor_addr_port_lookup/g; s/parse_addr_port(?=[^_])/addr_port_lookup/g; s/tor_addr_from_str/tor_addr_parse/g; This patch leaves aton and pton alone: their naming convention and behavior is is determined by the sockets API. More renaming may be needed.
2011-06-14Make the get_options() return constNick Mathewson
This lets us make a lot of other stuff const, allows the compiler to generate (slightly) better code, and will make me get slightly fewer patches from folks who stick mutable stuff into or_options_t. const: because not every input is an output!
2011-05-20Merge branch 'maint-0.2.2'Roger Dingledine
2011-05-19log the reason for publishing a new relay descriptorRoger Dingledine
now we have a better chance of hunting down the root cause of bug 1810.
2011-04-07Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
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
2011-03-25Fixup tor_addr_to_sockaddr return conventionNick Mathewson
2011-01-12Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-01-09Add missing parens to evdns_base_resolve_* macros while I am at itNick Mathewson
2011-01-09Fix check for failed evdns request creationNick Mathewson
When using libevent 2, we use evdns_base_resolve_*(). When not, we fake evdns_base_resolve_*() using evdns_resolve_*(). Our old check was looking for negative values (like libevent 2 returns), but our eventdns.c code returns 1. This code makes the check just test for nonzero. Note that this broken check was not for _resolve_ failures or even for failures to _launch_ a resolve: it was for failures to _create_ or _encode_ a resolve request. Bug introduced in 81eee0ecfff3dac1e9438719d2f7dc0ba7e84a71; found by lodger; uploaded to trac by rransom. Bug 2363. Fix on 0.2.2.6-alpha.
2011-01-03Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-01-03Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2011-01-03Bump copyright statements to 2011Nick Mathewson
2010-10-01Try to make most routerinfo_t interfaces constNick Mathewson
2010-07-27Create relay.hSebastian Hahn
2010-07-27Create policies.hSebastian Hahn
2010-07-27Create main.hSebastian Hahn
2010-07-27Create dns.hSebastian Hahn
2010-07-27Create control.hSebastian Hahn
2010-07-27Create connection_edge.hSebastian Hahn
2010-07-27Create connection.hSebastian Hahn
2010-07-27Create config.hSebastian Hahn
2010-07-27Create circuituse.hSebastian Hahn
2010-07-27Create circuitlist.hSebastian Hahn
2010-07-27Create router.hSebastian Hahn
2010-05-20Log the correct address when purging a mismatchd DNS cache addressvalerino
2010-04-03Fix a segfault when a client is hup'd.Sebastian Hahn
We need to make sure we have an event_base in dns.c before we call anything that wants one. Make sure we always have one in dns_reset() when we're a client. Fixes bug 1341.
2010-02-27Merge remote branch 'origin/maint-0.2.1'Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2010-02-27Update Tor Project copyright yearsNick Mathewson
2010-02-15Build correctly with Libevent 2.0.4-alpha and laterNick Mathewson
2010-02-09Make tor_addr_copy() conform to memcpy requirementsNick Mathewson
The src and dest of a memcpy() call aren't supposed to overlap, but we were sometimes calling tor_addr_copy() as a no-op. Also, tor_addr_assign was a redundant copy of tor_addr_copy(); this patch removes it.
2009-12-18Merge branch 'ewma'Nick Mathewson
2009-12-15Merge branch 'safelogging2'Nick Mathewson
Conflicts: ChangeLog
2009-12-15Refactor the safe_str_*() API to make more sense.Nick Mathewson
The new rule is: safe_str_X() means "this string is a piece of X information; make it safe to log." safe_str() on its own means "this string is a piece of who-knows-what; make it safe to log".
2009-12-12Enhance pqueue so we can remove items from the middle.Nick Mathewson
This changes the pqueue API by requiring an additional int in every structure that we store in a pqueue to hold the index of that structure within the heap.
2009-12-12Now that FOO_free(NULL) always works, remove checks before calling it.Nick Mathewson
2009-12-12*_free functions now accept NULLSebastian Hahn
Some *_free functions threw asserts when passed NULL. Now all of them accept NULL as input and perform no action when called that way. This gains us consistence for our free functions, and allows some code simplifications where an explicit null check is no longer necessary.
2009-12-12Allow SafeLogging to exclude client related informationSebastian Hahn
2009-10-13Another event2 evdns fix.Nick Mathewson
2009-10-13Fix a crash when using evdns from Libevent 2.Nick Mathewson
When we tried to use the deprecated non-threadsafe evdns interfaces in Libevent 2 without using the also-deprecated event_init() interface, Libevent 2 would sensibly crash, since it has no guess where to find the Libevent library. Here we use the evdns_base_*() functions instead if they're present, and fake them if they aren't.
2009-07-13fix comments and other typosRoger Dingledine
2009-06-12Isolate Libevent API dependency to just main.c and dns.c in src/or.Nick Mathewson
The rest of the code was only including event.h so that it could see EV_READ and EV_WRITE, which we were using as part of the connection_watch_events interface for no very good reason.
2009-06-12Update Tor to use Libevent 2.0 APIs when available.Nick Mathewson
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).
2009-06-04Merge commit 'origin/maint-0.2.1'Nick Mathewson
2009-06-03Fix gprof bottlenecks on exit nodes found by Jacob.Nick Mathewson
Apparently all the stuff that does a linear scan over all the DNS cache entries can get really expensive when your DNS cache is very large. It's hard to say how much this will help performance, since gprof doesn't count time spent in OpenSSL or zlib, but I'd guess 10%. Also, this patch removes calls to assert_connection_ok() from inside the read and write callbacks, which are similarly unneeded, and a little costlier than I'm happy with. This is probably worth backporting to 0.2.0.
2009-05-27Merge commit 'origin/maint-0.2.1'Nick Mathewson
2009-05-27Spell-check Tor.Nick Mathewson
2009-05-24fix codestyle issuesSebastian Hahn