Commit Graph

599 Commits

Author SHA1 Message Date
Nick Mathewson
1ce3713889 Possible bug 265 fix: authorities must be more strict than clients about age of acceptable routers; make routers publish every 12 hours; client ROUTER_MAX_AGE must be greater than NETWORKSTATUS_MAX_AGE+authoirty ROUTER_MAX_AGE.
svn:r6095
2006-03-08 06:29:52 +00:00
Roger Dingledine
89b07b458b i missed the other half of that grammar fix
svn:r6058
2006-02-21 03:55:47 +00:00
Peter Palfrader
c4f389420c Improve the "we have been waiting for 1140377851 seconds" log
svn:r6046
2006-02-19 19:44:09 +00:00
Roger Dingledine
f6d80d60e0 don't warn when we get a server descriptor from the controller
but it's too old. that's not something tor should fix.


svn:r6019
2006-02-15 03:01:53 +00:00
Peter Palfrader
5eea6c76df Split ReachableAddresses into ReachableDirAddresses and ReachableORAddresses
svn:r6009
2006-02-13 21:17:20 +00:00
Roger Dingledine
259c65ab08 the last of the log convention conversion. finally.
svn:r6005
2006-02-13 10:33:00 +00:00
Roger Dingledine
b7781ea208 bugfix: we were ignoring the IS_FAST flag in the directory
status, meaning we were willing to pick trivial-bandwidth nodes
for "fast" connections.


svn:r5992
2006-02-13 00:09:30 +00:00
Roger Dingledine
3c4e68488b Clients now honor the "guard" flag in the router status when
picking entry guards, rather than looking at is_fast or is_stable.

Now dirservers can change how they define it and clients will
automatically use their new definition.


svn:r5979
2006-02-12 03:43:39 +00:00
Roger Dingledine
85a64b4fd0 get our grammar right when complaining about un-recommended versions
svn:r5950
2006-02-09 06:08:59 +00:00
Roger Dingledine
5f051574d5 Happy new year!
svn:r5949
2006-02-09 05:46:49 +00:00
Nick Mathewson
e5a574ce2e Move "sort list of versions" logic into routerparse.c; make version-checking code say which versions it would have accepted. (not tested.)
svn:r5927
2006-02-06 05:04:27 +00:00
Roger Dingledine
a9c87fe251 more typos and nits
svn:r5918
2006-02-05 05:28:52 +00:00
Nick Mathewson
157e6a025a Stupid cut-and-paste bug.
svn:r5917
2006-02-05 05:11:24 +00:00
Roger Dingledine
d602d0d298 cosmetic fix
svn:r5915
2006-02-05 03:42:04 +00:00
Roger Dingledine
640882c76c clean up tabs and wide-lines from weasel's commit
svn:r5914
2006-02-05 03:23:16 +00:00
Roger Dingledine
53f86cdf5d fix bug: we were caching the newest descriptor for each server,
well, forever. i imagine this just keeps growing in size.


svn:r5912
2006-02-05 02:07:28 +00:00
Peter Palfrader
390bbb0a0c Try to make tor work better through squid: Limit number of descriptors we fetch
to 96 (was 128 previously).

We limit this number even when we do not have a http proxy explicitly
configured as some people mistakenly believe transparent proxies are a neat
idea.


svn:r5901
2006-02-03 15:17:48 +00:00
Roger Dingledine
92ef9e37e7 Add a new config option ExitPolicyRejectPrivate which defaults to 1.
This means all exit policies will begin with rejecting private addresses,
unless the server operator explicitly turns it off.

Also, make our code to remove redundancies in the exit policy smarter,
so it can detect "reject foo, reject bar, reject *" patterns.

Lastly, we can get rid of the "exit policy implicitly accepts" code,
since we make everything more explicit now.


svn:r5888
2006-02-01 03:53:52 +00:00
Peter Palfrader
bf514e5dc5 Try to fix policy_includes_addr_mask_implicitly()
svn:r5886
2006-02-01 02:52:55 +00:00
Peter Palfrader
61ea27620a Also catch 0/8 in exit_policy_implicitly_allows_local_networks()
svn:r5885
2006-02-01 02:31:27 +00:00
Roger Dingledine
2eabf190e9 make it louder when we're running an unrecommended version.
also, we need to tell them what versions *are* recommended.
i'll add that to the todo.


svn:r5859
2006-01-24 03:45:58 +00:00
Nick Mathewson
9f42c9d650 Make dirservers generate a separate "guard" flag to mean, "would make a good entry guard". Make clients parse it and vote on it.
svn:r5856
2006-01-24 00:31:16 +00:00
Roger Dingledine
b9540285af remove unused code
svn:r5847
2006-01-20 20:54:42 +00:00
Roger Dingledine
d5acef191c add another assert to make sure we're not scribbling on the stack.
svn:r5837
2006-01-17 04:14:04 +00:00
Nick Mathewson
1057516a07 Clients should not download descriptors for non-running descriptors.
svn:r5830
2006-01-16 20:52:30 +00:00
Nick Mathewson
2dd566d5d5 Indirect access to the signed_descriptor field to make it easier to keep them lazily on disk.
svn:r5827
2006-01-12 18:04:17 +00:00
Roger Dingledine
0e51d5d274 When the controller was submitting a descriptor, we were checking to make
sure some network-status we had referred to it, and refusing it if not.
This is bad for people who want to insert descriptors that aren't part of
the current Tor network. Now we accept them, and also give a more useful
warn message if we ask a dir mirror for a given descriptor and it gives us
one we weren't expecting.


svn:r5824
2006-01-12 03:43:39 +00:00
Nick Mathewson
eb78295e4e Fix memory leak in routerlist_remove_old_routers().
svn:r5790
2006-01-11 03:58:07 +00:00
Roger Dingledine
7d1f675c85 entry nodes are now entry guards.
this is our last easy chance for a wholesale change. heave ho.


svn:r5782
2006-01-10 22:42:44 +00:00
Nick Mathewson
43a4f8c7f3 Be more aggressive about throwing away expired router descriptors: they are of no use to anybody. Better still: dont serve expired descriptors by fingerprint. The only people who ask for them are busted 0.1.1.10 Tors that will throw them away and re-request them after 30 minutes.
svn:r5762
2006-01-10 04:57:12 +00:00
Nick Mathewson
56c55c343e When picking a random directory, prefer non-authorities if any are known.
svn:r5761
2006-01-09 23:39:07 +00:00
Nick Mathewson
e30516f33f Fix bug 236: caches should cache up to 16 unrecognized network-status docs.
svn:r5754
2006-01-08 21:26:33 +00:00
Nick Mathewson
50b6b3258d Dont call directory_get_from_dirserver when you have a particular dirserver in mind; remove fetch-from-authority special-case in directory_get_from_dirserver.
svn:r5741
2006-01-06 18:19:17 +00:00
Roger Dingledine
6aaa92f736 short-circuit half the cost of node-picking in the general case.
svn:r5732
2006-01-05 10:59:46 +00:00
Roger Dingledine
f8a59965a1 cleanups, and remove some unreachable code.
svn:r5727
2006-01-04 06:43:03 +00:00
Roger Dingledine
485aa9415d authdirs now stop whining so loudly about bad descriptors that they fetch
from other dirservers. now when there's a log complaint, it's for sure
from a freshly uploaded descriptor.


svn:r5726
2006-01-04 04:42:10 +00:00
Roger Dingledine
f6f65c66b5 oh, it was supposed to compile?
svn:r5721
2006-01-03 13:12:17 +00:00
Roger Dingledine
da06f3553c don't try to build circuits until we have 3 running servers;
and for networks that are very small, having more than a quarter
of the descriptors is much harder than having equal to or more than
a quarter of the descriptors -- follow the spec.


svn:r5720
2006-01-03 13:09:49 +00:00
Roger Dingledine
9af33ef39c when we choose not to use a server descriptor from our cache, don't
log it so loudly.


svn:r5713
2006-01-03 10:42:20 +00:00
Roger Dingledine
5947388968 Finish implementing config's EntryNodes and StrictEntryNodes option.
The logging is way verbose for now.


svn:r5683
2005-12-31 06:32:57 +00:00
Roger Dingledine
0dc8e284f8 load balance a bit better by taking some load off the really
fast servers.
this might slow things down more, or it might not. hm.


svn:r5681
2005-12-30 04:46:43 +00:00
Roger Dingledine
c051e82f69 fix a typo
svn:r5680
2005-12-30 04:44:10 +00:00
Nick Mathewson
fc850273bd Appease some verbose GCC warnings.
svn:r5679
2005-12-29 20:25:53 +00:00
Roger Dingledine
dbd7b97eff helper nodes are dead. long live entry nodes.
(config options EntryNodes and StrictEntryNodes still not
implemented.)


svn:r5673
2005-12-28 09:07:31 +00:00
Nick Mathewson
9ef54a3d0c Make directory caches a little less chatty when logging
svn:r5662
2005-12-27 06:05:54 +00:00
Nick Mathewson
fa0d5aa894 Make insert_old try hard to never add a duplicate.
svn:r5661
2005-12-27 05:58:12 +00:00
Nick Mathewson
ece9865020 Implement new directory logic: download by descriptor digest, not by key digest. Caches try to download all listed digests from authorities; clients try to download "best" digests from caches.
svn:r5659
2005-12-27 05:26:03 +00:00
Roger Dingledine
34249e8861 fix segfault when specifying DirServer without nickname
(reported by weasel)


svn:r5614
2005-12-18 22:45:27 +00:00
Nick Mathewson
6b5fc9d46f Instead of "Network down", say "Is your network connection down?"
svn:r5607
2005-12-15 22:10:03 +00:00
Roger Dingledine
edde3fcf25 ah ha, that variable was static. not useless after all.
svn:r5604
2005-12-15 21:44:23 +00:00
Roger Dingledine
002c9b3589 clean up a lot message, and remove a line that does nothing.
svn:r5603
2005-12-15 21:41:27 +00:00
Nick Mathewson
cf8c70b79c fix compile
svn:r5600
2005-12-15 21:38:59 +00:00
Nick Mathewson
280c62314e Make clients look at the fast and stable flags in networkstatus, not at the bandwidth and uptime declared in the router descriptors.
svn:r5599
2005-12-15 21:30:57 +00:00
Roger Dingledine
3489066433 put back in a todo comment, so we don't forget.
svn:r5598
2005-12-15 21:26:52 +00:00
Nick Mathewson
24e79df0b6 Whitespace fixes; comments.
svn:r5596
2005-12-15 21:17:40 +00:00
Nick Mathewson
6b1305aeeb Flip a misplaced not
svn:r5593
2005-12-15 20:56:46 +00:00
Nick Mathewson
ce71b17224 Clean fake_status a bit. Switch from has_fetched_directory to have_minimum_dir_info, and make the latter function smarter.
svn:r5591
2005-12-15 20:44:15 +00:00
Roger Dingledine
25e1ad02fa implement weasel's suggestion to fix the bug that newly bootstrapped
tor networks couldn't do hidden services until they had nodes with high
uptime: if you're trying to pick a node for your circuit and you demand
uptime or capacity and nothing works, then abandon your need for uptime
and capacity.


svn:r5589
2005-12-15 09:53:00 +00:00
Nick Mathewson
7af95e5c06 When we mark a router as down, also mark its local_routerstatus as not running. This way, we do not use directories that are believed to be down.
svn:r5587
2005-12-14 22:05:10 +00:00
Nick Mathewson
9482b1b9d5 Choose directory servers from routerstatus list, not from routerinfo list. This way, as soon was we have a networkstatus, we can ask a cache to give us routers, rather than needing to ask the directories.
svn:r5586
2005-12-14 22:00:58 +00:00
Nick Mathewson
1af630d32c Bite the bullet and limit all our source lines to 80 characters, the way IBM intended.
svn:r5582
2005-12-14 20:40:40 +00:00
Nick Mathewson
32126cced1 Make directory authorities ignore router uploads that have only cosmetic differences: now regardless of version!
svn:r5573
2005-12-12 01:02:08 +00:00
Roger Dingledine
58366ffd24 when we changed from log_fn to debug/info/notice/warn/err,
we screwed up the formatting in wild and unpredictable ways.

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

still need to do src/common/ someday.


svn:r5551
2005-12-10 09:36:26 +00:00
Roger Dingledine
9b0a40ec78 crank the max line limit down to 150 chars.
svn:r5550
2005-12-10 08:27:01 +00:00
Nick Mathewson
39265dd72e In my private little universe, terminals are still 80 columns. Impose a 160-character-per-line limit; this will creep down.
svn:r5548
2005-12-09 05:37:26 +00:00
Nick Mathewson
b1d034d2ab Fix bug 212: Directory authorities should not try to download server descriptors that they know they will reject.
svn:r5514
2005-12-06 06:55:43 +00:00
Nick Mathewson
9cec3a13f5 remove some functions that are not used; #if0 out some files that are not likely to be used.
svn:r5471
2005-11-30 06:27:59 +00:00
Nick Mathewson
3bd613b44d Rename connection_get_by_identity_digest to reflect that it is OR-only. Make it use a hashtable instead of a linear search.
svn:r5469
2005-11-30 03:01:16 +00:00
Nick Mathewson
7de0c33857 Avoid a segfault in routerlist_reset_warnings()
svn:r5464
2005-11-28 16:29:27 +00:00
Roger Dingledine
0118a236a4 comment that scary-looking function.
svn:r5447
2005-11-23 07:30:44 +00:00
Nick Mathewson
eb0021b06e Fix dumb logic error that kept some old descripttors from getting the axe.
svn:r5446
2005-11-23 07:28:54 +00:00
Nick Mathewson
061ef582a1 Make dropping very old descriptors faster (remove old correctness check). Track bytes dropped that are still in our store or journal, and rebuild when it gets very high.
svn:r5445
2005-11-23 07:24:59 +00:00
Nick Mathewson
36109fea33 e more aggressive about calling routerlist_remove_old_routers()
svn:r5444
2005-11-23 07:06:36 +00:00
Nick Mathewson
fbf8a8c25f Dump bytes held to store descriptors.
svn:r5443
2005-11-23 06:00:58 +00:00
Nick Mathewson
7d7bb95f36 Track how many bytes we have in signed descriptors. Try to make sure we are tracking this right. Somebody should valgrind a dirserver on an example net. There should be code to dump this value.
svn:r5442
2005-11-23 05:47:51 +00:00
Nick Mathewson
50ce5e1932 Avoid spurious re-launch of first pending requested descriptor
svn:r5439
2005-11-22 02:20:05 +00:00
Roger Dingledine
f28770b639 be less eager to decide that the entire network is down
svn:r5434
2005-11-19 11:04:00 +00:00
Roger Dingledine
859d1c902a and another instance where i was trying to be too sneaky
svn:r5433
2005-11-19 10:38:23 +00:00
Roger Dingledine
5c949fce51 Start obeying our firewall options more rigorously:
- If we can't get to a dirserver directly, try going via Tor.
  - Don't ever try to connect (as a client) to a place our firewall
    options forbid.
  - If we specify a proxy and also firewall options, obey the firewall
    options even when we're using the proxy: some proxies can only proxy
    to certain destinations.


svn:r5431
2005-11-19 10:12:10 +00:00
Roger Dingledine
7aae63994f Recover better from TCP connections to Tor servers that are broken but
don't tell you (it happens!); and rotate TLS connections once a week.

1) If an OR conn becomes more than a week old, make it obsolete.
2) If it's obsolete and empty, kill it.
3) When an OR makes a second connection to you, allow it.
4) If we want to send a new create cell, but the best conn we've
   got is obsolete, and the router is 0.1.1.9-alpha-cvs or later, ask
   for a new conn instead.
5) When we time out on circuit building on the first hop, make that
   connection obsolete.


svn:r5429
2005-11-19 06:57:44 +00:00
Roger Dingledine
afb1c79879 Leave options->DirServers alone -- if the user didn't specify any,
just add the default ones directly to the trusted dirserver list.
This fixes a bug where people running controllers would setconf or
the equivalent, and Tor would start yelling at them about setting
their own DirServer lines.


svn:r5418
2005-11-18 02:47:09 +00:00
Roger Dingledine
aa53190ed5 and another one
svn:r5416
2005-11-17 22:23:18 +00:00
Roger Dingledine
9111a3fb48 comment out some really popular log lines
svn:r5415
2005-11-17 22:19:35 +00:00
Roger Dingledine
fe7b07754f make it even more clear that i didn't screw up the logic
svn:r5378
2005-11-15 09:57:58 +00:00
Roger Dingledine
53269f696d fix logic error: not unnamed is good.
svn:r5377
2005-11-15 09:15:43 +00:00
Nick Mathewson
9b432311c4 Make new logging stuff work on windows; fix a couple of windows typos.
svn:r5375
2005-11-15 03:05:23 +00:00
Roger Dingledine
4d1c6bbfc4 fix function comment
svn:r5356
2005-11-11 17:16:24 +00:00
Roger Dingledine
c074f528c1 fix a harmless warn and mark two points where we should
maybe change our approach.


svn:r5352
2005-11-11 17:01:20 +00:00
Nick Mathewson
75d85c8214 On directory servers, old_routers was wasting hundreds of bytes per superseded router descriptor. Roll the signed descriptor info and identifying info into a cache_info struct, and use only that for old_routers.
svn:r5349
2005-11-05 20:15:27 +00:00
Nick Mathewson
757def59b6 Fix bugs in routerlist_remove_old_cached_routers_with_id()
svn:r5348
2005-11-04 16:47:26 +00:00
Nick Mathewson
9e82f0cdb7 enable code to remove members of old_routers when it gets big.
svn:r5345
2005-11-01 17:34:17 +00:00
Roger Dingledine
6dafca62f0 remove redundant checking for . and .. now that
tor_listdir() checks for this too.


svn:r5337
2005-11-01 03:50:14 +00:00
Roger Dingledine
1991f6cf48 more doc cleanups and reorganizing
svn:r5336
2005-11-01 03:48:51 +00:00
Roger Dingledine
862e8a1bd1 fix typo
svn:r5331
2005-10-29 18:00:25 +00:00
Nick Mathewson
ed32d85a04 router_add_to_routerlist() really needs to free not-added routers.
svn:r5328
2005-10-28 18:44:51 +00:00
Nick Mathewson
7643c5254c Fix an annoying rep violation bug
svn:r5325
2005-10-27 23:06:09 +00:00
Nick Mathewson
e594ce92fe Start making directory caches retain old routerinfo_t. The code to remove old ones is definitely some textbook C problem.
svn:r5323
2005-10-27 00:34:39 +00:00
Nick Mathewson
b39d03116b remove some commented-out code that may tempt us to do ill
svn:r5320
2005-10-25 18:38:44 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Nick Mathewson
f9b0be526e Use LD_BUG as appropriate; convert rend* and router* to new logging interface; use new circ_log_path interface
svn:r5302
2005-10-24 19:39:45 +00:00
Roger Dingledine
d6dcd973c3 Oct 19 13:27:24.391 [info] router_reload_networkstatus(): Skipping cached-status file with unexpected name "."
Oct 19 13:27:24.391 [info] router_reload_networkstatus(): Skipping cached-status file with unexpected name ".."


svn:r5291
2005-10-20 17:22:00 +00:00
Nick Mathewson
52eaccce44 Crank down the frequency for replacing unchanged descriptors
svn:r5290
2005-10-19 16:21:19 +00:00
Nick Mathewson
7b8980a43c Make it compile. appease roger and his thirst for documentation.
svn:r5289
2005-10-19 03:08:50 +00:00
Nick Mathewson
74d9c92c49 We need a routerlist_replace as well. This should do something about those annoying mysterious segfaults.
svn:r5288
2005-10-19 03:02:28 +00:00
Nick Mathewson
edf5698474 Start dividing log messages into logging domains. No, LD_ is not the best of identifiers. src/or has not been converted yet. Domains dont do anything yet.
svn:r5284
2005-10-18 21:58:19 +00:00
Peter Palfrader
e54efb1655 I think nick meant to compare r2->platform the second time
svn:r5282
2005-10-18 21:19:48 +00:00
Peter Palfrader
0d5c007266 Fix tor26's first segfault
svn:r5281
2005-10-18 21:19:02 +00:00
Nick Mathewson
d25873ae9c Use a digestmap_t to speed up router_get_by_digest, which was previously a bottleneck (~~27% CPU)
svn:r5280
2005-10-18 20:13:09 +00:00
Nick Mathewson
3347c1741d Refactor routerlist access slightly: always use router_get_by_routerlist(); change its interface; add modifier functions to add/remove elements from the current routerlist (so we can add indices).
svn:r5276
2005-10-18 17:43:54 +00:00
Nick Mathewson
6101468cbe Enable trivial "download by descriptor digest" functionality.
svn:r5250
2005-10-14 04:56:20 +00:00
Nick Mathewson
aac738d2be When no descriptors changed, do not send a NEWDESC event.
svn:r5244
2005-10-12 19:41:16 +00:00
Nick Mathewson
972b7512c7 authorities do not replace server descriptors where nothing semantically relevant has changed since the last upload.
svn:r5240
2005-10-12 18:25:25 +00:00
Nick Mathewson
fd9bfef13b Funny. I could have sworn it compiled this morning when I checked it in.
svn:r5239
2005-10-12 17:16:25 +00:00
Nick Mathewson
a7ca56b537 More work towards a sane digest-based liveness testing.
svn:r5238
2005-10-12 13:49:13 +00:00
Nick Mathewson
2b3a7b818f Add an as-yet-unused "EXTENDED" flag to SETEVENTS to indicate that the client can handle extra labeled info in its events. Add moreinfo to the "what is ready for downloading" msg so we can investigate digest-related download rules
svn:r5237
2005-10-12 04:31:44 +00:00
Nick Mathewson
08e4f132a8 add some docs; if warn_if_unnamed is 0, really do not warn.
svn:r5234
2005-10-11 01:57:28 +00:00
Nick Mathewson
d7b04a8788 do not try to download a routerdesc if we would immediately reject it as obsolete.
svn:r5225
2005-10-07 22:00:09 +00:00
Nick Mathewson
cc35e1720f Using RAND_pseudo_bytes instead of RAND_bytes is an accident waiting to happen, and does not really speed us up much when we do it. So stop doing it.
svn:r5210
2005-10-06 22:18:01 +00:00
Nick Mathewson
56be5a9706 I *knew* something was wrong here. Flip some comparison operators and make download-rate-limiting sane again.
svn:r5201
2005-10-05 22:36:18 +00:00
Nick Mathewson
1ebbaf5c3a improve INFO-level logging for directory downloads. This is still too chatty, but it will help us analyze things.
svn:r5197
2005-10-05 20:45:18 +00:00
Nick Mathewson
370e4abdc9 replace former relaunches of directory downloads with reset of failure count and relaunch of status downloads. Fix memory leak in trusted_dir_server_t. Reset "last download attempted" time when resetting failure counts.
svn:r5195
2005-10-05 05:03:52 +00:00
Nick Mathewson
509de69a7e reset warning flags on SIGHUP. arma: is this everything?
svn:r5192
2005-10-05 02:20:46 +00:00
Nick Mathewson
8434595584 Fix verbose compiler warnings, including one in routerlist.c that would have been an actual error. Normalize whitespace. Enforce convention that "address" is a hostname and "addr" is an IPv4 address.
svn:r5190
2005-10-05 02:06:36 +00:00
Nick Mathewson
0924094042 resolve some directory-related XXXXs; downgrade naming conflict messages from WARN to INFO for non-authorities; do not repeat naming conflict messages.
svn:r5189
2005-10-05 01:53:44 +00:00
Nick Mathewson
1223310b69 Downgrade noisy log messages in preparation for an alpha release.
svn:r5188
2005-10-05 01:27:08 +00:00
Nick Mathewson
61ea516885 Check for named servers when looking them up by nickname;
warn when we'recalling a non-named server by its nickname;
don't warn twice about the same name.

Fix a bug in routers_update_status_from_networkstatus that made nearly
all clients never update routerinfo_t.is_named.

Try to list MyFamily elements by key, not by nickname.

Only warn about names that we generated ourself, or got from the local
user.

On TLS handshake, only check the other router's nickname against its
expected nickname if is_named is set.


svn:r5185
2005-10-04 22:23:31 +00:00
Nick Mathewson
2d203fdcf3 link nicknames to trusted directory servers; log these nicknames when mentioning servers; also, when we get a naming conflict; log which nicknames or keys are supposed to bind.
svn:r5184
2005-10-04 21:21:09 +00:00
Nick Mathewson
b10df0d595 cosmetic fix: only have one local to hold smartlist_len(downloadable), not too.
svn:r5183
2005-10-04 20:18:26 +00:00
Nick Mathewson
808e584a87 remove a never-used smartlist in routerlist.c
svn:r5176
2005-09-30 21:38:45 +00:00
Nick Mathewson
23864ad423 Try to hunt down a few more leaks
svn:r5172
2005-09-30 21:22:25 +00:00
Nick Mathewson
5333a3b838 fix a small filename leak
svn:r5170
2005-09-30 21:11:22 +00:00
Nick Mathewson
8408006318 fix a memory leak on exit in routerlist.c
svn:r5169
2005-09-30 21:04:52 +00:00
Nick Mathewson
fc3c0197f9 Resolve several DOCDOCs. Make non-mirrors only launch routerdesc downloads when they have more than 16 router descriptors to download, or when 10 minutes have passed since the last download.
svn:r5166
2005-09-30 20:04:55 +00:00
Roger Dingledine
8fc9330686 fix typo
svn:r5151
2005-09-29 23:03:34 +00:00
Nick Mathewson
abb8576538 But, of course, mirrors should get the most up-to-date server in any case.
svn:r5135
2005-09-23 21:33:59 +00:00
Nick Mathewson
b726507d36 Log even less verbosely. Also, do not download old (frequently-updating) servers more than once every 2 hours.
svn:r5134
2005-09-23 21:25:29 +00:00
Nick Mathewson
18a0a0e458 Oops. It looks like some old GCCs dislike #if inside a macro argument.
svn:r5131
2005-09-23 20:31:07 +00:00
Nick Mathewson
c345dab3bd Fix logic error (people who ask authorities should never split; others should always split). Also, fix timing error in main.c so retries really happen.
svn:r5127
2005-09-23 18:17:37 +00:00
Nick Mathewson
a1f1c4bf6b Re-enable autosplitting, but authorities and mirrors should not do it, and make the cutoff higher than 1.
svn:r5126
2005-09-23 18:08:31 +00:00
Nick Mathewson
f995edd516 Fix at least one overzealous download bug. (tor_malloc_zero new local_routerstatus_t objs); add a pile of logs back in; probe every 10sec; never autolaunch on failure. Let us see if this works better.
svn:r5125
2005-09-23 18:05:14 +00:00
Nick Mathewson
9050480339 Fix some compiler warnings
svn:r5124
2005-09-23 17:11:20 +00:00
Roger Dingledine
2d6b36a001 get rid of a noisy debug log
svn:r5111
2005-09-22 20:51:45 +00:00
Nick Mathewson
cdc912714e I love the smell of C in the morning. Make router-download rules smarter (download more so long as we dont duplicate existing requests; relaunch at staggered intervals); relaunch one a minute or on failure; reset 60 minutes; always open 3 requests if we can; add authority opinion to networkstatus; make naming rule correct. There is a remaining bug where we retry servers too quickly; We need to look at that harder.
svn:r5110
2005-09-22 06:34:29 +00:00
Nick Mathewson
6693031947 Use a separate type for "local view of router status". Also, even though I told arma there was no need, replace an ugly O ( n lg n ) algorithm with a nice O ( n ) algorithm when stepping through servers. Some ugliness is just too bad to stand.
svn:r5109
2005-09-22 01:51:14 +00:00
Nick Mathewson
72915546cd Only check versions from versioning authdirs.
svn:r5101
2005-09-21 02:38:51 +00:00
Nick Mathewson
20b9111266 Implement new version handling code.
svn:r5100
2005-09-21 00:41:06 +00:00
Nick Mathewson
837b223c8c remove some debugging garbage
svn:r5092
2005-09-18 04:32:58 +00:00
Nick Mathewson
283032960d Make give-up-on-failure actually work: it seems the servers gave me a real test case.
svn:r5091
2005-09-18 04:15:39 +00:00
Nick Mathewson
d118d5069a Prevent a "try forever to download an unobtainable descriptor" bug. Still remaining: the "give up forever" bug.
svn:r5090
2005-09-18 02:51:12 +00:00
Nick Mathewson
87f6d526fe Refactor new directory code a bit. Keep a big list of rolled-up router status info, including # of download failures (not yet used). Update this list from networkstatuses when they arrive, then update routers from this list. Only download 128 routers at a time, to avoid gargantuan URLs.
svn:r5089
2005-09-18 02:24:42 +00:00
Nick Mathewson
1fbe499bfe Remove a bunch of #if0d code that I no longer need to look at.
svn:r5083
2005-09-16 16:47:20 +00:00
Nick Mathewson
6d15a73548 Resolve/expand some XXXXs and improve a log message or two
svn:r5082
2005-09-16 16:41:45 +00:00
Nick Mathewson
538740e362 Fix the never-marked-anything-as-running bug. Now Tor builds circuts again. Woo.
svn:r5080
2005-09-16 04:53:28 +00:00
Nick Mathewson
1a786a297f Fix the confusing bug where we were downloading only the first n/2-1 of the servers we actually wanted.
svn:r5078
2005-09-16 04:43:21 +00:00
Nick Mathewson
05bab28c7d Add some (notice, for now) log messages that imply confusing things are happening.
svn:r5076
2005-09-15 21:11:48 +00:00
Nick Mathewson
e72e76cad6 Make authdirs smarter. Reject/invalidate by key and IP. Remember that not every authdir has to be a naming authdir.
svn:r5074
2005-09-15 14:39:05 +00:00
Nick Mathewson
ed21abfe87 And some documentation before bed.
svn:r5073
2005-09-15 06:15:31 +00:00
Nick Mathewson
b70c229f6e make some functions static; clean dead networkstatus entries more often.
svn:r5072
2005-09-15 05:41:30 +00:00
Nick Mathewson
b16048917c Stop downloading directories and download routers instead. This still needs some work, but at last clients are finally on the new architecture. Next comes the tuning and bugfixing.
svn:r5070
2005-09-15 05:19:38 +00:00
Nick Mathewson
e83e1df811 separate validation from naming in authoritative directory servers; simplify some router-management code.
svn:r5069
2005-09-15 00:51:42 +00:00
Nick Mathewson
d4e0af7822 Fix a bunch of log messages. Deprecate some routerlist fields; remove others, and status_set_at from routerinfo_t. Compress routerlist.c cleanup functions. Update cached networkstatus mtime when we download the same one twice. Change some interfaces.
svn:r5068
2005-09-14 23:42:06 +00:00
Nick Mathewson
27bbfe9dcf Would you believe that the software_versions field of routerlist_t was never actually used for anything?
svn:r5064
2005-09-14 21:38:05 +00:00
Nick Mathewson
e3adcbdb95 Big commit: clients start downloading and using network-statuses.
Only caches need to get running-routers; nobody needs to parse, store,
or use it.  Same for the router-status line in the directories.  Add
many #if 0's that can get removed once I'm convinced they don't
contain anything I'm forgetting.

Start all newly-parsed routers as non-running and non-valid; update
them from the list of network statuses.

Update all routers when a new networkstatus comes in.

After 3 tries for a networkstatus, clients give up until they're told
to try again.

     "Let's get those missles ready to **DESTROY THE UNIVERSE**!"
				-TMBG


svn:r5063
2005-09-14 21:09:25 +00:00
Nick Mathewson
d9ee94543e Declare 0.1.1.7 as The Version With The Good Dirservers.
svn:r5061
2005-09-14 19:12:35 +00:00
Nick Mathewson
890847d232 I forgot -- smart kids make their code compile.
svn:r5032
2005-09-13 21:18:00 +00:00
Nick Mathewson
4efa652a98 add docs, fix whitespace, and make ANY rule in routerparse a little tighter.
svn:r5031
2005-09-13 21:14:55 +00:00
Nick Mathewson
76351b8416 Fix DOCDOC entries in routerlist.c. Make more functions use SMARTLIST_FOREACH instead of raw loops. Replace router_list_superseded implementation with one that has a prayer of working.
svn:r5027
2005-09-13 15:32:03 +00:00
Nick Mathewson
29c57b54d4 Add functions to extend and compress new router store logic. (Basic idea: use a journal of newly received router descriptors, and periodically replace the old file. This avoids the "too many files" problem and the "too many rewrites" problem.)
svn:r5025
2005-09-13 06:21:10 +00:00
Nick Mathewson
3dc5e77b58 Numerous changes to move towards client-side v2 directories.
connection.c:
- Add some more connection accessor functions to make directory
  download redundancy checking work.

directory.c, or.h, router.c, routerlist.c:
- Start on logic to note when networkstatus downloads fail.

dirserv.c, routerlist.c, routerparse.c:
- Start maintaining an is_named field in routerstatus_t.  Don't
  actually look at it yet.

dirserv.c, routerlist.c:
- Remove expired networkstatus objects.

or.h:
- Make some booleans into bitfields
- Add prototypes

routerlist.c:
- Sort networkstatus list by publication time
- Function to remove old (older than 10 days) networkstatus objects.
- Function to set a list of routerinfo_ts' status info from the
  current set of networkstatus objects.
- Function to tell which routerinfos we need to download based no the
  current set of networkstatus objects.
- Do not launch a networkstatus download if a redundant one is in progress.

routerparse.c:
- Keep router entries in networkstatus sorted by digest.


svn:r5012
2005-09-12 06:56:42 +00:00
Roger Dingledine
b0a5ba4248 downgrade the dirserver log messages when whining about unreachability
svn:r4991
2005-09-10 20:40:16 +00:00
Nick Mathewson
d410c49965 Clean up some more fingerprint-checking logic
svn:r4954
2005-09-08 21:39:39 +00:00
Roger Dingledine
e28931dc94 unused variable
svn:r4949
2005-09-08 21:12:53 +00:00
Nick Mathewson
4528bbfd9f Resolve some XXXs. Add some others.
svn:r4947
2005-09-08 21:01:24 +00:00
Nick Mathewson
18e4d78354 Fix an assert in directory.c. Check received network-status objects against the list we expected to get. Do not let anyone else update our network-status object.
svn:r4945
2005-09-08 20:36:40 +00:00
Nick Mathewson
059148f588 Only caches download network-status for now, and they use a different strategy. Add an element to connection_t to remember what we are downloading, and a function to recognize our own fingerprint.
svn:r4944
2005-09-08 20:18:15 +00:00
Nick Mathewson
df79dc673b Remove sneaky double declaration.
svn:r4941
2005-09-08 19:18:55 +00:00
Nick Mathewson
0f94aa2ea1 Write status to disk in the right place
svn:r4940
2005-09-08 19:16:16 +00:00
Nick Mathewson
1e2f1679c8 Fix some more bugs; add a temporary log.
svn:r4936
2005-09-08 18:46:25 +00:00
Nick Mathewson
3a99927859 Make directory download code slightly less likely to segfault or assert.
svn:r4929
2005-09-08 16:18:28 +00:00
Nick Mathewson
f50ddfd4dd Download network-status at regular intervals. The code is probably iffy, and the constants need to be renamed.
svn:r4921
2005-09-08 06:22:44 +00:00
Nick Mathewson
9e76eae810 add missing return
svn:r4913
2005-09-07 17:18:52 +00:00
Nick Mathewson
5c6c88e76d More stuff for new directories.
- Distinguish v1 authorities (all currently trusted directories) from
  v2 authorities (all trusted directories).
    - Add configuration option for which dirs are v1 authories.
    - Add configuration option for whether to be a v1 authority.
    - Make trusted dirserver selection functions take options to
      choose which functionality we need.
    - Remove option when getting directory cache to see whether they
      support running-routers; they all do now.  Replace it with one
      to see whether caches support v2 stuff.

- Parse, cache, and serve network-status objects properly.

- Serve compressed groups of router descriptors.  The compression logic
  here could be more memory-efficient.

-


svn:r4911
2005-09-07 16:42:53 +00:00
Nick Mathewson
1e37ec4782 Comment structs, reload a field, start making network status caches work
svn:r4908
2005-09-04 23:12:27 +00:00
Nick Mathewson
815c092b22 Make structs for (v2) network-status and its per-router components. Add functions to parse them. Re-do the parsing logic a litt.e. Change signatures in or.h to support new DNS TTL logic.
svn:r4898
2005-09-02 20:37:31 +00:00
Roger Dingledine
93179f4e7e bugfix: moria2 wasn't listing itself as verified in its directory
svn:r4893
2005-09-02 06:19:31 +00:00
Roger Dingledine
ba899d0648 when we're shutting down and we do something like try to post a
server descriptor or rendezvous descriptor, don't complain that we
seem to be unreachable. of course we are, we're shutting down.


svn:r4892
2005-09-01 08:19:49 +00:00
Roger Dingledine
1b04f38145 subtle change to avoid some false positives:
if a server went down for six hours and then came back, we would
complain to it that it's unreachable. now we wait until the third
consecutive descriptor post that we thought it was unreachable,
before complaining to it.


svn:r4891
2005-09-01 08:13:40 +00:00
Roger Dingledine
3b6ab71929 and notify the dirserver operator whenever we do
svn:r4890
2005-08-31 06:18:19 +00:00
Roger Dingledine
711cad94ed when we think a router is unreachable, pass the message back to the
server's logs, and make it a 'warn'.
also, fix a memory leak for rejected router descriptors.


svn:r4889
2005-08-31 06:14:37 +00:00
Nick Mathewson
cd2bb915ed Fix a warning, add an assert.
svn:r4875
2005-08-26 23:12:13 +00:00
Nick Mathewson
70fe2a6cee Crashing dirservers on startup is often considered bad form.
svn:r4874
2005-08-26 23:04:12 +00:00
Nick Mathewson
ae4a183ed8 Change the return values on dirserv_add_descriptor
svn:r4863
2005-08-26 21:46:24 +00:00
Nick Mathewson
e24d540d81 We no longer need dirserv_load_from_directory_string, so dirserv_add_descriptor no longer has to keep track of where each descriptor ends.
svn:r4861
2005-08-26 21:28:16 +00:00
Roger Dingledine
715b972300 disarm a trap
svn:r4859
2005-08-26 21:12:53 +00:00
Nick Mathewson
47669fa0fd Fix assert failure on directory startup.
svn:r4858
2005-08-26 21:12:34 +00:00
Nick Mathewson
0e649ac60a Remove descriptor_list and use routerlist instead. Make directories manage routerlist a little better.
svn:r4854
2005-08-26 20:59:04 +00:00
Nick Mathewson
7f78be1659 Clean up the "add myself as a trusted dirserver" code.
svn:r4849
2005-08-26 19:31:51 +00:00
Nick Mathewson
43488472ec The circus music begins playing as nickm and arma juggle an ntohl. Hoop-lah!
svn:r4848
2005-08-26 19:25:36 +00:00
Nick Mathewson
ee76baae3d move a wandering ntohl
svn:r4847
2005-08-26 19:23:52 +00:00
Roger Dingledine
893acb3acc Make a new AssumeReachable config option that will publish anyway.
Also, let authdirservers start without setting their Address field.
Something is still not working though. Will fix in morning.


svn:r4839
2005-08-26 07:41:19 +00:00