Commit Graph

4190 Commits

Author SHA1 Message Date
Roger Dingledine
00aefaab6b think harder about my logic
svn:r6806
2006-07-22 07:19:11 +00:00
Roger Dingledine
2d6a4d283b i lied, that won't work at all. maybe this will.
svn:r6805
2006-07-22 07:15:34 +00:00
Roger Dingledine
444f096d2d more bulletproof reachability testing
svn:r6804
2006-07-22 05:29:31 +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
Nick Mathewson
08a4114abf Another MSVC6 fix. Grnk.
svn:r6802
2006-07-21 14:53:23 +00:00
Roger Dingledine
2249180b60 bugfix: if you find yourself reachable, then don't ever make any client
requests (so you stop predicting circuits), then hup, then later your
IP changes, you won't think circuits are working so you won't try to
test reachability, so you won't publish.


svn:r6800
2006-07-21 07:55:35 +00:00
Roger Dingledine
4d5fab4f9a tweak
svn:r6799
2006-07-21 07:53:21 +00:00
Roger Dingledine
9283ddb760 an entry guard that is "unlisted", as well as not known to be "down", is
not therefore "up".


svn:r6798
2006-07-21 07:06:18 +00:00
Roger Dingledine
237c7ecbfd tweak
svn:r6796
2006-07-20 23:45:26 +00:00
Roger Dingledine
97a14b2018 tweak
svn:r6795
2006-07-20 23:33:11 +00:00
Roger Dingledine
db657ea0af don't squeal if the first few retries fail.
svn:r6791
2006-07-18 04:48:59 +00:00
Roger Dingledine
892f671f59 Define a schedule for how long to wait between retrying
application connections. Rather than waiting a fixed amount of
time between each retry, we wait only 5 seconds for the first,
10 seconds for the second, and 15 seconds for each retry after
that. Hopefully this will improve the expected experience.

Addresses bug 297.


svn:r6790
2006-07-18 04:42:32 +00:00
Roger Dingledine
e1f30a5f21 when we find our dirport to be reachable, mark our descriptor
dirty so we'll tell the world. (fixes bug 306 reported by pnx)


svn:r6787
2006-07-18 03:06:55 +00:00
Roger Dingledine
ac258d2cc8 Start publishing one minute or so after we find our ORPort
to be reachable. This will help reduce the number of descriptors
we have for ourselves floating around, since it's quite likely
other things (e.g. DirPort) will change during that minute too.


svn:r6786
2006-07-18 03:06:12 +00:00
Nick Mathewson
7fcb267e24 Oh. And apparently, msvc6 doesnt think very much of doing u64-and-double arithmetic either.
svn:r6785
2006-07-18 02:24:01 +00:00
Nick Mathewson
77c28d112b Hm. We probably should define INT64_MAX if we really want it. (Especially since we only want it on one platform, where, coincidentally, it is not defined.)
svn:r6784
2006-07-18 02:01:32 +00:00
Roger Dingledine
388ac4126a If we are using an exit enclave and we can't connect, e.g. because
its webserver is misconfigured to not listen on localhost, then back
off and try connecting from somewhere else before we fail.


svn:r6783
2006-07-18 00:59:46 +00:00
Roger Dingledine
a8444c6f53 pick a log domain; resolve an xxxx
svn:r6782
2006-07-18 00:01:12 +00:00
Roger Dingledine
c85745cfe2 parameterize the loudness of log_addr_has_changed(), since it's the
only place where we inform the user of a new IP address, if we're
guessing it from external sources.


svn:r6780
2006-07-17 19:33:54 +00:00
Roger Dingledine
542adb88d7 Make a louder statement the first time we learn a guessed
IP address.


svn:r6779
2006-07-17 08:17:51 +00:00
Roger Dingledine
c055a34cdb huge bugfix: we weren't ever writing an http header when sending
out network statuses! so clients were downloading the whole thing,
and then discarding them because they're malformed.


svn:r6778
2006-07-17 08:11:27 +00:00
Roger Dingledine
a2a89da693 and don't try to build the descriptor every second, if it's dirty
but we don't have a known address.


svn:r6777
2006-07-17 06:59:56 +00:00
Roger Dingledine
42e2057d67 fix some more places where we shouldn't crash if we can't build
our own descriptor yet.


svn:r6775
2006-07-17 06:54:28 +00:00
Roger Dingledine
9db7b2c068 Allow servers with no hostname or IP address to learn their IP address
by asking the directory authorities. This code only kicks in when you
would normally have exited with a "no address" error.

This design is flawed, though, since the X-Your-Address-Is header is not
authenticated, and doing it this way introduces too many new attacks. The
right answer is to give IP address hints inside the HELLO cell; much of
this code can be reused when we switch.


svn:r6774
2006-07-17 06:35:06 +00:00
Nick Mathewson
e572d5990c MSVC6 is apparently terrified of unnatural cross-breeding between uint64_t and double, and needs more persuasion than usual to cast one to the other. Issue identified by Frediano Ziglio; patch revised for minimal impact on non-MSVC6 compilers.
svn:r6768
2006-07-17 00:39:05 +00:00
Roger Dingledine
886b10bbe2 whitespace/etc cleanups
svn:r6765
2006-07-16 05:57:11 +00:00
Roger Dingledine
ee5f512e13 parameterize the loudness of resolve_my_address(), and call things
IP addresses, not IPs.


svn:r6764
2006-07-15 20:26:05 +00:00
Roger Dingledine
3d79eb52ab stick to nick's nul/null convention
svn:r6763
2006-07-15 19:21:30 +00:00
Roger Dingledine
c4411841d2 Avoid an integer underflow when the dir authority decides whether a
router is stable: we might wrongly label it stable, and compute a slightly
wrong median stability, when a descriptor is published later than now.

Inspired by Matt's Vidalia checkin:
http://trac.vidalia-project.net/changeset/1074


svn:r6758
2006-07-14 03:14:02 +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
c32e19b4ed OR_CONN_EVENT_NEW: we should probably handle that , should we not? Especially since 23:26 < phobos> nickm: grep -c "Unrecognized status code 4" tor.log
svn:r6752
2006-07-11 03:33:16 +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
28a7c8a64c Make compilation work on old MSVCs without GetVertsionEx magic. Patch from Frediano Ziglio.
svn:r6749
2006-07-09 22:29:12 +00:00
Nick Mathewson
a7a1d4e3d3 First part of making mmap-based stuff work on win32: save descriptors as "binary" (no LF->CRLF tanslation) so that we can mmap them properly later. Patch from Frediano Ziglio.
svn:r6748
2006-07-09 22:28:12 +00:00
Roger Dingledine
51454157a0 Fix a crash if you enable FascistFirewall but not FirewallPorts.
Reported by Frediano Ziglio.


svn:r6746
2006-07-08 17:38:46 +00:00
Nick Mathewson
0bbc4aca9b Spellcheck and remove spurious include in eventdns.c
svn:r6745
2006-07-07 19:08:44 +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
f33c4f9781 eventdns: check for malloc() failures.
svn:r6743
2006-07-07 17:31:56 +00:00
Roger Dingledine
85fd582192 rename X-You-Are to something slightly better.
svn:r6735
2006-07-06 03:05:01 +00:00
Roger Dingledine
7f01dc9c1c whitespace/tab fixes
svn:r6734
2006-07-06 02:45:46 +00:00
Roger Dingledine
fad85f173a when an exit node gets a malformed begin cell, don't complain to
the node operator, since he can't do anything about it.


svn:r6733
2006-07-06 02:44:07 +00:00
Nick Mathewson
3c4205c872 Clean up eventdns messages.
svn:r6730
2006-07-05 21:42:18 +00:00
Nick Mathewson
54779025e2 Spelling fix.
svn:r6729
2006-07-05 21:33:46 +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
0ec293b189 actually, that excludenodes fix was redundant. take it out.
svn:r6727
2006-07-05 18:19:42 +00:00
Roger Dingledine
98c6bf6192 oops, we were ignoring options->ExcludeNodes when picking entry guards.
it is still the case that we ignore it with respect to entry guards
that we've already picked.


svn:r6726
2006-07-04 20:25:17 +00:00
Roger Dingledine
4fc7426b93 Make the X-You-Are header more accurate when there's a proxy in the middle.
svn:r6722
2006-07-04 18:18:08 +00:00
Roger Dingledine
12cc290a7d ok, i'm not allowed to say that there. oh well.
svn:r6720
2006-07-04 16:11:35 +00:00
Roger Dingledine
579849f600 fix a misleading function comment
svn:r6717
2006-07-04 15:52:22 +00:00
Roger Dingledine
5dc1e6f788 if we're the server-side of the tls and there are problems,
don't yell as loudly.


svn:r6716
2006-07-04 15:51:59 +00:00
Roger Dingledine
05d0b70573 Get rid of the router_retry_connections notion. Now routers no longer
try to rebuild long-term connections to directory authorities, and
directory authorities no longer try to rebuild long-term connections to
all servers.

We still don't hang up connections in these two cases though -- we need
to look at it more carefully to avoid flapping, and we likely need to
wait til 0.1.1.x is obsolete.


svn:r6712
2006-07-04 03:31:27 +00:00
Roger Dingledine
ff1b4764e9 No longer permit create cells to have the wrong circ_id_type. No
running Tors should still have this bug.


svn:r6711
2006-07-04 03:27:09 +00:00
Roger Dingledine
35e95d7783 minor fixes
svn:r6710
2006-07-04 03:25:07 +00:00
Roger Dingledine
dc79dd6a46 minor fixes
svn:r6709
2006-07-04 03:19:59 +00:00
Nick Mathewson
9fce316d1c Oops. Headers work better when named right.
svn:r6707
2006-07-01 21:51:21 +00:00
Nick Mathewson
60de51993a Unify HTTP response code into one place so it is easier to add headers. Add an X-You-Are header, which we should probably rename. NOTE that we should not use this field for things where it matters if dirs lie.
svn:r6705
2006-06-30 10:50:43 +00:00
Roger Dingledine
d45757ebcb also remove word 'middleman' from a log notice
svn:r6704
2006-06-29 13:11:23 +00:00
Roger Dingledine
1f407c174d remove the word 'middleman' from the sample torrc
svn:r6703
2006-06-29 13:10:08 +00:00
Nick Mathewson
475eb5d6fe Apparent 311 fix: apparently passing Z_FINISH an empty string is problematic.
svn:r6702
2006-06-29 11:19:52 +00:00
Nick Mathewson
05eff35ac6 Harmless: Z_OK is not an acceptable answer to Z_FINISH.
svn:r6701
2006-06-29 11:17:36 +00:00
Nick Mathewson
4b49d298eb complete_only == !allow_partial. This enables useful use of partial desc downloads. Backport candidate
svn:r6700
2006-06-29 11:04:42 +00:00
Roger Dingledine
c22c7b96f5 tab-man strikes again
svn:r6699
2006-06-28 15:39:02 +00:00
Nick Mathewson
8b08ab52fd Fix another idiot bug causing symptom 309. Why cant I program?
svn:r6698
2006-06-28 15:36:28 +00:00
Nick Mathewson
96bfefeeb6 Add a check to try to make cache rebuild fail fast if it is going to fail
svn:r6697
2006-06-28 11:03:34 +00:00
Nick Mathewson
4dac383f5a Aaand re-disable the bogus test in get_body()
svn:r6696
2006-06-28 08:57:41 +00:00
Nick Mathewson
d547ecc916 Make sure that our calculated offsets for routers is correct; again. This time bug 309 may be gone gone gone.
svn:r6695
2006-06-28 08:55:53 +00:00
Nick Mathewson
1cd04abf1a Actually enable mmap. That should improve matters.
svn:r6694
2006-06-28 08:54:32 +00:00
Nick Mathewson
d3784ff1df Likely fix for bug 309: when we calculate offsets after rebuilding the descriptor cache, do not reset the offset pointer half-way through.
svn:r6693
2006-06-27 15:52:51 +00:00
Roger Dingledine
f88d555ce0 refuse to write an iso_time which we can't parse, when dumping
bandwidth state. this fixes the particular incident in bug 308,
but the general issue remains.


svn:r6684
2006-06-24 04:57:59 +00:00
Nick Mathewson
b4b8da5d23 Turn a while into a do/while; save a redundant test
svn:r6683
2006-06-24 02:10:21 +00:00
Nick Mathewson
06e09cdd47 Apparently, zlib sometimes reports Z_BUF_ERROR on input exhaustion as well as on running out of output space. This could well fix the assert bug reported by weasel and arma.
svn:r6682
2006-06-24 02:06:52 +00:00
Nick Mathewson
b82dfdd4a3 Make some more verbose gcc warnings go away.
svn:r6680
2006-06-22 07:34:04 +00:00
Nick Mathewson
06ffee3b67 Ooh, that could have been bad. Sort digests as digests, not strings.
svn:r6679
2006-06-22 07:29:14 +00:00
Nick Mathewson
52b8dfa95a Fix a bunch of spaces.
svn:r6678
2006-06-22 07:25:15 +00:00
Nick Mathewson
89a1453776 Set offset properly when parsing cache.
svn:r6677
2006-06-22 07:19:28 +00:00
Nick Mathewson
58b05fc84d #if out test that was failing because of an extra newline.
svn:r6676
2006-06-22 07:10:37 +00:00
Nick Mathewson
b7910202a3 Next batch of memory miserdom: mmap cached-routers file. This is sure to break somewhere.
svn:r6675
2006-06-22 07:01:54 +00:00
Nick Mathewson
e2697a62ac When requesting or serving resources via fingerprint/digest, request and respond in-order, removing duplicates.
svn:r6673
2006-06-21 04:57:12 +00:00
Peter Palfrader
7b6c435066 <nickm> ooh, that log shouldn't be there. can you take it out?
svn:r6671
2006-06-20 23:11:15 +00:00
Nick Mathewson
0799154ae1 Fix bug in networkstatus spooling: spool more than the first networkstatus.
svn:r6670
2006-06-20 23:06:52 +00:00
Nick Mathewson
0e09b26112 Fishy, but harmless.
svn:r6669
2006-06-20 16:48:32 +00:00
Roger Dingledine
ef78e4245f add a note for nick to fix
svn:r6668
2006-06-20 13:14:07 +00:00
Nick Mathewson
a9e1a4c33c Ah. We need a new zlib_state for each networkstatus we spool out.
svn:r6667
2006-06-20 06:27:13 +00:00
Nick Mathewson
4283b81a48 Start spooling v2 networkstatus docs as well.
svn:r6664
2006-06-20 00:48:23 +00:00
Nick Mathewson
3f7f069a05 Fix a tricky crash: making the_directory heap-allocated (so we could refcount it and have multiple instances as neeeded) means that calls to dirserv_regenerate_directory could invalidate the auth_dir value passed to dirserv_pick_cached_dir_obj. Big fun.
svn:r6663
2006-06-18 21:30:03 +00:00
Nick Mathewson
2552d5e60f Fix an assert that still isnt the assert we are hunting.
svn:r6662
2006-06-18 21:15:01 +00:00
Roger Dingledine
37c441d96f correct a function comment in compute_preferred_testing_list()
svn:r6660
2006-06-18 21:07:45 +00:00
Nick Mathewson
f1993b8b30 Become capable of noticing that we are done sending a directory.
svn:r6659
2006-06-18 20:58:27 +00:00
Nick Mathewson
5c0d7fb016 Resolve control flow warning.
svn:r6658
2006-06-18 20:39:46 +00:00
Nick Mathewson
0932f463ff Ah. That seems to work.
svn:r6657
2006-06-18 16:39:26 +00:00
Nick Mathewson
5ba72d0ae5 another write_to_buf_zlib fix.
svn:r6656
2006-06-18 16:20:38 +00:00
Nick Mathewson
b5c599412f Backport candidate: implement the "is this uptime change cosmetic" test properly.
svn:r6654
2006-06-18 16:05:54 +00:00
Nick Mathewson
a9cffd2ff0 Re-enable buffer RAM guard values.
svn:r6653
2006-06-18 15:53:54 +00:00
Nick Mathewson
11c2e97d51 Another _zlib fix.
svn:r6652
2006-06-18 09:03:48 +00:00
Nick Mathewson
337ad6420b Make connection_write_to_buf_zlib set outbuf_flushlen right.
svn:r6651
2006-06-18 08:53:09 +00:00
Nick Mathewson
537104c908 write_to_buf != connection_write_to_buf. Also, add a connection_write_to_buf_zlib wrapper that sucks.
svn:r6650
2006-06-18 08:46:55 +00:00
Nick Mathewson
10b7b57616 Temporarily disable sentinels on buffers
svn:r6649
2006-06-18 08:44:34 +00:00
Nick Mathewson
9376d901ed make zlib buffer function set buf_highwater properly
svn:r6648
2006-06-18 08:21:27 +00:00
Nick Mathewson
4d02ccfed8 Stop trying to refresh when we are out of data.
svn:r6647
2006-06-18 08:19:35 +00:00
Nick Mathewson
b9013cbe98 And actually check the url when it exists. that might work better.
svn:r6646
2006-06-18 08:16:05 +00:00