Commit Graph

300 Commits

Author SHA1 Message Date
Nick Mathewson
7239262f71 Don't tell anybody, but we're going OO here. This patch splits
circuit_t into origin_circuit_t and or_circuit_t.  I fixed some
segaults; there may be more.  We still need to move more rendezvous
stuff into subtypes.

This is a trial run for splitting up connection_t; if the approach is
insane, please say so soon so we can do something smarter.

Also, this discards the old HALF_OPEN code, which nobody seems to
want.


svn:r6817
2006-07-23 07:37:35 +00:00
Nick Mathewson
64c14d8ce3 These asserts will either cause spurious crashes or help debug the pend->conn->s == -1 issue.
svn:r6803
2006-07-21 22:02:58 +00:00
Roger Dingledine
3d79eb52ab stick to nick's nul/null convention
svn:r6763
2006-07-15 19:21:30 +00:00
Nick Mathewson
a0cf95e1c9 Add some debugging asserts to dns.c; these are too expensive to leave in permanently.
svn:r6756
2006-07-11 20:51:58 +00:00
Nick Mathewson
39344fc301 Add a const; fix a (probably harmless) bug when storing a resolve we forgot we asked for.
svn:r6751
2006-07-10 18:38:57 +00:00
Nick Mathewson
a40ad152b1 When using eventdns: suppress logging of addresses when SafeLogging is active, and make set of nameservers configurable from torrc.
svn:r6744
2006-07-07 17:33:30 +00:00
Nick Mathewson
3c4205c872 Clean up eventdns messages.
svn:r6730
2006-07-05 21:42:18 +00:00
Nick Mathewson
42ef3bd90c Add plausile logging support to eventdns; stop putting stuff onto stdout.
svn:r6728
2006-07-05 21:28:37 +00:00
Roger Dingledine
af0e47c921 fix spacing
svn:r6628
2006-06-15 22:59:07 +00:00
Roger Dingledine
87e3800dfc Finally solve the "closing wedged cpuworkers" bug. Woo.
This happened when we got two create cells in a row from the same TLS
connection. It would hand one to the cpuworker, and then immediately
handle the second one -- after it had registered that the first one was
busy, but before it had updated the timestamp that we use to decide how
*long* it's been busy.


svn:r6606
2006-06-12 11:59:19 +00:00
Roger Dingledine
5c57348acd We got an obscure report of an assert error on a windows Tor server with
connection_add being called with socket = -1. The only places I can see
where that happen would be if our tor_socketpair succeeds but it hands
back negative values for some of its file descriptors. Perhaps this will
produce more useful assert errors next time.


svn:r6550
2006-06-06 00:06:52 +00:00
Nick Mathewson
2bd7c19b73 Try to log useful messages at info and debug about what we are resolving and what answers we are getting wrt eventdns.
svn:r6547
2006-06-05 23:01:22 +00:00
Nick Mathewson
3db785ef73 Hm. Where did we put that ntohl the last time we were juggling it? (hoop-lah).
svn:r6534
2006-06-05 00:32:31 +00:00
Nick Mathewson
853e2d99b6 Add a new warning to our "warn a lot" list: unused parameters. This means we have to explicitly "use" unuseds, but it can catch bugs. (It caught two coding mistakes so far.)
svn:r6532
2006-06-04 22:42:13 +00:00
Nick Mathewson
c660a0f6a2 More DNS fixes. Send meaningful TTLs back to the client when
possible.  Cache at the server side independently from the TTL, to
prevent attackers from probing the server to see who has been asking
for what hostnames.  (Hi, Dan Kaminski!)

Also, clean some whitespace.


svn:r6526
2006-06-03 21:41:14 +00:00
Nick Mathewson
85a25c8a29 Make dns.c use eventdns.c -- but only when you pass the --enable-eventdns argument to configure.in. This will *so* not work on Windows yet.
svn:r6525
2006-06-03 20:52:24 +00:00
Roger Dingledine
6b058bd563 add a few more debugging lines to help mikec track down his
11 minute jump into the future.


svn:r6465
2006-05-23 03:08:30 +00:00
Nick Mathewson
6ebd886511 forward-port: "Resolve" all XXX011 items, mostly by marking them non-011.
svn:r6396
2006-04-18 03:07:24 +00:00
Roger Dingledine
d1d0813cf3 Allow non-printable characters for exit streams (both for
connecting and for resolving). Now we tolerate applications
that don't follow the RFCs. But continue to block malformed
names at the socks side.


svn:r6193
2006-03-19 03:55:48 +00:00
Roger Dingledine
aa63a84fe1 the things we do for our windows users.
i hope they appreciate it.


svn:r6004
2006-02-13 09:37:53 +00:00
Roger Dingledine
5f051574d5 Happy new year!
svn:r5949
2006-02-09 05:46:49 +00:00
Roger Dingledine
b038dc9ecc disambiguate some debug entries
svn:r5654
2005-12-26 22:42:22 +00:00
Nick Mathewson
1af630d32c Bite the bullet and limit all our source lines to 80 characters, the way IBM intended.
svn:r5582
2005-12-14 20:40:40 +00:00
Roger Dingledine
58366ffd24 when we changed from log_fn to debug/info/notice/warn/err,
we screwed up the formatting in wild and unpredictable ways.

fix it before it becomes convention to format logs in wild and
unpredictable ways.

still need to do src/common/ someday.


svn:r5551
2005-12-10 09:36:26 +00:00
Nick Mathewson
77a494dd55 Expunge remaining places where we used "tree" to mean "associative array".
svn:r5490
2005-12-03 02:21:31 +00:00
Nick Mathewson
502cb59611 Remove "tree" references from dns.
svn:r5488
2005-12-03 02:01:18 +00:00
Nick Mathewson
a39269572f Replace balanced trees with hash tables: this should make stuff significantly faster.
svn:r5441
2005-11-23 04:18:45 +00:00
Nick Mathewson
9492424d3f Per comments at the bottom of openssl/FAQ, call even more functions to
clean up OpenSSL's toys when it's done playing.  (Why isn't there an
OpenSSL_free_everything() function?)


svn:r5321
2005-10-25 19:01:48 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Nick Mathewson
049f6c0131 Switch remaining files to new log interface.
svn:r5315
2005-10-25 17:52:14 +00:00
Nick Mathewson
92451f74a8 Reformat inconsistent function declarations.
svn:r5160
2005-09-30 01:09:52 +00:00
Roger Dingledine
512d6ccdc1 and a minor log cleanup
svn:r5115
2005-09-23 00:04:53 +00:00
Roger Dingledine
d050ff7906 resolve lucky's recent bug: tor was exiting if we failed to spawn
a new dns worker (e.g. because we were out of fd's).


svn:r5112
2005-09-22 23:43:41 +00:00
Roger Dingledine
843550721a stop notifying people about dns worker spawning and culling
it just freaks them out


svn:r4960
2005-09-09 02:03:31 +00:00
Nick Mathewson
a6a45b7713 Add TTLs to RESOLVED, CONNECTED, and END_REASON_EXITPOLICY cells. Also, add a missing ntohl in connection_ap_handshake_socks_resolved.
svn:r4894
2005-09-02 18:53:31 +00:00
Roger Dingledine
04d42ea433 rotate dns and cpu workers if the controller changes options that
will affect them.


svn:r4787
2005-08-15 23:46:18 +00:00
Roger Dingledine
10ff723938 initialize the dns worker cache tree whether or not we start
out as a server.


svn:r4785
2005-08-15 10:27:37 +00:00
Roger Dingledine
87fcd60aa2 predict required circuits better, with an eye toward making
hidden services faster on the service end.


svn:r4772
2005-08-13 00:22:07 +00:00
Nick Mathewson
18c11eb3bc Be consistent about preferring foo* to struct foo*
svn:r4637
2005-07-22 21:12:10 +00:00
Nick Mathewson
d85bfe83bf Make errors retrievable from tor_socketpair; resolve bug 163.
svn:r4509
2005-06-30 07:17:38 +00:00
Roger Dingledine
caf7af26d7 whitespace fix
svn:r4500
2005-06-28 01:53:15 +00:00
Roger Dingledine
00a7a37c94 we were printing the number of idle dns workers incorrectly.
svn:r4477
2005-06-23 07:57:43 +00:00
Nick Mathewson
232861ba42 Docment or add DOCDOC comments to undocumented functions in src/or. Make function definition format uniform.
svn:r4411
2005-06-11 18:52:12 +00:00
Roger Dingledine
fcd0fc3364 flesh out the source file descriptions for doxygen
svn:r4404
2005-06-11 05:31:17 +00:00
Nick Mathewson
0831823763 Change end-of-file NLNL convention. It turns out arma I and I agree.
svn:r4382
2005-06-09 19:03:31 +00:00
Nick Mathewson
a6f51001a5 New whitespace normalization rule: no blank line at EOF.
svn:r4378
2005-06-09 16:46:51 +00:00
Nick Mathewson
10b2208d93 Make Tor compile with no warnings with gcc4.0 on OSX
svn:r4184
2005-05-07 05:55:06 +00:00
Roger Dingledine
68ba303323 fix compile error if you're not multithreaded
svn:r4177
2005-05-03 18:44:20 +00:00
Roger Dingledine
5265bbd2b8 first iteration of scrubbing sensitive strings from logs.
also generally clean up log messages.


svn:r4174
2005-05-03 10:04:08 +00:00
Nick Mathewson
b35f7dacef Call tor_free_all instead of connections_free_all after forking
svn:r4173
2005-05-03 03:51:20 +00:00
Roger Dingledine
4eb3cf9330 a bit more debug info
svn:r4119
2005-04-26 20:05:15 +00:00
Roger Dingledine
953cf91ecd add more debugging info to help us find the weird dns freebsd pthreads bug.
svn:r4117
2005-04-26 19:08:06 +00:00
Roger Dingledine
509405a5f7 clean up this TOR_FRAGILE business
svn:r4116
2005-04-26 18:52:16 +00:00
Roger Dingledine
03720b39fd stop wasting time doing a case insensitive comparison for every dns name
every time we do any lookup. canonicalize the names to lowercase and be
done with it.


svn:r4035
2005-04-06 20:25:21 +00:00
Nick Mathewson
88dc243bb5 Rename circuit_get_by_stream to circuit_get_by_edge_conn, and actually start using it. Watch out, kids!
svn:r4026
2005-04-06 06:43:21 +00:00
Nick Mathewson
4453e3794a Add a pointer from edge connections to their corresponding circuit (ulp!); add some debugging sanity-checking for cirid_orconn_map stuff
svn:r4024
2005-04-06 06:13:49 +00:00
Nick Mathewson
b34d9adb59 Fix format warning
svn:r4022
2005-04-06 05:44:05 +00:00
Roger Dingledine
712d05c19a a bit more data on gene's dns threading bug
svn:r4019
2005-04-06 05:32:24 +00:00
Nick Mathewson
46be0fa999 Make last fix work on windows too.
svn:r4009
2005-04-04 21:53:26 +00:00
Nick Mathewson
0fff263a46 Fix possible bug on threading platforms with running out of fds do to cpuworkers and dnsworkers.
svn:r4008
2005-04-04 21:46:08 +00:00
Nick Mathewson
0e81265359 update copyright notices.
svn:r3982
2005-04-01 20:15:56 +00:00
Roger Dingledine
316afb6d09 fix an assert trigger in cvs: if a resolve request fails, and the circuit
has vanished in the meantime, then we would both mark it for close
(i.e. put it on the closeable list) and also immediately free it.


svn:r3759
2005-03-14 04:42:52 +00:00
Nick Mathewson
97dad670ea Renormalize whitespace
svn:r3757
2005-03-14 03:18:35 +00:00
Nick Mathewson
afe414f070 Revise all calls to connection_edge_end to avoid sending MISC, and to take errno into account where possible.
svn:r3720
2005-03-01 22:42:31 +00:00
Nick Mathewson
f672577bc6 Free even more things on shutdown. Temporarily move tor_free_all out from #ifdef so it gets tested more.
svn:r3614
2005-02-11 01:26:47 +00:00
Nick Mathewson
322c728e97 Fix tor-resolve implementation to prevent crashes and send resolves when we should.
svn:r3561
2005-02-05 21:03:24 +00:00
Roger Dingledine
56d4b99491 forward-port the logic skew and double-free thing
svn:r3549
2005-02-04 01:49:58 +00:00
Roger Dingledine
2e97593d25 define TOR_FRAGILE if you want tor to give you a core when
something goes wrong. this should only be used by people actively
tracking bugs.


svn:r3487
2005-02-01 00:37:16 +00:00
Roger Dingledine
b2fbd834f0 forward-port the dns and maxconn fixes
svn:r3448
2005-01-28 08:53:47 +00:00
Nick Mathewson
e0bf597665 Give more useful log messages when the tor process closes dns/cpuworker connections. "Error: Success!" makes us seem like crazy people."
svn:r3373
2005-01-19 21:34:42 +00:00
Roger Dingledine
814dd946f0 fix duplicate dns_cancel_pending_resolve reported by Giorgos Pallas
svn:r3293
2005-01-04 11:26:08 +00:00
Roger Dingledine
ba7c74e742 bandaid: make Giorgos Pallas's dns assert bug not actually crash on him.
one day we should try to figure out what's actually going on here.


svn:r3280
2005-01-04 06:21:06 +00:00
Nick Mathewson
b50263f740 More work on task #43: fix race conditions on multithreaded (win32) servers.
svn:r3251
2005-01-03 19:07:25 +00:00
Nick Mathewson
ead52e0bdc Possible fix for task #43: when running on a multithreaded environment (currently only windows), threads should not close opposite sides of their socketpairs, and workers should not call connection_free_all(). This may fix win32 servers.
svn:r3247
2005-01-03 18:06:51 +00:00
Roger Dingledine
011ad3cba5 clean up logging,
make it clearer which warns are bugs,
make the control log event match its specification,
point out a bug in how we deal with failure when renewing the tls context.


svn:r3138
2004-12-13 00:44:39 +00:00
Nick Mathewson
08e3090aff More win32 fixes: 1) tolerate extra "readable" events better. 2) when being multithreaded, leave parent fdarray open.
svn:r3092
2004-12-06 23:19:55 +00:00
Nick Mathewson
7fbd297532 Suggestion from weasel: Make tor --version --version dump the cvs Id of every file.
svn:r3019
2004-11-29 22:25:31 +00:00
Roger Dingledine
22727b4edc wrong is ok, and right is fine, but in between is apparently
totally unacceptable to me.


svn:r3005
2004-11-28 11:39:53 +00:00
Nick Mathewson
6f5dbefa7e Normalize space: add one between every control keyword and control clause.
svn:r3003
2004-11-28 09:05:49 +00:00
Roger Dingledine
7c9a707900 remove emacs droppings, since nick says he doesn't need them anymore
svn:r2989
2004-11-26 04:00:55 +00:00
Roger Dingledine
310a8da0d2 break reached_eof() out of process_inbuf()
svn:r2930
2004-11-21 10:14:57 +00:00
Nick Mathewson
60880cda84 Resolve a bunch of FIXME items; mark a lot more for attention; ask for clarification on some. Turn all XXXX008 ("showstopper for 0.0.8 release") items into XXXX009 or XXXX, since plainly they were not showstoppers for 0.0.8. Add/clean some docs.
svn:r2808
2004-11-12 16:39:03 +00:00
Roger Dingledine
394554cfbf Clean up copyrights.
Break connection_consider_empty_buckets() out of
connection_read_bucket_decrement().


svn:r2698
2004-11-07 01:33:06 +00:00
Roger Dingledine
6c61ed4fb5 Make options no longer a global variable.
Now we can try setting an option but back out if it fails to parse, or
  if it's disallowed (e.g. changing RunAsDaemon from 1 to 0).
Use parse_line_from_str rather than parse_line_from_file.


svn:r2692
2004-11-06 05:18:11 +00:00
Nick Mathewson
6874c39904 Fix windows build
svn:r2613
2004-10-27 18:14:38 +00:00
Nick Mathewson
6980929e64 Use strlcpy, not strcpy.
svn:r2610
2004-10-27 06:48:16 +00:00
Nick Mathewson
f67f83b1fa Use strlcpy, not strncpy
svn:r2603
2004-10-27 06:03:28 +00:00
Roger Dingledine
de65052312 don't assert multiple things in the same tor_assert()
svn:r2544
2004-10-16 22:14:52 +00:00
Nick Mathewson
a42adce362 fix memory leak in router.c; start relying on NULL==(zero bytes)
svn:r2538
2004-10-16 20:38:57 +00:00
Roger Dingledine
aebc3a03ba more int to size_t conversions, fixing one or more amd64 bugs
plus a whitespace patch on config.c from vicman


svn:r2482
2004-10-14 02:47:09 +00:00
Roger Dingledine
013104a1e2 people are starting to bump into the limit of 50 dns workers.
raise it to 100 for now. we need a better solution long-term.
but alas, there are no better solutions that are also portable.
hm.


svn:r2363
2004-09-22 03:56:41 +00:00
Nick Mathewson
9defe8a307 Attach dummy resolve connections to a circuit *before* calling dns_resolve(). This fixes a bug where cached answers would never be sent in RESOLVED cells.
svn:r2360
2004-09-21 18:12:12 +00:00
Roger Dingledine
d977677aa8 bugfix: when a resolve fails for a begin request, actually send
the end cell back. also, give a better reason for failure.


svn:r2358
2004-09-21 17:33:05 +00:00
Nick Mathewson
0dcc8c7048 Bugfix: When a dns request failed, we would detach any "resolving" streams from the circuit before we would send a the resolve_failed cells.
svn:r2355
2004-09-21 16:42:07 +00:00
Roger Dingledine
be7909f670 Fix a symptom for a bug that straycat found.
Apparently in rare cases poll() is returning POLLIN for an idle
dns worker. It reads no bytes, presumably because the idle dns
worker didn't write anything in the first place. Gosh, who knows.

Now we only trigger the assert if the idle dns worker actually
tries to send an answer to us.


svn:r2311
2004-08-25 05:26:09 +00:00
Roger Dingledine
05790d1722 let children survive sigint, sigterm, etc.
this was biting us because ^c would get delivered to all of them,
maybe because they were all still listening to stdin?


svn:r2197
2004-08-08 07:25:45 +00:00
Roger Dingledine
3b00c950c2 note a bug in our dns error handling. we should fix this sometime.
svn:r2149
2004-08-05 19:33:54 +00:00
Roger Dingledine
aebec8ab9e stop using atexit() to remove our pid, since it's called
immediately when we daemonize.

also drop our retry period for hidserv desc uploads from 10m to 5m


svn:r2111
2004-07-22 22:15:36 +00:00
Nick Mathewson
d5e275ddf4 Fix bug reported by peter palfrader: an empty address is unresolvable, but not an occasion for an assertion failure in a dnsworker.
svn:r2015
2004-07-06 23:25:21 +00:00
Nick Mathewson
0f3fcfd1db When tor_lookup_hostname says 0.0.0.0, treat it as an error.
svn:r2003
2004-07-04 04:52:43 +00:00
Nick Mathewson
3708886939 Implement RESOLVE/RESOLVED cells and socks resolve code
svn:r1978
2004-06-17 18:13:09 +00:00
Nick Mathewson
184f4e6044 Rotate dnsworkers and cpuworkers on SIGHUP, so they get new config settings too
svn:r1950
2004-06-06 03:38:31 +00:00
Roger Dingledine
69931106f8 be sure to detach streams from the circuit linked list before freeing them
also, don't bother marking a conn for close if you're about to free it


svn:r1935
2004-06-02 18:32:24 +00:00
Nick Mathewson
0932505829 Only connection_dns_remove resolving exit connections
svn:r1934
2004-06-02 18:12:49 +00:00
Nick Mathewson
0d20fee2fb Add more asserts to dns-pending connections; fix a couple seeming bugs.
svn:r1931
2004-06-01 22:09:58 +00:00
Roger Dingledine
f51061439b when the dns resolve is cancelled, or fails, be sure to remove
conn from circ->resolving_streams

otherwise it gets freed and stays there, causing seg faults.


svn:r1915
2004-05-21 12:25:15 +00:00
Roger Dingledine
b37450ce55 do all the heavy lifting in connection_about_to_close_connection,
not in _connection_mark_for_close

this will hopefully clean up the huge cyclical function mess


svn:r1903
2004-05-19 23:32:20 +00:00
Roger Dingledine
1cf1836990 break connection_edge_end out of connection_mark_for_close
svn:r1858
2004-05-12 21:12:33 +00:00
Nick Mathewson
537fb82cbb Make some functions static
svn:r1857
2004-05-12 20:58:27 +00:00
Roger Dingledine
3cdf2d67da it's amazing what a bit of punctuation can do for appearances
svn:r1843
2004-05-10 10:27:54 +00:00
Roger Dingledine
6168b3222e a few more pieces of markup
svn:r1841
2004-05-10 08:56:42 +00:00
Roger Dingledine
341d6f2cab more cleanup, including fleshing out or.h more
svn:r1839
2004-05-10 07:37:10 +00:00
Nick Mathewson
81922a125c More doxygenation.
svn:r1832
2004-05-10 04:34:48 +00:00
Roger Dingledine
c6d4a00c5f more doxygen markup
plenty more remains


svn:r1824
2004-05-09 16:47:25 +00:00
Roger Dingledine
9bf9ca4d09 bugfix: add a circ->resolving_streams field, and make dns resolving streams not actually in the connection_array until they're done resolving.
bugfix: actually complain if we duplicate mark-for-close a circuit

add more logging for relay ends that claim dns resolve failed, so we can
find out why they're not being retried.


svn:r1798
2004-05-06 11:08:04 +00:00
Nick Mathewson
682a805092 Comments for nearly all non-tricky files
svn:r1796
2004-05-05 21:32:43 +00:00
Nick Mathewson
af08c4f878 Working strerror for windows socket errors, plus some snide comments.
svn:r1775
2004-05-02 20:18:21 +00:00
Nick Mathewson
9322641710 Use socketclose on windows as appropriate; end pid files with newline
svn:r1745
2004-04-28 21:14:56 +00:00
Roger Dingledine
ca8d50abeb bug resolved (hopefully), so remove comment
svn:r1738
2004-04-28 20:12:44 +00:00
Roger Dingledine
22c0cd8a14 clean dns.c better
svn:r1737
2004-04-28 20:11:37 +00:00
Roger Dingledine
25d5425fdb fix a bug in dns.c, note but don't fix another one
svn:r1735
2004-04-28 19:55:20 +00:00
Nick Mathewson
ac622d94dc Workarounds for a couple of pieces of windows strangeness.
svn:r1734
2004-04-28 19:35:12 +00:00
Roger Dingledine
25d54257fb use tor_assert
remove obsolete BUF_OK macro


svn:r1697
2004-04-25 20:37:37 +00:00
Nick Mathewson
c024745bd4 Cosmetic patch for arma's fix for The Bug: Don't set the state to
RESOLVEFAILED if the resolve didn't fail; set it to CONNECTING
instead.


svn:r1590
2004-04-11 17:07:45 +00:00
Roger Dingledine
d8c954e156 continue beating at pieces of The Bug
svn:r1588
2004-04-09 21:31:09 +00:00
Roger Dingledine
23c193c065 if dns resolve is valid, but our exit policy rejects it or
the connect attempt fails immediately, we were trying to
double-remove it from the dns pending list.

i think this might have been The Bug.
(thanks weasel!)


svn:r1587
2004-04-09 21:06:14 +00:00
Roger Dingledine
4011906b6b get more serious about hunting The Bug
(it has been haunting us since the days of 0.0.2preX)


svn:r1576
2004-04-09 09:39:42 +00:00
Nick Mathewson
3d60cd1d61 Delete trailing whitespace and expand tabs; remove unused aes decrypt code
svn:r1522
2004-04-07 19:57:40 +00:00
Roger Dingledine
7118c6177d clean up a few more bugs
svn:r1365
2004-03-29 19:57:50 +00:00
Roger Dingledine
0edf0ea7cc make normal exit nodes less likely to crash from the conn-munging bug
but leave dirservers just as likely to crash


svn:r1363
2004-03-29 19:51:39 +00:00
Roger Dingledine
4a5586b8e3 make dns resolves a lot faster
(but only enable this once we've found the bug)


svn:r1358
2004-03-28 21:16:52 +00:00
Roger Dingledine
f241fdfc73 there is yet another dns-pending-conn-clobbering bug
somewhere


svn:r1354
2004-03-28 04:54:36 +00:00
Roger Dingledine
66f878513f deal with hardware word alignment
this was causing the seg faults on sparc processors

i wonder if i got them all.


svn:r1314
2004-03-20 09:30:30 +00:00
Roger Dingledine
1ae45b771e don't close all the fd's when you spawn a thread, only when you fork
svn:r1267
2004-03-12 21:52:15 +00:00
Roger Dingledine
965a73dc71 bugfix: we were caching transient dns failures
svn:r1266
2004-03-12 18:45:42 +00:00
Nick Mathewson
976bacae94 Make all the other read/writes into recv/sends, except when they shouldn't be.
svn:r1260
2004-03-11 06:35:03 +00:00
Roger Dingledine
6c9d78b319 stop asserting that computers always go forward in time
it's simply not true


svn:r1236
2004-03-06 01:43:37 +00:00
Roger Dingledine
01e06148a1 make workers explain their death better when tor dies
and make them say it at log level info rather than err


svn:r1232
2004-03-04 21:26:23 +00:00
Roger Dingledine
8fe504fee6 bugfix: don't pass complex things to the connection_mark_for_close macro
svn:r1231
2004-03-04 20:49:38 +00:00
Nick Mathewson
c03e9206ae Clean up dns->connection_mark_for_close->dns_remove path
svn:r1230
2004-03-04 18:43:44 +00:00
Roger Dingledine
5701cc2359 fix the function comment
svn:r1169
2004-02-28 22:34:47 +00:00
Nick Mathewson
0a673f4491 Split dns_cancel_pending_resolve into dns_cancel_pending_resolve (kill a
resolve in response to a DNS worker dying) and connection_dns_remove (remove
a pending connection from the resolve structure.)


svn:r1168
2004-02-28 22:23:44 +00:00
Roger Dingledine
9a55700747 add a log_warn to notify us of yet another potential dns.c bug
svn:r1167
2004-02-28 22:13:58 +00:00
Nick Mathewson
833d14246d Make dns_cancel_pending_resolve less agressive.
svn:r1166
2004-02-28 22:06:59 +00:00
Nick Mathewson
55174d1cb0 Fix bug on dns_found_answer from mark_to_close stuff.
svn:r1165
2004-02-28 21:52:58 +00:00
Roger Dingledine
fadfd26188 remove assert from dns.c that's no longer true:
typically the resolve will be pending, but it could be failed if it
just failed and we're working through the 'pending' list, or it could
be valid if some other dnsworker raced us to fill in the entry.


svn:r1164
2004-02-28 21:49:10 +00:00
Nick Mathewson
4e89c6661a Push responsibility for connection marking down as far as possible; have only a close path; add some missing end cells; change return conventions a little.
svn:r1149
2004-02-28 04:11:53 +00:00
Nick Mathewson
c5bbb571d2 Refactor mark_for_close, connection_edge_end and friends. Now, everybody
who wants to shut down a connection calls connection_mark_for_close instead
of setting marked_for_close to 1.  This automatically removes the connection
from the DNS cache if needed, sends a RELAY END cell if appropriate, and can
be changed to do whatever else is needed.

Still to do:
  - The same for circuits, maybe.
  - Add some kind of hold_connection_open_until_flushed flag, maybe.
  - Change stuff that closes connections with return -1 to use mark_for_close,
    maybe.


svn:r1145
2004-02-27 22:00:26 +00:00
Nick Mathewson
496e414e52 Basic RAM poisoning and magic-checking to notice connection and circuit
corruption faster; also, check for corruption in dns.c so we can fail fast
for the bug that's nailing Lucky and moria3.


svn:r1123
2004-02-25 07:31:46 +00:00
Roger Dingledine
8da2e00a83 remove dead code
svn:r1121
2004-02-25 06:56:11 +00:00