Commit Graph

294 Commits

Author SHA1 Message Date
Roger Dingledine
13e709a0ff resolve nick's comment
svn:r5163
2005-09-30 02:08:57 +00:00
Nick Mathewson
edd15cb781 Note that there is incorrect behavior in directory.c code. Arma, please check this too.
svn:r5161
2005-09-30 01:38:09 +00:00
Nick Mathewson
92451f74a8 Reformat inconsistent function declarations.
svn:r5160
2005-09-30 01:09:52 +00:00
Roger Dingledine
ea18827cee do the other half of dirport reachability testing.
it should be back and working now.


svn:r5155
2005-09-29 23:59:36 +00:00
Roger Dingledine
f8d430653e better cleanups as i figure out what's going on
svn:r5154
2005-09-29 23:26:42 +00:00
Roger Dingledine
d4d8adaa6d move some code around when we're succeeding or failing at fetching
server descs.
also clean up some formatting.


svn:r5153
2005-09-29 23:06:48 +00:00
Nick Mathewson
126a1e3e32 Fix crash-on-wakeup bug in networkstatus download.
svn:r5144
2005-09-26 16:37:39 +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
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
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
Roger Dingledine
959598fae6 content-type bugfixes:
http://seppia.noreply.org/tor/dir.z was being declared text/plain
and
http://seppia.noreply.org/tor/server/fp/719BE45DE224B607C53707D0E2143E2D423E74CF
was being declared application/octet-stream


svn:r5108
2005-09-22 00:17:41 +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
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
d45badd9f4 Add a missing return
svn:r5079
2005-09-16 04:52:53 +00:00
Nick Mathewson
9c2ca40df3 Unify our "figure out which fingerprints we were downloading" code.
svn:r5077
2005-09-16 04:42:45 +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
ed21abfe87 And some documentation before bed.
svn:r5073
2005-09-15 06:15:31 +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
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
Roger Dingledine
ca727ba6e1 bugfix: when we try to determine the reachability of our dirport,
and it doesn't work, don't freak out and mark ourselves as down and
try somewhere else. just calmly fail.


svn:r5050
2005-09-14 03:49:17 +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
Roger Dingledine
63bb27f19d be more thorough about noticing when a directory request has failed:
it has failed not only when the connection attempt fails, but also
if the conn reaches eof before we get a response that we're happy with.


svn:r5013
2005-09-12 07:36:26 +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
89d516f95c clean up the log entry for when a server posts a server descriptor that
the dirserver doesn't like


svn:r5005
2005-09-12 06:08:48 +00:00
Nick Mathewson
0de64f224e Warn in more detail when network-status serving and fetching fails. Also, fix a small leak.
svn:r4963
2005-09-09 19:37:12 +00:00
Roger Dingledine
2065c5f7aa when printing x-forwarded-by headers, don't print the \r
svn:r4959
2005-09-09 02:02:20 +00:00
Nick Mathewson
bd911d8612 Fix segfault and memleak when getting many compressed server descs.
svn:r4956
2005-09-08 22:00:29 +00:00
Nick Mathewson
659491bbc6 Fix some messages that say "failing".
svn:r4955
2005-09-08 21:46:31 +00:00
Nick Mathewson
d410c49965 Clean up some more fingerprint-checking logic
svn:r4954
2005-09-08 21:39:39 +00:00
Nick Mathewson
9df4716ac3 make it work correctly when we download multiple network-status objects.
svn:r4952
2005-09-08 21:28:45 +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
Roger Dingledine
465aec04c1 when reporting results from a dirserver fetch/post, tell us the
port for the dirserver too


svn:r4942
2005-09-08 19:21:48 +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
ff9452e900 Clean up should-i-go-to-the-dirserv logic a little: All servers with DirPorts should get their directories from the source
svn:r4930
2005-09-08 18:14:01 +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
4aca47268d Logic to launch connections for new directory types.
svn:r4914
2005-09-07 20:03:02 +00:00
Nick Mathewson
eac917fd6a clean whitespace.
svn:r4912
2005-09-07 17:15:46 +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
Roger Dingledine
c384fa706d stop using the v1 rend desc format. we're going to change v1
some more before we switch to it.


svn:r4909
2005-09-06 06:14:38 +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
Roger Dingledine
6a52aa52fe fix a pair of hard-coded urls
svn:r4887
2005-08-30 07:01:30 +00:00
Roger Dingledine
77f52e3467 fix some logs and comments
svn:r4864
2005-08-26 21:55:38 +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