Commit Graph

476 Commits

Author SHA1 Message Date
Roger Dingledine
64a40b5137 nick: there *is* no MAX_SERVER_INTERVAL_WITHOUT_REQUEST. true?
svn:r6300
2006-04-03 02:20:32 +00:00
Nick Mathewson
4130460f8e Change networkstatus dl logic: try to have all networkstatuses live; insist on having all of them live or tried-at-least-once. Also, answer a XXXX comment.
svn:r6297
2006-04-02 23:02:52 +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
Nick Mathewson
685bceed1c Make the max number of old descriptors to hold rise with the number of authorities.
svn:r6254
2006-03-27 17:29:53 +00:00
Nick Mathewson
cd271dbca9 re-order to avoid free-then-use. Thank goodness tor_free() zeroes things.
svn:r6249
2006-03-27 05:27:47 +00:00
Nick Mathewson
c74bd877e2 Oops. We may not have a networkstatus list when we first parse the cached routers.
svn:r6248
2006-03-27 05:12:07 +00:00
Nick Mathewson
3e8c9a485f Fix for "but need_to_mirror=1" annoyance; is bug 273 fixed?
svn:r6247
2006-03-27 05:07:57 +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
e20aad8d46 remove obsolete address policy code
svn:r6243
2006-03-26 09:38:17 +00:00
Roger Dingledine
f2abd7a69b fix a wordo, don't be so quick to yell at servers, and ask a question.
svn:r6235
2006-03-24 21:11:14 +00:00
Peter Palfrader
444e3b8eb2 Note a magic 2 that probably should be replaced now that we have more dirservers
svn:r6232
2006-03-23 20:21:54 +00:00
Roger Dingledine
0d7efbe65d Note a vulnerability with our current recommended-version concensus
building.

Make the warnings about invalid and unnamed nodes scale better, and
update the text of the warnings.

Change router_have_minimum_dir_info() to only be happy when it has
enough network-statuses ("more than half") to be willing to actually
build circuits.

Not yet done: when we fail to get a networkstatus that we wanted, and
!router_have_minimum_dir_info(), we should retry it quicker than a whole
minute from now.


svn:r6227
2006-03-22 06:22:12 +00:00
Roger Dingledine
073d574a3f Point out a potential DoS flaw in caching untrusted network
statuses to disk. We should resolve sometime.


svn:r6206
2006-03-21 05:27:35 +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
67b61fe475 authdirs shouldn't complain about unreachability when they
fetch a descriptor from somebody else. this is not the right
time to increment the failure count.


svn:r6184
2006-03-18 05:37:15 +00:00
Roger Dingledine
581795f41d auth dir servers were only modifying a server's is_running field
when they created a network status. so if nobody asked for a
network status, they would never discover that any servers are
is_running, so they could never build a circuit.


svn:r6183
2006-03-18 01:24:04 +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
Roger Dingledine
817556315a Implement router purposes, and don't choose a non-general
purpose router when picking random nodes for a circuit.

Also implement SETROUTERPURPOSE and modify +POSTDESCRIPTOR.

This concludes bug 250 assuming it all works.


svn:r6178
2006-03-17 22:08:59 +00:00
Nick Mathewson
053411e827 Comments: cleanups and additions.
svn:r6174
2006-03-17 05:50:41 +00:00
Nick Mathewson
215e377224 Only warn about lack of name binding for self if we have tried downloading every networkstatus.
svn:r6172
2006-03-17 04:41:57 +00:00
Nick Mathewson
13cf54b9c1 Interim fix for 272: Only warn that we are not named if we have status docs from some naming authorities.
svn:r6166
2006-03-15 05:37:27 +00:00
Roger Dingledine
903183ea28 if we as a directory mirror don't know of any v1 directory
authorities, then don't try to cache any v1 directories.


svn:r6162
2006-03-15 00:10:13 +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
Nick Mathewson
bd8ffccae7 More cleanups noticed by weasel; also, remove macros that nobody uses.
svn:r6143
2006-03-12 23:31:16 +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
c8e2a051ac huge warning sign for esc_router_info()
svn:r6124
2006-03-11 17:52:55 +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
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