Commit Graph

852 Commits

Author SHA1 Message Date
Roger Dingledine
af658b7828 More work towards making bridge users able to connect via bridges:
- demand options->Bridges and options->TunnelDirConns if 
    options->UseBridges is set.
  - after directory fetches, accept descriptors that aren't referenced by
    our networkstatuses, *if* they're for a configured bridge.
  - delay directory fetching until we have at least one bridge descriptor.
  - learn how to build a one-hop circuit when we have neither routerinfo
    nor routerstatus for our destination.
  - teach directory connections how to pick a bridge as the destination
    directory when doing non-anonymous fetches.
  - tolerate directory commands for which the dir_port is 0.
  - remember descriptors when the requested_resource was "authority", 
    rather than just ignoring them.
  - put bridges on our entry_guards list once we have a descriptor for them.
    When UseBridges is set, only pick entry guards that are bridges. Else
    vice versa.


svn:r10571
2007-06-12 09:17:23 +00:00
Peter Palfrader
c0b28adc65 Resetting the correct stats
svn:r10569
2007-06-12 01:09:53 +00:00
Nick Mathewson
a21381affa r13364@catbus: nickm | 2007-06-11 20:15:53 -0400
Stop assuming that desc_by_eid_map works: in fact, it kinda doesn't.  Add a big comment explaining why.


svn:r10567
2007-06-12 00:15:55 +00:00
Nick Mathewson
367a77459a r13355@catbus: nickm | 2007-06-11 18:19:34 -0400
Make all the digestmaps inside routerlist_t use the new typechecking wrappers, so we can catch any more bugs like the one fixed by 10561.  This turned up a bug in routerlist_remove: we were extracting a routerinfo_t from desc_digest_map.  Fix that too, though it was probably harmless, since we were only doing a pointer comparison with it.


svn:r10563
2007-06-11 22:19:40 +00:00
Nick Mathewson
bde82e737b r13352@catbus: nickm | 2007-06-11 17:42:45 -0400
Since desc_by_eid_map hold server descriptors, do not add routerinfo_ts.  Bug found by weasel


svn:r10561
2007-06-11 21:42:48 +00:00
Peter Palfrader
e91cab20dd Reorder routerlist_assert_ok() and routerlist_check_bug_417(), so if the assert_ok triggers we know that our bug_417 is wrong
svn:r10560
2007-06-11 19:46:23 +00:00
Roger Dingledine
04995f197d more building blocks towards being able to fetch bridge descriptors
svn:r10548
2007-06-10 07:34:21 +00:00
Nick Mathewson
2bb7005481 r13317@catbus: nickm | 2007-06-08 14:39:59 -0400
bugfix: we were undercounting the number of authorities that recommended any given version by 1.  Backport candidate.


svn:r10537
2007-06-08 18:41:19 +00:00
Nick Mathewson
1866ad3506 r13274@catbus: nickm | 2007-06-05 19:06:30 -0400
Remove some deadcode that seems unlikely to return


svn:r10509
2007-06-06 04:51:25 +00:00
Nick Mathewson
23ae5976f3 r13254@catbus: nickm | 2007-06-04 20:13:47 -0400
When choosing a guard, weight by bandwidth.  Resolves bug 440.


svn:r10493
2007-06-05 00:15:00 +00:00
Nick Mathewson
bb6f53d60c r13243@catbus: nickm | 2007-06-04 15:17:15 -0400
Start of code to compute consensus network-status stuff from a bunch of votes.  Strangely, it does not yet feel like an enormous ugly hack. 


svn:r10489
2007-06-04 19:19:01 +00:00
Nick Mathewson
8400cecb1d r13148@catbus: nickm | 2007-06-02 10:24:20 -0400
Fix bug 441, 442, and possibly 417 (again).


svn:r10449
2007-06-02 14:24:23 +00:00
Nick Mathewson
2ef3e7853b r13144@catbus: nickm | 2007-06-02 08:44:42 -0400
Add some asserts to catch double-insert on routerlist.


svn:r10445
2007-06-02 12:44:57 +00:00
Nick Mathewson
5b6d7f10f3 r13143@catbus: nickm | 2007-06-01 16:43:40 -0400
Try to fix some mipspro compiler warnings. There will still be some left.


svn:r10444
2007-06-02 12:44:54 +00:00
Nick Mathewson
f89a3b1448 r13050@catbus: nickm | 2007-05-29 13:31:11 -0400
Resolve all but 3 DOCDOCs.


svn:r10393
2007-05-29 17:31:13 +00:00
Nick Mathewson
63035cdb33 r13041@catbus: nickm | 2007-05-29 10:40:05 -0400
More messing around to try to address possible root causes of bug 436.


svn:r10388
2007-05-29 14:41:20 +00:00
Roger Dingledine
0c047b87f5 polish r9933-r9994
svn:r10335
2007-05-25 19:41:31 +00:00
Nick Mathewson
a312afd67e r12936@catbus: nickm | 2007-05-24 14:12:34 -0400
Review XXXX comments without a version; upgrade some to XXXX020.


svn:r10315
2007-05-24 18:12:52 +00:00
Nick Mathewson
4c6398a8f0 r12918@catbus: nickm | 2007-05-24 12:52:40 -0400
Make reset_download_failures() reset extrainfo download status too.


svn:r10306
2007-05-24 17:13:02 +00:00
Nick Mathewson
d0a5c4f984 r12915@catbus: nickm | 2007-05-24 12:12:34 -0400
Do not send a warning when somebody uploads an extrainfo that we will reject, if it happens to be newer than our current routerdesc.


svn:r10303
2007-05-24 17:12:54 +00:00
Nick Mathewson
9e0acc0c11 r12899@catbus: nickm | 2007-05-22 13:51:26 -0400
Extract common code from networkstatus_getinfo_helper_single() and generate_v2_networkstatus().


svn:r10294
2007-05-22 17:58:30 +00:00
Nick Mathewson
c9fa4e6583 r12898@catbus: nickm | 2007-05-22 13:11:04 -0400
More v3 directory code: have authorities load certificates; have everybody store certificates to disk and load them; provide a way to configure v3 authorities.


svn:r10293
2007-05-22 17:58:25 +00:00
Nick Mathewson
6975a093e9 r12853@catbus: nickm | 2007-05-22 11:36:54 -0400
Make connection_array into a smartlist.


svn:r10292
2007-05-22 15:49:14 +00:00
Nick Mathewson
4ec5e139c8 r12850@catbus: nickm | 2007-05-21 22:20:42 -0400
Partial backport candidate: do not rely on finding a \0 after an mmaped() router/extrainfo file.  Also, set journal length correctly when starting up.


svn:r10248
2007-05-22 02:20:52 +00:00
Nick Mathewson
d23cb33a1a r12846@catbus: nickm | 2007-05-21 21:55:15 -0400
Oops; it is possible to have an empty store.


svn:r10247
2007-05-22 01:55:50 +00:00
Nick Mathewson
0cb342e859 r12844@catbus: nickm | 2007-05-21 21:52:19 -0400
Oops. It compiles better when you spell the fields right.


svn:r10245
2007-05-22 01:52:22 +00:00
Nick Mathewson
32c8d94c12 r12842@catbus: nickm | 2007-05-21 21:51:45 -0400
Partial backport candidate. Fix issue noted in r10241: stores were rebuilt too often.  Also notes dropped bytes better.


svn:r10244
2007-05-22 01:51:53 +00:00
Roger Dingledine
b89ad9eb1b mark a bug for nick to tackle -- we're rebuilding our router store more
often than we need to. reported by lodger.


svn:r10241
2007-05-22 01:17:08 +00:00
Roger Dingledine
82054e0dd2 Make the NodeFamilies config option work. (Reported by
lodger -- it has never actually worked, even though we added it
in Oct 2004.)


svn:r10238
2007-05-22 00:46:55 +00:00
Peter Palfrader
d2f7a9d0cc Hopefully fix #429 for good by actually using, not just figuring out, the correct mmap
svn:r10233
2007-05-21 12:14:45 +00:00
Nick Mathewson
a4f5b99e61 r13023@Kushana: nickm | 2007-05-20 16:16:36 -0400
More bulletproofing on bug 429


svn:r10231
2007-05-20 20:16:45 +00:00
Nick Mathewson
21a72520ce r13021@Kushana: nickm | 2007-05-20 14:03:10 -0400
Provide actual reasons when dropping an uploaded extrainfo for incompatibility; also, clean whitespace.


svn:r10230
2007-05-20 18:03:26 +00:00
Nick Mathewson
5364833be0 r13017@Kushana: nickm | 2007-05-20 13:40:45 -0400
Address points in r10227.


svn:r10229
2007-05-20 17:43:55 +00:00
Nick Mathewson
bc26f28865 svn:r10228 2007-05-20 17:43:29 +00:00
Roger Dingledine
ddd0054a85 point out two remote crash bugs, a memory leak, and a few other
items we should probably look into.


svn:r10227
2007-05-20 14:15:23 +00:00
Nick Mathewson
0b661f6575 r12818@catbus: nickm | 2007-05-20 01:15:50 -0400
Look for extrainfo bodies in the extrainfo mmap, not in the descriptor mmap.  Duh.  Should fix bug 429.


svn:r10226
2007-05-20 05:15:53 +00:00
Peter Palfrader
6d46ece6ac Fix a loop in routerlist_assert_ok()
svn:r10224
2007-05-19 21:14:17 +00:00
Nick Mathewson
6f8866a817 r12810@catbus: nickm | 2007-05-19 16:08:42 -0400
Fix bugs in extrainfo_insert, and change it to use desc_by_eid_map.


svn:r10222
2007-05-19 20:08:44 +00:00
Nick Mathewson
4d3ec5919e r12808@catbus: nickm | 2007-05-19 14:48:51 -0400
Fix another consistency error. 


svn:r10221
2007-05-19 18:48:53 +00:00
Nick Mathewson
48e30ce2c7 r12805@catbus: nickm | 2007-05-19 14:31:00 -0400
Fix a groovy memory corruption bug in routerlist_replace.


svn:r10220
2007-05-19 18:31:04 +00:00
Nick Mathewson
0a27b53252 r12802@catbus: nickm | 2007-05-19 14:12:27 -0400
clear some ram when freeing it; add some more checks to assert_routerlist_ok.


svn:r10218
2007-05-19 18:12:31 +00:00
Nick Mathewson
61a116b3da r12798@catbus: nickm | 2007-05-18 20:31:54 -0400
Yet more debugging code to track down 417/404, inspired by a fun core from arma.


svn:r10216
2007-05-19 00:32:00 +00:00
Nick Mathewson
e476e61ce0 r12982@Kushana: nickm | 2007-05-18 15:15:14 -0400
Partial backport candidate: We had a bug where we were downloading descriptors by descriptor digest, but trying to look them up by identity fingerprint when updating their failure count and next retry time.  (Also use correct backoff logic for extrainfo code.)  Needs testing, doubtless.


svn:r10210
2007-05-18 21:19:53 +00:00
Nick Mathewson
ec55cf526d r12981@Kushana: nickm | 2007-05-18 14:12:19 -0400
First cut at code to download extra-info docs.  Also note a bad bug in directory.c (look for the string BUG BUG BUG).


svn:r10209
2007-05-18 21:19:19 +00:00
Nick Mathewson
b4bd9f772c r12771@catbus: nickm | 2007-05-16 18:12:32 -0400
Make -Wstrict-overflow=5 happy with GCC 4.2.  It is kind of a pain, but it does agood job of letting us know where we can make our code better by simplifying dependent conditionals.


svn:r10201
2007-05-16 22:16:13 +00:00
Nick Mathewson
a7514649c3 r12758@catbus: nickm | 2007-05-14 15:19:29 -0400
Cleanup, lock-down, and refactor bits of routerparse.c: use a single unified function to check all signatures. Fix all DOCDOCs. Remove some old dead debugging code. Enforce some parsing rules better.


svn:r10192
2007-05-14 22:51:05 +00:00
Roger Dingledine
37519d993d backport candidate: seems to me that r10153 won't work without
this patch too.


svn:r10187
2007-05-14 08:09:12 +00:00
Roger Dingledine
440b7f0c70 polish r9726-r9903
svn:r10182
2007-05-13 09:25:06 +00:00
Roger Dingledine
346826d97b If a directory authority is down, skip it when deciding where to get
networkstatus objects or descriptors. Otherwise we keep asking
every 10 seconds forever.
(adapted from r9880)


svn:r10175
2007-05-12 23:22:27 +00:00
Nick Mathewson
11f3e894d3 r12708@catbus: nickm | 2007-05-10 15:18:08 -0400
Patch from shibz: implement a getinfo status/version/... so a controller can tell whether the current version is recommended, whether any versions are good, and how many authorities agree.


svn:r10162
2007-05-10 19:30:02 +00:00
Roger Dingledine
de11011b1b backport candidate: when we have k non-v2 authorities in our
dirservers lines, we ignored as many as k v2 authorities while
updating our network-statuses.

(not a problem right now since we have zero non-v2 authorities.
but if we ever change that...)


svn:r10157
2007-05-10 10:01:53 +00:00
Roger Dingledine
4e9a008e66 Backport candidate: if all of our dirservers have given us
bad or no networkstatuses lately, then stop hammering them
once per minute even if we think they're failed.


svn:r10156
2007-05-10 09:34:34 +00:00
Roger Dingledine
cd23b65a07 Backport candidate: count it as a failure if we fetch a valid
network-status but we don't want to keep it. Otherwise we'll keep fetching
it and keep not wanting to keep it. Fixes part of bug 422.


svn:r10153
2007-05-10 05:12:20 +00:00
Roger Dingledine
de6b3512e9 move a few more situations over to the authority_type_t bitfield
svn:r10151
2007-05-10 04:01:28 +00:00
Nick Mathewson
ceac39aa8a r12697@catbus: nickm | 2007-05-09 00:15:40 -0400
Change authority_type_t to a set of flags; use it more consistently.


svn:r10144
2007-05-09 04:15:46 +00:00
Roger Dingledine
f8a8b27dd2 add a 'bridge' flag for dirserver config entries
svn:r10128
2007-05-07 08:26:50 +00:00
Roger Dingledine
1b95bbdba6 New config option V2AuthoritativeDirectory that all directory
authorities should set. This will let future authorities choose 
not to serve V2 directory information.

Also, go through and revamp all the authdir_mode stuff so it tries
to do the right thing if you're an auth but not a V1 or V2 auth.


svn:r10092
2007-05-02 09:12:04 +00:00
Nick Mathewson
89ab267cfb r12619@catbus: nickm | 2007-05-01 16:13:42 -0400
Add code to upload extrainfos to authorities running 0.2.0.0-alpha-dev (r10070) or later.


svn:r10086
2007-05-01 20:13:49 +00:00
Nick Mathewson
0390a0499c r12586@catbus: nickm | 2007-04-30 15:43:05 -0400
More work for proposal 104: actually cache extrainfo documents to disk, and reload the cache properly.


svn:r10070
2007-04-30 19:48:39 +00:00
Nick Mathewson
6875559c49 r12579@catbus: nickm | 2007-04-30 13:26:53 -0400
Oops. Routerlist_check_bug_417 should work even if we are not on a server.


svn:r10066
2007-04-30 17:46:11 +00:00
Nick Mathewson
5b26a076c6 Oops; the "not in the routerlist" value for routerinfo_t.routerlist_index is -1, not 0.
svn:r10060
2007-04-30 14:32:22 +00:00
Nick Mathewson
65daa191fe r12567@catbus: nickm | 2007-04-30 10:26:35 -0400
Suggested by weasel: Add a fast function to check for the common failure mode for bug 417/404, and call it a lot.


svn:r10059
2007-04-30 14:26:38 +00:00
Nick Mathewson
313ac313be r12557@catbus: nickm | 2007-04-30 01:36:39 -0400
Oops; the rest of the last patch. If that one gets backported, this should too.


svn:r10053
2007-04-30 05:36:41 +00:00
Nick Mathewson
f7acc3cfa0 r12553@catbus: nickm | 2007-04-30 01:32:54 -0400
Backport candidate:  Add asserts to dirserv_remove_invalid, and fix a bug in dirserv_remove_invalid that could mess with pointers in a freed routerinfo right after it was freed.


svn:r10052
2007-04-30 05:32:57 +00:00
Roger Dingledine
397afcc3f6 Make PreferTunneledDirConns and TunnelDirConns work even when
we have no cached directory info. This means Tor clients can now
do all of their connections protected by TLS.


svn:r10035
2007-04-27 10:26:09 +00:00
Nick Mathewson
5cf600b57a r12492@catbus: nickm | 2007-04-22 20:24:02 -0400
Even more asserts to try to catch bug 404/417.


svn:r10003
2007-04-23 00:24:06 +00:00
Nick Mathewson
362fbc79d2 r12414@catbus: nickm | 2007-04-16 17:37:17 -0400
More proposal-104 stuff: actually remember extra-info stuff.


svn:r9975
2007-04-16 21:37:21 +00:00
Nick Mathewson
17e83a408f Fix some proposal-104 bugs.
svn:r9972
2007-04-16 18:54:56 +00:00
Nick Mathewson
6d32d9cb2d r12406@catbus: nickm | 2007-04-16 14:39:33 -0400
More proposal-104 stuff: add most of the code for authorities to accept and serve extra-info documents.  The back-end to store the things is missing.


svn:r9971
2007-04-16 18:39:39 +00:00
Nick Mathewson
2bb5e64289 r12403@catbus: nickm | 2007-04-16 13:55:03 -0400
Code to generate extrainfo whenever routerdesc is regenerated; code to check extrainfo against routerdesc.


svn:r9970
2007-04-16 17:55:08 +00:00
Nick Mathewson
5b220f65c8 r12385@catbus: nickm | 2007-04-15 22:55:58 -0400
Initial code to parse extra-info documents as described in proposal 104.  This is making me realize that the parsing code in routerparse.c is a little daft.


svn:r9963
2007-04-16 04:17:58 +00:00
Roger Dingledine
f36c613dbc fix a memory leak when we ask for "all" networkstatuses and
we get one we don't recognize.
backport candidate.
backbackport candidate.


svn:r9918
2007-03-29 07:02:12 +00:00
Nick Mathewson
83b2208ea4 r12653@Kushana: nickm | 2007-03-25 18:21:38 -0400
Add documentation for make_old argument to routerlist functions.


svn:r9906
2007-03-26 14:08:29 +00:00
Roger Dingledine
2cf63f8a62 Don't save non-general-purpose router descriptors to the disk cache,
because we have no way of remembering what their purpose was when
we restart.


svn:r9894
2007-03-21 15:37:30 +00:00
Roger Dingledine
4ab0b979b2 temporary hack to solve bug 384, so i can get on with debugging
other stuff.


svn:r9880
2007-03-20 02:10:18 +00:00
Nick Mathewson
6363a7ccf5 r12538@Kushana: nickm | 2007-03-11 17:10:22 -0400
Fix a lame assert, I hope.


svn:r9801
2007-03-11 21:10:54 +00:00
Roger Dingledine
7fedd6ab4e best not to introduce new technical terms if we don't need to
svn:r9800
2007-03-11 20:52:07 +00:00
Nick Mathewson
98c3403ce7 r12535@Kushana: nickm | 2007-03-11 16:34:40 -0400
Fix a comment and add a couple of  assert to try to track down another assert in routerlist_assert_ok()


svn:r9799
2007-03-11 20:34:44 +00:00
Nick Mathewson
02ce8e6b12 r12474@Kushana: nickm | 2007-03-06 16:10:05 -0500
We have a PATH_SEPARATOR macro.  How about we use it?


svn:r9782
2007-03-09 21:39:30 +00:00
Roger Dingledine
064ff7b33d get rid of an info-level log message that occurs many times a
minute when we haven't needed circuits lately.


svn:r9771
2007-03-09 08:48:21 +00:00
Nick Mathewson
5d1bee87ff r12468@Kushana: nickm | 2007-03-06 15:24:00 -0500
More unit tests: gcov is fun.


svn:r9748
2007-03-06 20:25:44 +00:00
Roger Dingledine
5217d3680e clean up a log message, and stop calling it an error when
we exit cleanly


svn:r9742
2007-03-06 19:33:43 +00:00
Nick Mathewson
7fcceb2c25 r12074@catbus: nickm | 2007-03-04 15:11:43 -0500
Make all LD_BUG log messsages get prefixed with "Bug: ".  Remove manually-generated "Bug: "s from log-messages.  (Apparently, we remembered to add them about 40% of the time.)


svn:r9733
2007-03-04 20:11:46 +00:00
Nick Mathewson
70e5a83a77 r12057@catbus: nickm | 2007-03-04 13:58:32 -0500
Clarify some log messages; note others that could be improved later.


svn:r9724
2007-03-04 18:58:38 +00:00
Roger Dingledine
dba4e040fc Disable encrypted directory connections when we don't have a server
descriptor for the destination. We'll get this working again in
the 0.2.0 branch.


svn:r9700
2007-03-01 04:26:30 +00:00
Nick Mathewson
d6368fd075 r11976@catbus: nickm | 2007-02-27 19:35:59 -0500
Add some missing (redundant but helpful in most cases) static declarations, and remove a function nobody was calling.


svn:r9672
2007-02-28 00:36:03 +00:00
Nick Mathewson
82e2d6001a r11954@catbus: nickm | 2007-02-26 13:01:19 -0500
Note some optimizations that are probably not worth it for 0.1.2.x based on preliminary profiling.


svn:r9659
2007-02-26 18:01:23 +00:00
Roger Dingledine
9e44449946 fix a bug in our logic, but point out that maybe it's moot
svn:r9654
2007-02-26 05:33:17 +00:00
Roger Dingledine
d6c21ab8a7 tell the user if we're delaying his newnym request. also, pick
a different set of fenceposts.


svn:r9647
2007-02-24 21:21:38 +00:00
Roger Dingledine
50f22e858a doc pedant
svn:r9634
2007-02-24 07:50:38 +00:00
Roger Dingledine
748c502e3a fix a log message that was broken long ago and never noticed
svn:r9630
2007-02-24 05:36:45 +00:00
Nick Mathewson
4e05ccb289 r11900@catbus: nickm | 2007-02-23 18:11:04 -0500
Fix null-pointer access on update_router_descriptor_cache_downloads.


svn:r9626
2007-02-23 23:11:08 +00:00
Nick Mathewson
a2a52b4d5f r11876@catbus: nickm | 2007-02-22 02:23:13 -0500
Fix two XXXX012 issues in routerlist.c: a possible performance issue hasnt shown up on any profiles, so unflag it.  Stop warning when we get a router descriptor that we asked for but no longer want: just drop it (if we are not a cache) or cache if (if we are).


svn:r9616
2007-02-22 07:41:10 +00:00
Nick Mathewson
809a4daa52 r11859@catbus: nickm | 2007-02-21 00:53:27 -0500
Fix use of predict. this should get refactored, but now now.


svn:r9611
2007-02-21 05:57:08 +00:00
Nick Mathewson
2a4fc8533c r11858@catbus: nickm | 2007-02-21 00:27:44 -0500
As a trivial optimization, remove a redundant call to router_have_minimum_dir_info.  This might shave 2% on some systems by according to some profilers.


svn:r9610
2007-02-21 05:56:53 +00:00
Nick Mathewson
aade1b9204 r11844@catbus: nickm | 2007-02-17 16:53:42 -0500
Note a problematic warning.


svn:r9599
2007-02-17 23:49:50 +00:00
Nick Mathewson
a3ec172e1a r11827@catbus: nickm | 2007-02-16 15:00:39 -0500
Try to fix VC++ int conversion warning.


svn:r9595
2007-02-16 20:01:21 +00:00
Nick Mathewson
11e5656ab7 r11826@catbus: nickm | 2007-02-16 14:58:38 -0500
Resolve 56 DOCDOC comments.


svn:r9594
2007-02-16 20:01:02 +00:00
Nick Mathewson
d9c095be3e r11787@catbus: nickm | 2007-02-12 21:01:34 -0500
Always remove expired routers and networkstatus docs before checking whether we have enough information to build circuits. (Fixes bug 373.)


svn:r9575
2007-02-13 02:01:38 +00:00
Nick Mathewson
3c691b9da6 r11785@catbus: nickm | 2007-02-12 20:27:48 -0500
Node-picking fixes: Never warn when a down node is listed in a config option (bug 348); always warn when a node in a config option is unnamed.  Also, when entrynodes is configured, then build the guard list as: (parts of EntryNodes that were guards before), (the rest of EntryNodes), (the rest of the old guards).  This last point ensures that EntryNode users will get the EntryNodes they want with the minimum change to their guard list.


svn:r9574
2007-02-13 01:27:55 +00:00
Nick Mathewson
95b828b685 r11781@catbus: nickm | 2007-02-12 18:31:33 -0500
Discard any v1 directory info that is so old as to be useless.  (Fixes bug 387)


svn:r9572
2007-02-12 23:39:24 +00:00
Nick Mathewson
759c58151e r11775@catbus: nickm | 2007-02-12 16:39:09 -0500
Update copyright dates.


svn:r9570
2007-02-12 21:39:53 +00:00
Nick Mathewson
30e7c05075 r11774@catbus: nickm | 2007-02-12 16:31:47 -0500
Handle errors on opening cached-routers* more uniformly and sanely: log not-found errors at level INFO, and all other errors at level WARN.  Needs testing on win32.


svn:r9569
2007-02-12 21:39:44 +00:00
Nick Mathewson
ec54857870 r11732@catbus: nickm | 2007-02-08 18:12:54 -0500
Fix an "uninitialized variable" warning.


svn:r9536
2007-02-08 23:24:03 +00:00
Roger Dingledine
90b53beec5 add a comment so i stop worrying
svn:r9532
2007-02-08 20:27:58 +00:00
Nick Mathewson
a1a9c66ce5 r11717@catbus: nickm | 2007-02-08 14:44:30 -0500
Clear up some XXX012s in routerlist.c: make smartlist_choose_by_bandwidth handle statuses with no corresponding routers much better.


svn:r9531
2007-02-08 19:44:55 +00:00
Nick Mathewson
1e2d5f30ff r11700@catbus: nickm | 2007-02-08 02:03:50 -0500
Fix several bugs in computing recommended versions. 1) refactor is-this-version-good handling and which-vesions-are-good handling to be in the same place. 2) a version is recommended if more than half of the versioning authorities like it, not >= half.  3) "NEW_IN_SERIES" should mean, "I don't know of an 0.1.1.x this recent, and there are some 0.1.2.x versions out", not "I don't know of an 0.1.1.x this recent, but I know some older ones."  This should resolve bug 383.


svn:r9523
2007-02-08 07:24:06 +00:00
Roger Dingledine
4ba57f68e4 more changes. i'm all caught up now.
svn:r9495
2007-02-06 02:49:07 +00:00
Nick Mathewson
fefba95363 r11629@catbus: nickm | 2007-02-02 15:06:17 -0500
Removing the last DOCDOC comment hurt so much that I had to use Doxygen to identify undocumented macros and comments, and add 150 more DOCDOCs to point out where they were.  Oops.  Hey, kids!  Fixing some of these could be your first Tor patch!


svn:r9477
2007-02-02 20:06:43 +00:00
Nick Mathewson
e521c96cb1 r12123@Kushana: nickm | 2007-02-02 13:57:42 -0500
Resolve remaining DOCDOC comments.


svn:r9476
2007-02-02 18:58:11 +00:00
Nick Mathewson
6f2a92c5b3 r11621@catbus: nickm | 2007-02-01 13:09:18 -0500
Fix another VC compiler warning.


svn:r9473
2007-02-01 18:09:34 +00:00
Nick Mathewson
5cb99857bc r11620@catbus: nickm | 2007-02-01 13:06:27 -0500
Call stat() slightly less often; use fstat() when possible.


svn:r9472
2007-02-01 18:09:27 +00:00
Roger Dingledine
baeeadb6eb avoid messy crashes (bugfix by nick)
svn:r9435
2007-01-27 18:33:33 +00:00
Roger Dingledine
9057af692a Weight directory requests by advertised bandwidth. Now we can
let servers enable write limiting but still allow most clients to
succeed at their directory requests.


svn:r9433
2007-01-27 09:13:19 +00:00
Nick Mathewson
adc5bb4d04 r9723@catbus: nickm | 2007-01-22 15:47:17 -0500
Fix an XXXX012 in routerlist.c: when we do not have enough networkstatuses to launch router requests, do not launch router requests. Backport candidate.


svn:r9388
2007-01-22 20:57:26 +00:00
Roger Dingledine
9f733c31cc minor cleanups
svn:r9387
2007-01-22 19:20:33 +00:00
Nick Mathewson
84790d059f r9715@catbus: nickm | 2007-01-22 02:51:04 -0500
Document a few undocumented functions and arguments.


svn:r9385
2007-01-22 07:51:06 +00:00
Roger Dingledine
7b5f9887fa resolve an XXX, add a new XXX, simplify some code
svn:r9381
2007-01-22 05:59:59 +00:00
Nick Mathewson
8835bb844e r11922@Kushana: nickm | 2007-01-10 15:43:18 -0500
Clear untrusted networkstatuses after 10 days too.  (This is not a terribly awful bug, since we would only ever retain 16 of them, but it still might be nice to backport.)  Resolves part A of bug 372.


svn:r9324
2007-01-10 20:43:40 +00:00
Nick Mathewson
c8466c5919 r11824@Kushana: nickm | 2007-01-03 17:15:28 -0500
control-spec: upcase arguments in status events; note unimplemented events individually
 r11825@Kushana:  nickm | 2007-01-03 17:41:43 -0500
 Implement EXTERNAL IP server status event.
 r11826@Kushana:  nickm | 2007-01-03 17:47:10 -0500
 Implement BAD_SERVER_DESCRIPTOR server status event.
 r11827@Kushana:  nickm | 2007-01-03 18:01:56 -0500
 Implement SOCKS_UNKNOWN_PROTOCOL and DANGEROUS_SOCKS client events.
 r11828@Kushana:  nickm | 2007-01-03 18:23:22 -0500
 Implement BUG controller events. Also, flush ERR-level status events just like ERR-level log messages.
 r11829@Kushana:  nickm | 2007-01-03 23:37:27 -0500
 Yet more status events: CLOCK_SKEW, GOOD/ACCEPTED_SERVER_DESCRIPTOR, {CHECKING_}REACHABILITY_{SUCCEEDED|FAILED}
 r11833@Kushana:  nickm | 2007-01-05 16:56:37 -0500
 Note some unimplementedness in control-spec.txt


svn:r9279
2007-01-06 05:42:31 +00:00
Roger Dingledine
5e89bc9b4b fix a bug i introduced in r9249; and more cleanups.
svn:r9263
2007-01-04 09:12:23 +00:00
Nick Mathewson
2963d4acc2 r11820@Kushana: nickm | 2007-01-03 14:54:05 -0500
Add (and specify) a BadDirectory flag to networkstatuses, so authorities can tell clients that some caches are broken.  Also, implement an as-yet-unused function to estimate how many bytes will be sent on a directory connection.


svn:r9255
2007-01-03 19:58:00 +00:00
Roger Dingledine
d677332a83 checkpoint as we add PreferTunneledDirConns config option
svn:r9249
2007-01-03 06:33:03 +00:00
Nick Mathewson
7ee99ba342 r11759@Kushana: nickm | 2006-12-29 15:21:14 -0500
Actually, handle_getinfo_helper supports 552 results just fine: just leave *answer unset.


svn:r9217
2006-12-29 20:49:47 +00:00
Nick Mathewson
7cfdac1bf6 r11737@Kushana: nickm | 2006-12-28 18:32:13 -0500
Remove some dead code; refactor some duplicated code.


svn:r9206
2006-12-29 02:49:12 +00:00
Nick Mathewson
b59573949e r11736@Kushana: nickm | 2006-12-28 17:46:23 -0500
Mark a pile of XXXX comments as targetted for 0.1.2: some because they look important, some because they look easy.


svn:r9205
2006-12-29 02:47:51 +00:00
Nick Mathewson
2e538d9918 r11694@Kushana: nickm | 2006-12-23 23:09:20 -0500
Add a version entry to networkstatus documents; have this entry get parsed and used to calculate whether begin_dir is supported.


svn:r9181
2006-12-24 04:09:48 +00:00
Nick Mathewson
9efdf6acc5 r11677@Kushana: nickm | 2006-12-23 21:17:54 -0500
Track when we get 503s from directory servers.  Do not use directory servers that have given us a 503 until either an hour has passed, or we are are out of non-busy servers.


svn:r9172
2006-12-24 02:45:35 +00:00
Nick Mathewson
4d948281c3 r11676@Kushana: nickm | 2006-12-23 20:42:17 -0500
Add an orport option to dirserver lines so that clients can tell where to connect to open an encrypted tunnel to a dirserver even before they have its descriptor.


svn:r9171
2006-12-24 02:45:27 +00:00
Nick Mathewson
cf04e1e6e7 r11479@Kushana: nickm | 2006-12-07 23:38:54 -0500
Refactor GETINFO into a table-driven dispatch, as suggested by arma.  My brain hurts.


svn:r9052
2006-12-08 04:39:13 +00:00
Nick Mathewson
e6c467fe07 r11454@Kushana: nickm | 2006-12-07 10:07:24 -0500
Apparently, we actually hit the nasty mmap-then-unlink behavior.  Fix it.


svn:r9039
2006-12-07 15:07:33 +00:00
Roger Dingledine
c5b90daf86 cleanups, bump to 0.1.2.4-alpha
svn:r9015
2006-12-02 22:47:46 +00:00
Nick Mathewson
0ad2fd1129 r9467@Kushana: nickm | 2006-11-01 18:51:16 -0500
Allow larger amounts of drift in uptime to be "cosmetic".


svn:r8891
2006-11-01 23:53:15 +00:00
Roger Dingledine
6ecf74af60 and blow away what appears to be some redundant logic
svn:r8806
2006-10-23 10:17:52 +00:00
Roger Dingledine
77c8c0ee51 spec and implement some more status events. start to build
some conventions.


svn:r8805
2006-10-23 10:16:43 +00:00
Roger Dingledine
07cfeb0198 fix a minor memory leak every time we rebuild the router store,
fix a rare memory leak if something goes wrong while rebuilding it,
and clean up some code. nick, please confirm.

reported by "fookoowa" in flyspray 346 (yay!)


svn:r8789
2006-10-22 08:08:10 +00:00
Nick Mathewson
01bc03eff4 r9312@Kushana: nickm | 2006-10-20 14:45:22 -0400
Add an event type to tell the controller when our opinion of a router status has changed.  I might have missed some cases here.


svn:r8781
2006-10-20 21:04:39 +00:00
Roger Dingledine
0459db2c0d checkpoint some changes as i read diffs
svn:r8780
2006-10-20 19:11:12 +00:00
Nick Mathewson
e5f064c983 r9290@31-35-219: nickm | 2006-10-20 10:32:33 -0400
Add a GETINFO target so controllers can ask Tor for the current state of a router.  (Results given in networkstatus format.)


svn:r8772
2006-10-20 14:58:29 +00:00
Nick Mathewson
7551c44a53 r9274@Kushana: nickm | 2006-10-19 16:16:58 -0400
Add unit tests for tor_mmap_file(); make tor_mmap_t.size always be the size of the file (not the size of the mapping); add an extra argument to read_file_to_str() so it can return the size of the result string.


svn:r8762
2006-10-19 23:05:02 +00:00
Nick Mathewson
126a3f699a r9273@Kushana: nickm | 2006-10-19 15:43:39 -0400
Never discard a descriptor for being too old until either it is recommended by no authorities, or until we download a better (more recent and recommended) one for the same router. This will eventually make it possible for servers to publish less often.


svn:r8761
2006-10-19 23:04:56 +00:00
Nick Mathewson
4443934702 r9091@totoro: nickm | 2006-10-19 11:45:28 -0400
Change to BadExit logic: Let authorities set an "I list bad exits" flag.  Consider an exit bad if it is listed as bad by more than half of *those* authorities.  This gives us a better migration path.


svn:r8756
2006-10-19 15:45:48 +00:00
Nick Mathewson
eca28f24f5 r9004@totoro: nickm | 2006-10-11 18:05:24 -0400
Add client support for a 'BadExit' flag, so authorities can say "Server X is a poor choise for your nytimes.com connections, as it seems to direct them to HoorayForMao.com or (more likely) WouldYouLikeToBuyTheseFineEncyclopedias.com"
 


svn:r8690
2006-10-11 22:06:01 +00:00
Roger Dingledine
f2bd0e2f16 more minor cleanups
svn:r8630
2006-10-07 06:28:50 +00:00
Roger Dingledine
06e5b2283c minor cleanups
svn:r8622
2006-10-07 00:50:39 +00:00
Nick Mathewson
6e0b90a902 r8838@totoro: nickm | 2006-10-02 15:24:39 -0400
Partial implementation of revised nickname syntax for controllers.  Implement ability to look up routers by "verbose" nicknames; add a per-v1-control-connection flag to turn the feature on in events.  Needs testing, spec, ability to actually turn on the flag, double-checking that we wont overflow any nickname buffers, and changelog.


svn:r8582
2006-10-03 18:58:40 +00:00
Nick Mathewson
57ffca883d r8826@totoro: nickm | 2006-10-01 17:58:45 -0400
Disprefer exit nodes for entry, middle positions (fixes bug 200).  Also, switch to using a uint64_t to hold "total bandwidth for all nodes" under consideration; crypt_rand_int would have died at 2GB/s network capacity.


svn:r8571
2006-10-01 21:59:09 +00:00
Roger Dingledine
7ed921708f Track down a seg fault that's been bothering me a while: if you
enable your dirport as a client, you'll crash.


svn:r8561
2006-10-01 07:53:17 +00:00
Nick Mathewson
8308a37908 r9023@Kushana: nickm | 2006-09-29 17:27:24 -0400
Make distinct all non-bug messages at notice or higher that appear 3 or more times.


svn:r8541
2006-09-29 22:33:34 +00:00
Nick Mathewson
8992bf6204 r8776@totoro: nickm | 2006-09-29 00:50:46 -0400
Reserve the nickname "Unnamed" for routers that can't pick a hostname; any
 router can call itself Unnamed; directory servers will never allocate Unnamed
 to any particular router; clients won't believe that any router is the
 canonical Unnamed.
 


svn:r8529
2006-09-29 04:51:28 +00:00
Nick Mathewson
907fc6c73e r8977@Kushana: nickm | 2006-09-28 19:56:41 -0400
Make "is a v1 authority", "is a v2 authority", and "is a hidden service authority" into separate flags so we can eventually migrate more trust away from moria.


svn:r8523
2006-09-28 23:57:59 +00:00
Nick Mathewson
9988112c87 r8973@Kushana: nickm | 2006-09-28 16:53:19 -0400
Refactor entry guard status logic a lot; allow more factors [like not
 having a Guard flag or being listed in ExcludeNodes] to render a guard
 "unlisted" (now called "unusable"); track guard down status (now
 called "unreachable") separately from is_running.


svn:r8519
2006-09-28 23:57:44 +00:00
Nick Mathewson
49ad1eefa1 Add an EnforceDistinctSubnets option so that clients who know what they are doing (mainly people with private testing networks) can disable our same-/16 detection.
svn:r8504
2006-09-25 22:12:54 +00:00
Nick Mathewson
4fe76e7b6b Free named_server_map on shutdown.
svn:r8500
2006-09-25 16:06:39 +00:00
Nick Mathewson
bde5939ad3 r8909@Kushana: nickm | 2006-09-22 00:38:13 -0400
Consider changes to has_old_dnsworkers as noncosmetic


svn:r8464
2006-09-22 20:20:21 +00:00
Nick Mathewson
6b716fdfb9 NEEDS REVIEW. Act on previous comment, and handle named servers differently: now, we allow multiple servers with the same name in the routerlist even if that name is reserved, but we check whether names are reserved when we try to look up routers by nickname. This is a minor security fix. This makes router_add_to_routerlist O(1). This is a backport candidate.
svn:r8433
2006-09-19 23:48:14 +00:00
Nick Mathewson
5ebb949c9f Stop searching routerlist for routers with the same identity as other routers (on router insert): we already have a map for that. (We need to add an index field to routerinfo_t so we can figure out which point in the routerlist to replace.) Also, add a comment to routerlist.c; arma, please advise?
svn:r8432
2006-09-19 23:18:30 +00:00
Nick Mathewson
7b0ec744bc Switch routerlist.c to using memcmp on digests rather than crypto_pk_cmp_keys(); speed up find_whitespace a lot (8x for me) by using a switch statement. This should speed parsing a lot of routers at once by a lot.
svn:r8430
2006-09-19 22:20:09 +00:00
Nick Mathewson
65974f82fa r8839@Kushana: nickm | 2006-09-17 16:11:59 -0400
Add some client performance XXXXs; try to move some common case tests higher on their decision trees.


svn:r8410
2006-09-17 20:12:10 +00:00
Roger Dingledine
769f9201a6 Send out a burst of long-range drop cells after we've established that
we're reachable. Spread them over 4 circuits, so hopefully a few will
be fast. This exercises our bandwidth and bootstraps us quicker.


svn:r8399
2006-09-15 05:30:25 +00:00
Peter Palfrader
ba091ae5d7 r9770@danube: weasel | 2006-09-15 07:20:05 +0200
router_set_networkstatus() gets a list of status documents we asked for from
 connection_dir_client_reached_eof().  However, as a cache we (sometimes?) just
 ask for "all".  router_set_networkstatus() would freak out over that, meaning
 it would log a warning and drop the status document instead of caching it
 as it is supposed to.  Now we let router_set_networkstatus() know if the
 data comes from an all-request so it can do the right thing.


svn:r8398
2006-09-15 05:20:16 +00:00
Peter Palfrader
5beb114744 r9767@danube: weasel | 2006-09-15 06:27:48 +0200
Minor documentation fix


svn:r8397
2006-09-15 04:29:36 +00:00
Nick Mathewson
21a7880358 r8695@Kushana: nickm | 2006-08-31 14:35:36 -0400
Fix two corner cases in router_dir_info_changed().  This should have no observable effect.


svn:r8311
2006-08-31 18:46:46 +00:00
Roger Dingledine
94afe807ac stop a big memory leak: we were leaking the whole contents
of cached-routers.new every time we read it.


svn:r8236
2006-08-27 02:12:12 +00:00
Roger Dingledine
9f5856c03d stop three memory leaks. nick, fix these if i'm wrong.
svn:r8235
2006-08-27 02:07:54 +00:00
Roger Dingledine
6650470575 automatically avoid picking more than one node from the same
/16 network when constructing a circuit.


svn:r7068
2006-08-16 03:44:13 +00:00
Nick Mathewson
273ee3e814 r7392@Kushana: nickm | 2006-08-14 23:50:32 -0400
Only do the expensive version of router_have_minimum_dir_info() when the dir info has changed.  Backport candidate, since oprofile suggests that this function and ones it calls account for 25-35% of oprofile samples.


svn:r7062
2006-08-15 03:54:09 +00:00
Nick Mathewson
7c596c166b r7029@Kushana: nickm | 2006-08-04 14:08:41 -0700
Remove now-spurious size and data arguments from tor_mmap_file


svn:r6987
2006-08-05 17:53:21 +00:00
Nick Mathewson
bf72878cad r7012@Kushana: nickm | 2006-08-03 19:21:25 -0700
Add an "mmap handle" type to encapsulate bookkeeping elements of mmap issues; add prelim win32 impl


svn:r6980
2006-08-04 18:32:43 +00:00
Nick Mathewson
ec82db6995 r6909@Kushana: nickm | 2006-07-26 13:05:58 -0400
Clean up wide lines from last patch.


svn:r6907
2006-07-26 19:07:37 +00:00
Nick Mathewson
4ff4577beb r6908@Kushana: nickm | 2006-07-26 12:38:52 -0400
Refactor connection_t into edge, or, dir, control, and base subtypes.  This might save some RAM on busy exit servers, but really matters most in terms of correctness.


svn:r6906
2006-07-26 19:07:26 +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
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
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
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
Nick Mathewson
52b8dfa95a Fix a bunch of spaces.
svn:r6678
2006-06-22 07:25:15 +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
Nick Mathewson
b5c599412f Backport candidate: implement the "is this uptime change cosmetic" test properly.
svn:r6654
2006-06-18 16:05:54 +00:00
Roger Dingledine
30f6c57fd7 and forward-port too.
svn:r6573
2006-06-09 06:52:49 +00:00
Roger Dingledine
a91be49402 fix a bootstrapping check we ignored that prevents us from running
with only one dir authority.


svn:r6570
2006-06-09 02:45:39 +00:00
Roger Dingledine
bb18168fae ok, ok, maybe *this* time my rep_hist_circbuilding_dormant() will work.
svn:r6568
2006-06-08 22:36:13 +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
Roger Dingledine
9000a5aff1 and get grammar right
svn:r6517
2006-05-30 06:19:48 +00:00
Roger Dingledine
ae2648fb1c stop fetching descriptors if we're not a dir mirror and we
haven't tried to establish any circuits lately.


svn:r6516
2006-05-30 06:19:06 +00:00
Roger Dingledine
60abe23158 tentative change: if you have your dirport set, you are a directory
mirror, whether or not your orport is set.


svn:r6513
2006-05-30 06:11:36 +00:00
Roger Dingledine
f579478687 correct a false log message, since we actually reset all our
downloading stats every hour, and sometimes more often.


svn:r6505
2006-05-26 16:29:20 +00:00
Roger Dingledine
295ad74fda Tor servers are also giving spurious "you're invalid" warnings.
This is because we get a lot of network statuses that don't list
us at all, and we conclude that they all think we're invalid.
The long-term fix is to get better logic, and the short-term fix
is to downgrade the log severity.


svn:r6448
2006-05-09 09:47:47 +00:00
Nick Mathewson
2b720b5746 Start remembering *where* we are storing routerdescs. This will make us easier to move from a RAM-mirrors-disk model to a RAM-caches-disk model, and save maybe around 10MB on a directory server.
svn:r6427
2006-04-29 18:42:26 +00:00
Nick Mathewson
15dbe02c04 shorten some too-wide lines
svn:r6426
2006-04-29 17:44:31 +00:00
Nick Mathewson
5bce102cd2 Only warn about a down node once
svn:r6420
2006-04-25 06:20:47 +00:00
Nick Mathewson
5f9612216c you wanted it spelled properly too? And me not even funded!
svn:r6418
2006-04-25 06:02:46 +00:00
Nick Mathewson
d6c04216ef fix a segfault in last bug-285-related commit.
svn:r6417
2006-04-25 05:59:31 +00:00
Nick Mathewson
c70f1e7eb3 Possible partial fix for 285; needs review
svn:r6414
2006-04-24 17:51:31 +00:00
Roger Dingledine
47d3e23155 note another bug: we complain that a router doesn't exist,
because it's down so we never fetched it so it doesn't exist.


svn:r6394
2006-04-17 06:46:20 +00:00