Commit Graph

417 Commits

Author SHA1 Message Date
Roger Dingledine
4791a4f1c9 combine the cutoff log entries
svn:r8524
2006-09-29 00:19:43 +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
Peter Palfrader
540fbaae75 r9889@danube: weasel | 2006-09-29 00:57:42 +0200
bandwidth is not measured in bytes


svn:r8515
2006-09-28 22:59:36 +00:00
Peter Palfrader
9e6c0b8b3b r9888@danube: weasel | 2006-09-29 00:57:02 +0200
Also log guard bandwidth cutoff


svn:r8514
2006-09-28 22:59:25 +00:00
Nick Mathewson
ce83f43629 r8817@Kushana: nickm | 2006-09-14 18:31:29 -0400
Patch from steve hildrey: Generate network status correctly on non-versioning dirservers


svn:r8395
2006-09-14 22:34:57 +00:00
Nick Mathewson
4f888c9dfc r8808@senior-two-eighty: nickm | 2006-09-14 00:59:54 -0400
House style for no-args functions is old-style C, not C++


svn:r8388
2006-09-14 05:00:02 +00:00
Peter Palfrader
984e8f6efb r9736@danube: weasel | 2006-09-14 05:53:06 +0200
Refactor dirserv_parse_fingerprint_file(fname) into dirserv_load_fingerprint_file():
 There is not need to put together the path to the approved-routers file in more than one place.


svn:r8386
2006-09-14 04:53:23 +00:00
Roger Dingledine
6fdc63aed2 simplify the connection_write_to_buf_zlib() wrapper.
svn:r7042
2006-08-13 23:38:30 +00:00
Nick Mathewson
09a895e222 r7324@Kushana: nickm | 2006-08-10 23:23:15 -0700
Add more warnings to the list of those we tolerate. Start using GCC attributes more, for better error checking and better code generation.


svn:r7020
2006-08-11 07:09:17 +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
4d5fab4f9a tweak
svn:r6799
2006-07-21 07:53:21 +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
Roger Dingledine
c4411841d2 Avoid an integer underflow when the dir authority decides whether a
router is stable: we might wrongly label it stable, and compute a slightly
wrong median stability, when a descriptor is published later than now.

Inspired by Matt's Vidalia checkin:
http://trac.vidalia-project.net/changeset/1074


svn:r6758
2006-07-14 03:14:02 +00:00
Roger Dingledine
7f01dc9c1c whitespace/tab fixes
svn:r6734
2006-07-06 02:45:46 +00:00
Roger Dingledine
05d0b70573 Get rid of the router_retry_connections notion. Now routers no longer
try to rebuild long-term connections to directory authorities, and
directory authorities no longer try to rebuild long-term connections to
all servers.

We still don't hang up connections in these two cases though -- we need
to look at it more carefully to avoid flapping, and we likely need to
wait til 0.1.1.x is obsolete.


svn:r6712
2006-07-04 03:31:27 +00:00
Nick Mathewson
475eb5d6fe Apparent 311 fix: apparently passing Z_FINISH an empty string is problematic.
svn:r6702
2006-06-29 11:19:52 +00:00
Nick Mathewson
b82dfdd4a3 Make some more verbose gcc warnings go away.
svn:r6680
2006-06-22 07:34:04 +00:00
Nick Mathewson
52b8dfa95a Fix a bunch of spaces.
svn:r6678
2006-06-22 07:25:15 +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
Peter Palfrader
7b6c435066 <nickm> ooh, that log shouldn't be there. can you take it out?
svn:r6671
2006-06-20 23:11:15 +00:00
Nick Mathewson
0799154ae1 Fix bug in networkstatus spooling: spool more than the first networkstatus.
svn:r6670
2006-06-20 23:06:52 +00:00
Nick Mathewson
0e09b26112 Fishy, but harmless.
svn:r6669
2006-06-20 16:48:32 +00:00
Roger Dingledine
ef78e4245f add a note for nick to fix
svn:r6668
2006-06-20 13:14:07 +00:00
Nick Mathewson
a9e1a4c33c Ah. We need a new zlib_state for each networkstatus we spool out.
svn:r6667
2006-06-20 06:27:13 +00:00
Nick Mathewson
4283b81a48 Start spooling v2 networkstatus docs as well.
svn:r6664
2006-06-20 00:48:23 +00:00
Nick Mathewson
3f7f069a05 Fix a tricky crash: making the_directory heap-allocated (so we could refcount it and have multiple instances as neeeded) means that calls to dirserv_regenerate_directory could invalidate the auth_dir value passed to dirserv_pick_cached_dir_obj. Big fun.
svn:r6663
2006-06-18 21:30:03 +00:00
Nick Mathewson
2552d5e60f Fix an assert that still isnt the assert we are hunting.
svn:r6662
2006-06-18 21:15:01 +00:00
Nick Mathewson
f1993b8b30 Become capable of noticing that we are done sending a directory.
svn:r6659
2006-06-18 20:58:27 +00:00
Nick Mathewson
537104c908 write_to_buf != connection_write_to_buf. Also, add a connection_write_to_buf_zlib wrapper that sucks.
svn:r6650
2006-06-18 08:46:55 +00:00
Nick Mathewson
4d02ccfed8 Stop trying to refresh when we are out of data.
svn:r6647
2006-06-18 08:19:35 +00:00
Nick Mathewson
347bcec84a Fix a couple of bugs in last patch.
svn:r6644
2006-06-18 08:07:16 +00:00
Nick Mathewson
c58cc8c16c add coverage for a default case
svn:r6643
2006-06-18 07:57:47 +00:00
Nick Mathewson
b1a8b7869a Oops. conn->requested_resource is client only.
svn:r6642
2006-06-18 07:55:04 +00:00
Nick Mathewson
1d9923da7c Instead of adding servers and v1 directories to buffers en masse, directory servers add them on the fly as their outbufs are depleted. This will save ram on busy dirservers.
svn:r6641
2006-06-18 07:38:55 +00:00
Roger Dingledine
b4e415ba3c now we can tell dirserv_dump_directory_to_string() whether we want
it to include down/invalid descriptors or not.


svn:r6618
2006-06-13 11:11:19 +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
f6ff3e6f0e directory authorities should be more tolerant of failed reachability
tests before crying foul to the server operator.


svn:r6509
2006-05-28 16:14:26 +00:00
Roger Dingledine
0cee3e1fc7 if the bottom eighth of the servers by bandwidth is really crummy,
try the bottom quartile instead.


svn:r6387
2006-04-15 07:15:23 +00:00
Nick Mathewson
e258276c2b Change a dumb interface. Also, increment trusted_dir_server_t.n_networkstatus_failures when an all.z download fails entirely or partially.
svn:r6345
2006-04-10 01:35:56 +00:00
Roger Dingledine
0871f4ef90 Remove about 30% of the v1 directory bulk by not including down or
invalid nodes.

This will make exitlist's running on v1 not very good. I feel sorry for
them, but not as sorry as I feel for the directory mirrors.


svn:r6332
2006-04-09 01:00:24 +00:00
Roger Dingledine
b7cadc0db5 If you're not a versioning dirserver, don't put the string
"client-versions \nserver-versions \n" in your network status.


svn:r6329
2006-04-08 21:59:15 +00:00
Roger Dingledine
24b2e0530a clean up the log lines more, and note a future work.
svn:r6324
2006-04-08 21:12:07 +00:00
Roger Dingledine
f1692ebefc when we do reachability testing and the tls cert at the other
end disagrees with a descriptor we already have, be more useful
at explaining it.


svn:r6322
2006-04-08 20:35:19 +00:00
Nick Mathewson
5d466b7611 Fix a couple of things that make GCC complain with verbose warnings on. Also, fix some whitespace.
svn:r6317
2006-04-08 05:43:52 +00:00
Nick Mathewson
eba6204315 fix some xxxs.
svn:r6307
2006-04-03 06:23:24 +00:00
Nick Mathewson
d663bfa306 Versions that drop connections for having used idle circs are as bad for stable as for guard
svn:r6296
2006-04-02 23:01:01 +00:00
Roger Dingledine
6fb27741ba Fix dirserv_get_networkstatus_v2's api: its function comments
did not at all match its behavior, and I can't think of a case
when it should return anything other than 0.

This fix may allow getinfo dir/status/foo to work.


svn:r6285
2006-04-01 22:00:49 +00:00
Roger Dingledine
4c996757ae We can remove about 30% of the v1 directory bulk by taking
out down or invalid nodes. We should do this once we're ready.


svn:r6273
2006-03-29 09:21:23 +00:00
Roger Dingledine
db1209a852 Refactor the decision of whether to include a router's descriptor
in the v1 directory. No actual changes yet.


svn:r6272
2006-03-29 08:56:39 +00:00
Roger Dingledine
1f4d0d2479 When deciding whether a router is Fast or Guard-worthy, consider
his advertised BandwidthRate and not just the BandwidthCapacity.

This is a bug in 0.1.0.x as well, but let's not bother backporting.


svn:r6266
2006-03-28 12:01:58 +00:00
Roger Dingledine
6f08d121d9 Refactor and consolidate addr/exit policies into a new policies.c.
Fix some minor bugs and memory leaks along the way.


svn:r6246
2006-03-27 02:25:34 +00:00
Roger Dingledine
7edfec2ae6 bump up the magic number for how quickly we start notifying
a server that it's unreachable.


svn:r6234
2006-03-24 20:57:55 +00:00
Roger Dingledine
20e66a799b Resolve problem found by weasel: the v1 directory was including
servers as much as 48 hours old, because that's how the new
routerlist->routers works. Now only include them if they're
20 hours old or less.


svn:r6230
2006-03-22 21:32:42 +00:00
Peter Palfrader
58307cd8de Maybe it compiles for devilproxy now
svn:r6229
2006-03-22 11:23:00 +00:00
Roger Dingledine
5399e394a8 and dirservers don't call you a guard if you're running a
buggy version either.


svn:r6216
2006-03-21 23:10:26 +00:00
Nick Mathewson
08aba015ab Make guard bandwidth threshold higher than fast bandwidth threshold.
svn:r6204
2006-03-20 21:49:55 +00:00
Nick Mathewson
1272485cd4 Make "Fast" based on median capacity, just like "Stable" is based on median uptime.
svn:r6203
2006-03-20 21:41:12 +00:00
Roger Dingledine
c06e6ddadd Finish the transition from the word 'verified' to the words
'named' and 'valid'.


svn:r6188
2006-03-19 01:21:59 +00:00
Roger Dingledine
cf6ba3e76f let an authdir that's not a naming authdir start even
if it doesn't have an approved-routers file. if it does,
read it and parse it as usual.


svn:r6182
2006-03-18 00:22:23 +00:00
Nick Mathewson
fb7b5545ce Implement GETINFO(dir/server/foo); status will be harder.
svn:r6165
2006-03-15 05:06:56 +00:00
Peter Palfrader
a4ec555228 change INET_NTOA_BUF_LEN+1 to INET_NTOA_BUF_LEN
add a comment in a few places where we add weird numbers to buffer lengths


svn:r6161
2006-03-14 23:40:37 +00:00
Peter Palfrader
2ef8f772a1 Fix an off-by-one buffer size in dirserv.c that magically never hit our
three authorities but broke sjmurdoch's own tor network.


svn:r6157
2006-03-14 22:43:52 +00:00
Nick Mathewson
474c60b743 Cleanup on time-relaqted constants. New conventions:
1) Surround all constants by (parens), whether we'll be using them
     in a denominator or not.
  2) Express all time periods as products (24*60*60), not as multiplied-out
     constants (86400).
  3) Comments like "(60*60) /* one hour */" are as pointless as comments
     like "c = a + b; /* set c to the sum of a and b */".  Remove them.
  4) All time periods should be #defined constants, not given inline.
  5) All time periods should have doxygen comments.
  6) All time periods, unless specified, are in seconds.  It's not necessary
     to say so.

To summarize, the old (lack of) style would allow:

  #define FOO_RETRY_INTERVAL 60*60 /* one hour (seconds) */
  next_try = now + 3600;

The new style is:

  /** How often do we reattempt foo? */
  #define FOO_RETRY_INTERVAL (60*60)

  next_try = now + RETRY_INTERVAL;


svn:r6142
2006-03-12 22:48:18 +00:00
Roger Dingledine
b67a5ba498 lower the reachability timeout, so we're more likely to act
quickly if a server stops being reachable.


svn:r6141
2006-03-12 21:24:03 +00:00
Roger Dingledine
1fc5eb329b We screwed up in anticipating how to add new dirservers:
Old servers won't realize they're supposed to stay connected
to the new dirservers, so they'll expire connections to them,
but that means the dirservers will list them as unreachable.

So the fix is to stop requiring an open connection when deciding
if a server is reachable. This makes us slightly less accurate,
but at least it will work.


svn:r6140
2006-03-12 20:57:52 +00:00
Nick Mathewson
4d3e709c4b Use escaped() for remaining cases.
svn:r6117
2006-03-11 02:21:30 +00:00
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
Nick Mathewson
5777ee0e1a Add some functions to escape values from the network before sending them to the log. Use them everywhere except for routerinfo->plaftorm, routerinfo->contact_info, and rend*.c. (need sleep now)
svn:r6087
2006-03-05 09:50:26 +00:00
Roger Dingledine
aa63a84fe1 the things we do for our windows users.
i hope they appreciate it.


svn:r6004
2006-02-13 09:37:53 +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
6535087845 when building v2 statuses or v1 running-routers, don't admit the
existence of descriptors older than a day.

we still cache them in case anybody asks, but we don't actively
mention them.


svn:r5913
2006-02-05 02:33:40 +00:00
Nick Mathewson
bfe285be61 Add a missing printf arg
svn:r5861
2006-01-24 04:01:13 +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
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
Nick Mathewson
5c78c89471 Appease verbose gcc warning: make dirserv_compute_stable_uptime() static.
svn:r5792
2006-01-11 03:59:55 +00:00
Roger Dingledine
c8e6003412 balance the reachability testing so a smidgen of it happens
every 10 seconds. this way we don't try to do 500 tls's at
once every 20 minutes.


svn:r5763
2006-01-10 07:21:01 +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
5d709e8517 Fix bug in last commit. Also, fix bug 231: authorities should never treat their own descriptor changes as cosmetic.
svn:r5755
2006-01-08 21:33:15 +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
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
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
2efa056777 make the "stable" flag in network-status be the median of the uptimes
of running valid servers. that way the cutoff adapts to the stability
of the network as a whole.


svn:r5693
2006-01-02 03:32:55 +00:00
Nick Mathewson
89eded7b17 Add "panic" option to reject all servers not in fingerprint list.
svn:r5601
2005-12-15 21:39:38 +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
Nick Mathewson
24e79df0b6 Whitespace fixes; comments.
svn:r5596
2005-12-15 21:17:40 +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
27a201ac80 Have dirctory authorites note which servers make good V2 directory caches in publishe network-status.
svn:r5574
2005-12-12 01:03:28 +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
Roger Dingledine
a438f2abcd let the user configure a sockslistenaddress on other private IPs
besides 127.x.y.z without complaining.
and give a better message in the log.


svn:r5544
2005-12-09 02:46:46 +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
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
447a3a7ff2 Funny. I could have sworn that it compiled.
svn:r5467
2005-11-29 17:17:02 +00:00
Nick Mathewson
94e8dcef44 Fix a bug weasel found: when we are an authority and somebody requests "all" statuses, cconsider regenerating our own.
svn:r5466
2005-11-29 17:14:10 +00:00
Peter Palfrader
a48b722432 Ancient gcc does not like you when you declare variables in the middle of a block
svn:r5437
2005-11-20 16:53:49 +00:00
Peter Palfrader
b9d37a2d58 Add a new controller event type that allows controllers to get all
server descriptors that were uploaded to a router in its role as authoritative
dirserver.


svn:r5436
2005-11-19 18:35:43 +00:00