Commit Graph

567 Commits

Author SHA1 Message Date
Nick Mathewson
f988f93b1a r15877@catbus: nickm | 2007-10-17 12:54:56 -0400
Make unverified-consensus get removed when it is accepted or rejected.  Make a new get_datadir_fname*() set of functions to eliminate the common code of "get the options, get the datadir, append some stuff".


svn:r12000
2007-10-17 16:55:44 +00:00
Nick Mathewson
3ad6dc0e2e r15806@catbus: nickm | 2007-10-15 19:14:57 -0400
Implement v3 networkstatus client code.  Remove v2 networkstatus client code, except as needed for caches to fetch and serve v2 networkstatues and the routers they list.


svn:r11957
2007-10-15 23:15:24 +00:00
Nick Mathewson
738d178f77 Make last commit compile
svn:r11953
2007-10-15 20:39:58 +00:00
Nick Mathewson
da955df111 Add some debugging logs related to dir vote timing.
svn:r11952
2007-10-15 20:37:59 +00:00
Nick Mathewson
783402f63a r15731@catbus: nickm | 2007-10-12 17:27:48 -0400
Move "sort a list of routerinfo_t" into its own function in routerlist.c


svn:r11903
2007-10-12 21:33:37 +00:00
Nick Mathewson
007d76543d r14887@Kushana: nickm | 2007-10-11 11:19:39 -0400
Fix some XXX020s in dirserv.c


svn:r11870
2007-10-11 16:06:51 +00:00
Nick Mathewson
9a56b17c54 r15679@catbus: nickm | 2007-10-11 09:51:33 -0400
Remove code to generate v1 directories.


svn:r11866
2007-10-11 13:56:33 +00:00
Nick Mathewson
487f985f5b r15670@catbus: nickm | 2007-10-10 20:08:14 -0400
Restore a removed assert.


svn:r11861
2007-10-11 00:13:06 +00:00
Roger Dingledine
dd920354c2 let bridge authorities write bridge descriptors to their
cached-descriptors* files.

nick, did i get this right?


svn:r11855
2007-10-10 23:11:53 +00:00
Roger Dingledine
d9a99b9ba6 get r11842 closer to what i want
svn:r11851
2007-10-10 20:13:52 +00:00
Roger Dingledine
f6b25613b8 Tweak the implementation of proposal 109 slightly: allow at most
two Tor servers on the same IP address, except if it's the location
of a directory authority, in which case allow five.


svn:r11842
2007-10-10 19:53:08 +00:00
Nick Mathewson
97fa3fdf16 r15599@catbus: nickm | 2007-10-09 16:44:36 -0400
Fix the bug that was making moria1 set valid-after wrong in its votes: we were looking at the preferred timing when we should have been looking at the consensus timing.


svn:r11818
2007-10-09 20:44:51 +00:00
Nick Mathewson
6f7847b378 r15530@catbus: nickm | 2007-10-04 12:16:27 -0400
Add a bunch of function documentation; clean up a little code; fix some XXXXs; tag the nonsensical EXTRAINFO_PURPOSE_GENERAL as nonsesnse; note another bit of "do not cache special routers" code to nuke.


svn:r11761
2007-10-04 16:21:58 +00:00
Nick Mathewson
b5c8a8ae53 r15422@catbus: nickm | 2007-09-27 16:42:35 -0400
Use descriptor annotations to record the source, download t time, and purpose of every descriptor we add to the store.  The remaining to-do item is to stop setting do_not_cache on bridges.


svn:r11680
2007-09-27 20:46:30 +00:00
Nick Mathewson
28946069ee r15412@catbus: nickm | 2007-09-27 12:04:24 -0400
More annotated-store work: handle annotations in lists correctly.  Add ability to prepend annotations to a routerdesc (and to every rtouredesc in a list), while verifying that the routerdesc is not already annotated.


svn:r11665
2007-09-27 16:08:10 +00:00
Nick Mathewson
034524f4b7 r15400@catbus: nickm | 2007-09-26 12:13:12 -0400
Backend for descriptor annotations: parse annotations as keywords; only allow them to appear in the cache; do not serve them as part of the descriptor if we are a dirserver.  Still need mechanism to set annotations.  Still need to rename cache file.


svn:r11654
2007-09-26 16:19:44 +00:00
Nick Mathewson
921f9f774d r15279@catbus: nickm | 2007-09-22 02:00:06 -0400
V3 authority work: fetch missing votes and/or signatures as needed.


svn:r11575
2007-09-22 06:06:05 +00:00
Roger Dingledine
90d1345d90 bugfix on r11110:
Fix a bug that made servers send a "404 Not found" in response to
attempts to fetch their server descriptor. This caused Tor servers
to take many minutes to establish reachability for their DirPort,
and it totally crippled bridges. Bugfix on 0.2.0.5-alpha.



svn:r11545
2007-09-20 22:08:40 +00:00
Roger Dingledine
088c4cd8ce it works better when it compiles
svn:r11531
2007-09-20 04:54:50 +00:00
Roger Dingledine
0914883339 Resume listing "AUTHORITY" flag for authorities in network status.
Bugfix on 0.2.0.3-alpha; reported by Alex de Joode.


svn:r11530
2007-09-20 04:37:17 +00:00
Roger Dingledine
ffce9d3368 trivial doxygen thing
svn:r11463
2007-09-17 21:59:07 +00:00
Nick Mathewson
8c13967803 r14448@Kushana: nickm | 2007-09-17 14:26:56 -0400
Unify all of the divergent median/nth-percentile code in container.[ch]


svn:r11457
2007-09-17 18:27:49 +00:00
Nick Mathewson
c65131b171 r14185@Kushana: nickm | 2007-08-22 11:07:01 -0400
Add some voting-related documentation.


svn:r11255
2007-08-22 15:07:44 +00:00
Nick Mathewson
7dbe7fd4d8 r14758@catbus: nickm | 2007-08-21 01:36:03 -0400
Finish implementing and documenting proposal 108: Authorities now use MTBF data to set their stability flags, once they have at least 4 days of data to use.


svn:r11240
2007-08-21 05:37:24 +00:00
Roger Dingledine
3f186e6510 help nick work on proposal 108
svn:r11148
2007-08-17 01:29:58 +00:00
Nick Mathewson
d5bd7d9fa3 r14032@Kushana: nickm | 2007-08-15 11:35:16 -0400
Add unit tests for median functions; enforce sensible ranges for intervals and delays.


svn:r11121
2007-08-15 15:38:58 +00:00
Nick Mathewson
486166f9a8 r14020@Kushana: nickm | 2007-08-14 16:07:37 -0400
return 404 properly when somebody requests a bunch of nonexistent statuses/servers


svn:r11110
2007-08-14 20:19:58 +00:00
Nick Mathewson
a1ce60f9a6 r14546@catbus: nickm | 2007-08-13 17:19:01 -0400
Make if-modified-since work on consensuses


svn:r11095
2007-08-13 21:19:54 +00:00
Nick Mathewson
936edd901d r13985@Kushana: nickm | 2007-08-13 16:05:07 -0400
Fix some simple logic errors in voting.


svn:r11089
2007-08-13 20:05:25 +00:00
Nick Mathewson
2d07cce67f r14536@catbus: nickm | 2007-08-13 15:54:17 -0400
Make voting actually function.


svn:r11088
2007-08-13 19:55:08 +00:00
Roger Dingledine
5920484083 dirserv.c:782: warning: `set_v1_dirty' might be used uninitialized in this function
svn:r11068
2007-08-10 03:07:00 +00:00
Nick Mathewson
77508edd36 r13989@catbus: nickm | 2007-07-29 19:11:07 -0400
More directory voting code.  Now, if everything works, and I haven't forgotten anything, it is possible to set up some v3 authorities and start voting. Of course, I have probably forgotten something, and there are probably bugs in there somewhere too.


svn:r10976
2007-07-29 23:11:44 +00:00
Nick Mathewson
616152486f r13986@catbus: nickm | 2007-07-29 09:15:03 -0400
Answer comment from Roger.


svn:r10971
2007-07-29 13:18:52 +00:00
Roger Dingledine
a68e6e23c9 patches on r10968: compare advertised capacity, not bandwidthrate;
and make the sorting order deterministic to avoid flapping.

also note that we could take the "is_auth" checks out of the
sorting entirely.


svn:r10970
2007-07-29 05:56:30 +00:00
Nick Mathewson
9031bbd4d8 r13982@catbus: nickm | 2007-07-29 01:31:53 -0400
Actually, we missed a rule about what routers to prefer: first prefer authority to non-authority, *then* running, *then* bandwidth.


svn:r10969
2007-07-29 05:32:03 +00:00
Nick Mathewson
1b665b3c7e r13979@catbus: nickm | 2007-07-29 01:20:20 -0400
Implement proposal 109:  As an authority, never call more than 3 servers per IP Running and Valid.  Prefer Running servers to non-running ones; then prefer high-bandwidth to low-bandwidth.  Needs testing.


svn:r10968
2007-07-29 05:20:31 +00:00
Nick Mathewson
43f64d09ea r13951@catbus: nickm | 2007-07-27 18:39:28 -0400
Make it so we can actually compile with FULL_V1_DIRECTORIES disabled.


svn:r10952
2007-07-27 23:18:58 +00:00
Nick Mathewson
a66f259354 r13902@catbus: nickm | 2007-07-25 17:43:52 -0400
Some dirvote code to handle generating votes and slinging them around.  More code is still needed.


svn:r10927
2007-07-25 22:56:44 +00:00
Nick Mathewson
1b7a704c34 r13901@catbus: nickm | 2007-07-25 16:23:51 -0400
Make all code to generate v1 directories into conditional code.


svn:r10926
2007-07-25 22:56:40 +00:00
Roger Dingledine
56d3119581 Directory authorities now call routers Fast if their bandwidth is
at least 100KB/s, and consider their bandwidth adequate to be a
Guard if it is at least 250KB/s. This fix complements proposal
107. [Bugfix on 0.1.2.x]


svn:r10897
2007-07-21 23:40:55 +00:00
Nick Mathewson
d920683718 r13821@catbus: nickm | 2007-07-18 16:29:17 -0400
Initial code to manipulate vote timing correctly.


svn:r10873
2007-07-18 20:46:12 +00:00
Peter Palfrader
3052bf6a84 Change routerlist_remove to not take an index argument we do not need anyway.
Now the only remaining caller of _routerlist_find_elt is an assert()

svn:r10869
2007-07-18 14:02:47 +00:00
Nick Mathewson
670db47e1b r13801@catbus: nickm | 2007-07-17 13:49:12 -0400
More tweaks to dir-spec.txt; not complete, but closing in.


svn:r10856
2007-07-17 17:49:16 +00:00
Nick Mathewson
3df7fc5e5a r13438@catbus: nickm | 2007-06-15 15:01:42 -0400
document some functions


svn:r10637
2007-06-17 15:10:43 +00:00
Roger Dingledine
6a2f045163 extra points for making the function name reflect what it does
svn:r10608
2007-06-15 04:23:36 +00:00
Roger Dingledine
73f7310d9b Directories no longer return a "304 not modified" when they don't
have the networkstatus the client asked for. Also fix a memory
leak when returning 304 not modified. [Bugfixes on 0.2.0.2-alpha]


svn:r10607
2007-06-15 04:20:51 +00:00
Roger Dingledine
9f9ee13dc0 point out a bug in our If-Modified-Since handling in 0.2.0.2-alpha.
svn:r10605
2007-06-15 03:14:02 +00:00
Nick Mathewson
c3626cdba7 r13395@catbus: nickm | 2007-06-13 15:01:23 -0400
Unit tests and debugging for generating and parsing consensus networkstatus documents.  Still need to test actual contents.


svn:r10589
2007-06-13 19:06:23 +00:00
Nick Mathewson
05cf945a1c r13393@catbus: nickm | 2007-06-13 14:29:14 -0400
More vote unit tests: check that we are parsing routerstatuses correctly.


svn:r10588
2007-06-13 18:29:16 +00:00
Nick Mathewson
0cf38ddef6 r13387@catbus: nickm | 2007-06-13 14:15:49 -0400
Unit tests and debugging for vote generation and parsing code.


svn:r10587
2007-06-13 18:16:05 +00:00
Nick Mathewson
932f2c79eb r13338@catbus: nickm | 2007-06-10 15:13:32 -0400
Fix bug in 10533: put "opt v" line at the end of a routerstatus section; overwriting is bad.


svn:r10549
2007-06-10 19:13:40 +00:00
Roger Dingledine
a97c3b8c2d Be clearer on the various roles for auth dir types.
Bridge authorities no longer write bridge descriptors to their
cached-routers file -- this gets complex because of extrainfo documents.


svn:r10545
2007-06-09 07:05:19 +00:00
Roger Dingledine
8dfde75ef6 don't complain when approved-routers isn't there and we
don't need it.


svn:r10544
2007-06-09 05:28:11 +00:00
Nick Mathewson
1d6db7ec3d r13325@catbus: nickm | 2007-06-08 15:02:37 -0400
Parse networkstatuses (v2, vote, and consensus) after generating them, and fail fast if there is a parse error.


svn:r10540
2007-06-08 19:02:39 +00:00
Nick Mathewson
678110570a r13315@catbus: nickm | 2007-06-08 14:33:24 -0400
Make versions get added to networkstatuses correctly again.


svn:r10535
2007-06-08 18:41:14 +00:00
Nick Mathewson
7a6f3cd223 r13313@catbus: nickm | 2007-06-08 14:23:11 -0400
Refactor v3 vote generation code into "build a networkstatus_vote_t" and "format a networkstatus_vote_t".  This should make testing possible.


svn:r10533
2007-06-08 18:41:09 +00:00
Nick Mathewson
8b0e6a4466 r13250@catbus: nickm | 2007-06-04 18:28:55 -0400
Adapt code to parse v3 networkstatus votes so it can also parse a consensus.  Make networkstatus_vote_t the catch-all type for votes and conensuses.  Correct/clarify the second argument to directory-signature.


svn:r10491
2007-06-04 22:29: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
e0d828299a r13165@catbus: nickm | 2007-06-02 22:55:22 -0400
Remove an obsoleted function


svn:r10460
2007-06-03 03:05:07 +00:00
Nick Mathewson
aee7f01624 r13154@catbus: nickm | 2007-06-02 11:26:44 -0400
Server-side support for If-Modified-Since in HTTP requsts for v1 stuff, and for network-status documents.


svn:r10451
2007-06-02 15:26:57 +00:00
Nick Mathewson
534c55f531 r13111@catbus: nickm | 2007-05-31 15:03:41 -0400
Cleanup whitespace.


svn:r10425
2007-05-31 19:03:49 +00:00
Nick Mathewson
884cb0c7a1 r13109@catbus: nickm | 2007-05-31 14:59:30 -0400
More code for voting and vote parsing (checkpointing)


svn:r10423
2007-05-31 19:03:44 +00:00
Nick Mathewson
77502ac82d r13102@catbus: nickm | 2007-05-31 13:56:25 -0400
Make "authdir_newdesc rejected" work again.


svn:r10421
2007-05-31 18:48:28 +00:00
Nick Mathewson
8b1e9398a8 r13079@catbus: nickm | 2007-05-29 17:05:38 -0400
Oops. Authorities should recommend nodes as exits.


svn:r10403
2007-05-29 21:05:49 +00:00
Nick Mathewson
c5b3a8db84 r13057@catbus: nickm | 2007-05-29 14:39:27 -0400
fix for bug 439: make _sure_ *msg is set when we leave dirserv_add_multiple_descriptors().


svn:r10396
2007-05-29 18:39:56 +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
Peter Palfrader
3425f2c11f Segfault less. Somebody needs to look over why exactly this helps. re #436
svn:r10376
2007-05-28 21:34:42 +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
ca9e13f2a0 r12906@catbus: nickm | 2007-05-22 20:43:13 -0400
s/32/64/;  s/breaks/works/;


svn:r10297
2007-05-23 00:43:20 +00:00
Nick Mathewson
38300735cd r12902@catbus: nickm | 2007-05-22 14:52:29 -0400
First draft of code to generate votes. needs testing. does not yet upload or serve votes.  Shares most of its code with the old generate_v2_networkstatus.


svn:r10295
2007-05-22 18:52:32 +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
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
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
07199e3d09 r12804@catbus: nickm | 2007-05-19 14:21:18 -0400
Disable a blatantly incorrect control event with potential for memory corruption.


svn:r10219
2007-05-19 18:31:02 +00:00
Roger Dingledine
84c3a19170 found this in my sandbox
svn:r10214
2007-05-19 00:14:34 +00:00
Nick Mathewson
ca32b4d5b5 r12761@catbus: nickm | 2007-05-15 03:13:52 -0400
Be a lot smarter when parsing lists of routers and extrainfos.


svn:r10193
2007-05-15 07:13:56 +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
dc795203aa early skeletal support for running a bridge directory authority
svn:r10112
2007-05-04 08:04:27 +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
979b90001b r12622@catbus: nickm | 2007-05-01 16:29:19 -0400
Look at the version in the routerinfo as well as the versino in the networkstatus when deciding whether to upload extrainfo


svn:r10088
2007-05-01 20:29:32 +00:00
Nick Mathewson
c9c0d2846d r12621@catbus: nickm | 2007-05-01 16:22:56 -0400
Authority patch; backport candidate: include micro-versions in network status documents.


svn:r10087
2007-05-01 20:29:26 +00:00
Nick Mathewson
ae40e7f633 r12585@catbus: nickm | 2007-04-30 14:38:37 -0400
(Needs review.) Allow directory authorities to accept multiple router descriptors and extra info documents in a single POST.  This will make implementing the client side of proposal 104 a lot simpler.


svn:r10069
2007-04-30 19:48:33 +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
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
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
38a5f09502 r12349@catbus: nickm | 2007-04-11 09:18:15 -0400
Add code to shrink the cell memory pool by discarding empty chunks that have been empty for the last 60 seconds.  Also, instead of having test.c duplicate declarations for exposed functions, put them inside #ifdef foo_PRIVATE blocks in the headers.  This prevents bugs where test.c gets out of sync.


svn:r9944
2007-04-11 13:18:25 +00:00
Nick Mathewson
d1ad950ca8 Turn bool_neq and bool_eq into macros.
svn:r9914
2007-03-29 02:37:06 +00:00
Nick Mathewson
d1381aef82 r12652@Kushana: nickm | 2007-03-25 15:01:48 -0400
A surprisingly simple patch to stop reading on edge connections when their circuits get too full, and start again when they empty out.  This lets us remove the logic to block begin_dir conns when the corresponding or conns get full: it was already broken by cell queues anyway.


svn:r9905
2007-03-26 14:08:18 +00:00
Roger Dingledine
75754b4d8e other minor fixes lurking in my sandbox
svn:r9854
2007-03-17 04:34:31 +00:00
Roger Dingledine
4813ff04e8 Fix an infinite loop introduced in 0.1.2.7-alpha when we serve
directory information requested inside Tor connections (i.e. via
begin_dir cells). It only triggered when the same connection was
serving other data at the same time. Reported by seeess.

Backport candidate.


svn:r9841
2007-03-16 06:55:09 +00:00
Roger Dingledine
bf3b3a44f3 Stop allowing hibernating servers to be "stable" or "fast".
This is what I meant to do in r9690 but didn't actually do.


svn:r9808
2007-03-13 01:59:09 +00:00
Roger Dingledine
a247792169 Directory authorities now call routers stable if they have an
uptime of at least 30 days, even if that's not the median uptime
in the network. Implements proposal 1xx, suggested by Kevin Bauer
and Damon McCoy.


svn:r9788
2007-03-10 05:43:35 +00:00
Roger Dingledine
6b191f854c resolve another xxx012
svn:r9701
2007-03-01 04:40:43 +00:00
Nick Mathewson
df5a8aa931 r12013@catbus: nickm | 2007-02-28 18:26:13 -0500
Note a piece of code that needs to get resolved, before we forget it.


svn:r9695
2007-03-01 00:41:33 +00:00
Roger Dingledine
b78f67dbf5 - Stop calling servers that have been hibernating for a long time
"stable". Also, stop letting hibernating or obsolete servers affect 
  uptime and bandwidth cutoffs.
- Stop listing hibernating servers in the v1 directory.


svn:r9690
2007-02-28 21:06:05 +00:00
Roger Dingledine
5fd4f7c131 the other half of r9572, suggested by seeess: when we receive
a v1 dir or rr that is too old, don't even cache it.


svn:r9649
2007-02-25 03:43:00 +00:00
Nick Mathewson
dde4bc1fd3 r11933@catbus: nickm | 2007-02-24 18:55:33 -0500
Fix a bug in 9572: after we decref a defunct v1 directory, drop the main reference to it.  Should fix bug 396.  Many thanks to seeess for tracking this one down.


svn:r9648
2007-02-24 23:55:36 +00:00
Roger Dingledine
50f22e858a doc pedant
svn:r9634
2007-02-24 07:50:38 +00:00
Roger Dingledine
33430d3a9e bugfix on r9568: we were throwing around an uninitialized
nickname array, and only treating a server as reachable if
the array magically has the right nickname in it. this was
causing the authorities to label only themselves as running,
and clients were "mysteriously" failing.


svn:r9628
2007-02-24 01:26:09 +00:00