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