Commit Graph

412 Commits

Author SHA1 Message Date
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