Commit Graph

599 Commits

Author SHA1 Message Date
Nick Mathewson
4fe76e7b6b Free named_server_map on shutdown.
svn:r8500
2006-09-25 16:06:39 +00:00
Nick Mathewson
bde5939ad3 r8909@Kushana: nickm | 2006-09-22 00:38:13 -0400
Consider changes to has_old_dnsworkers as noncosmetic


svn:r8464
2006-09-22 20:20:21 +00:00
Nick Mathewson
6b716fdfb9 NEEDS REVIEW. Act on previous comment, and handle named servers differently: now, we allow multiple servers with the same name in the routerlist even if that name is reserved, but we check whether names are reserved when we try to look up routers by nickname. This is a minor security fix. This makes router_add_to_routerlist O(1). This is a backport candidate.
svn:r8433
2006-09-19 23:48:14 +00:00
Nick Mathewson
5ebb949c9f Stop searching routerlist for routers with the same identity as other routers (on router insert): we already have a map for that. (We need to add an index field to routerinfo_t so we can figure out which point in the routerlist to replace.) Also, add a comment to routerlist.c; arma, please advise?
svn:r8432
2006-09-19 23:18:30 +00:00
Nick Mathewson
7b0ec744bc Switch routerlist.c to using memcmp on digests rather than crypto_pk_cmp_keys(); speed up find_whitespace a lot (8x for me) by using a switch statement. This should speed parsing a lot of routers at once by a lot.
svn:r8430
2006-09-19 22:20:09 +00:00
Nick Mathewson
65974f82fa r8839@Kushana: nickm | 2006-09-17 16:11:59 -0400
Add some client performance XXXXs; try to move some common case tests higher on their decision trees.


svn:r8410
2006-09-17 20:12:10 +00:00
Roger Dingledine
769f9201a6 Send out a burst of long-range drop cells after we've established that
we're reachable. Spread them over 4 circuits, so hopefully a few will
be fast. This exercises our bandwidth and bootstraps us quicker.


svn:r8399
2006-09-15 05:30:25 +00:00
Peter Palfrader
ba091ae5d7 r9770@danube: weasel | 2006-09-15 07:20:05 +0200
router_set_networkstatus() gets a list of status documents we asked for from
 connection_dir_client_reached_eof().  However, as a cache we (sometimes?) just
 ask for "all".  router_set_networkstatus() would freak out over that, meaning
 it would log a warning and drop the status document instead of caching it
 as it is supposed to.  Now we let router_set_networkstatus() know if the
 data comes from an all-request so it can do the right thing.


svn:r8398
2006-09-15 05:20:16 +00:00
Peter Palfrader
5beb114744 r9767@danube: weasel | 2006-09-15 06:27:48 +0200
Minor documentation fix


svn:r8397
2006-09-15 04:29:36 +00:00
Nick Mathewson
21a7880358 r8695@Kushana: nickm | 2006-08-31 14:35:36 -0400
Fix two corner cases in router_dir_info_changed().  This should have no observable effect.


svn:r8311
2006-08-31 18:46:46 +00:00
Roger Dingledine
94afe807ac stop a big memory leak: we were leaking the whole contents
of cached-routers.new every time we read it.


svn:r8236
2006-08-27 02:12:12 +00:00
Roger Dingledine
9f5856c03d stop three memory leaks. nick, fix these if i'm wrong.
svn:r8235
2006-08-27 02:07:54 +00:00
Roger Dingledine
6650470575 automatically avoid picking more than one node from the same
/16 network when constructing a circuit.


svn:r7068
2006-08-16 03:44:13 +00:00
Nick Mathewson
273ee3e814 r7392@Kushana: nickm | 2006-08-14 23:50:32 -0400
Only do the expensive version of router_have_minimum_dir_info() when the dir info has changed.  Backport candidate, since oprofile suggests that this function and ones it calls account for 25-35% of oprofile samples.


svn:r7062
2006-08-15 03:54:09 +00:00
Nick Mathewson
7c596c166b r7029@Kushana: nickm | 2006-08-04 14:08:41 -0700
Remove now-spurious size and data arguments from tor_mmap_file


svn:r6987
2006-08-05 17:53:21 +00:00
Nick Mathewson
bf72878cad r7012@Kushana: nickm | 2006-08-03 19:21:25 -0700
Add an "mmap handle" type to encapsulate bookkeeping elements of mmap issues; add prelim win32 impl


svn:r6980
2006-08-04 18:32:43 +00:00
Nick Mathewson
ec82db6995 r6909@Kushana: nickm | 2006-07-26 13:05:58 -0400
Clean up wide lines from last patch.


svn:r6907
2006-07-26 19:07:37 +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
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
Nick Mathewson
a7a1d4e3d3 First part of making mmap-based stuff work on win32: save descriptors as "binary" (no LF->CRLF tanslation) so that we can mmap them properly later. Patch from Frediano Ziglio.
svn:r6748
2006-07-09 22:28:12 +00:00
Roger Dingledine
c22c7b96f5 tab-man strikes again
svn:r6699
2006-06-28 15:39:02 +00:00
Nick Mathewson
8b08ab52fd Fix another idiot bug causing symptom 309. Why cant I program?
svn:r6698
2006-06-28 15:36:28 +00:00
Nick Mathewson
96bfefeeb6 Add a check to try to make cache rebuild fail fast if it is going to fail
svn:r6697
2006-06-28 11:03:34 +00:00
Nick Mathewson
4dac383f5a Aaand re-disable the bogus test in get_body()
svn:r6696
2006-06-28 08:57:41 +00:00
Nick Mathewson
d547ecc916 Make sure that our calculated offsets for routers is correct; again. This time bug 309 may be gone gone gone.
svn:r6695
2006-06-28 08:55:53 +00:00
Nick Mathewson
d3784ff1df Likely fix for bug 309: when we calculate offsets after rebuilding the descriptor cache, do not reset the offset pointer half-way through.
svn:r6693
2006-06-27 15:52:51 +00:00
Nick Mathewson
52b8dfa95a Fix a bunch of spaces.
svn:r6678
2006-06-22 07:25:15 +00:00
Nick Mathewson
58b05fc84d #if out test that was failing because of an extra newline.
svn:r6676
2006-06-22 07:10:37 +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
Nick Mathewson
b5c599412f Backport candidate: implement the "is this uptime change cosmetic" test properly.
svn:r6654
2006-06-18 16:05:54 +00:00
Roger Dingledine
30f6c57fd7 and forward-port too.
svn:r6573
2006-06-09 06:52:49 +00:00
Roger Dingledine
a91be49402 fix a bootstrapping check we ignored that prevents us from running
with only one dir authority.


svn:r6570
2006-06-09 02:45:39 +00:00
Roger Dingledine
bb18168fae ok, ok, maybe *this* time my rep_hist_circbuilding_dormant() will work.
svn:r6568
2006-06-08 22:36:13 +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
9000a5aff1 and get grammar right
svn:r6517
2006-05-30 06:19:48 +00:00
Roger Dingledine
ae2648fb1c stop fetching descriptors if we're not a dir mirror and we
haven't tried to establish any circuits lately.


svn:r6516
2006-05-30 06:19:06 +00:00
Roger Dingledine
60abe23158 tentative change: if you have your dirport set, you are a directory
mirror, whether or not your orport is set.


svn:r6513
2006-05-30 06:11:36 +00:00
Roger Dingledine
f579478687 correct a false log message, since we actually reset all our
downloading stats every hour, and sometimes more often.


svn:r6505
2006-05-26 16:29:20 +00:00
Roger Dingledine
295ad74fda Tor servers are also giving spurious "you're invalid" warnings.
This is because we get a lot of network statuses that don't list
us at all, and we conclude that they all think we're invalid.
The long-term fix is to get better logic, and the short-term fix
is to downgrade the log severity.


svn:r6448
2006-05-09 09:47:47 +00:00
Nick Mathewson
2b720b5746 Start remembering *where* we are storing routerdescs. This will make us easier to move from a RAM-mirrors-disk model to a RAM-caches-disk model, and save maybe around 10MB on a directory server.
svn:r6427
2006-04-29 18:42:26 +00:00
Nick Mathewson
15dbe02c04 shorten some too-wide lines
svn:r6426
2006-04-29 17:44:31 +00:00
Nick Mathewson
5bce102cd2 Only warn about a down node once
svn:r6420
2006-04-25 06:20:47 +00:00
Nick Mathewson
5f9612216c you wanted it spelled properly too? And me not even funded!
svn:r6418
2006-04-25 06:02:46 +00:00
Nick Mathewson
d6c04216ef fix a segfault in last bug-285-related commit.
svn:r6417
2006-04-25 05:59:31 +00:00
Nick Mathewson
c70f1e7eb3 Possible partial fix for 285; needs review
svn:r6414
2006-04-24 17:51:31 +00:00
Roger Dingledine
47d3e23155 note another bug: we complain that a router doesn't exist,
because it's down so we never fetched it so it doesn't exist.


svn:r6394
2006-04-17 06:46:20 +00:00
Roger Dingledine
34bc0866d4 slightly clearer log message when you use a nickname rather than
a key for an unnamed server.


svn:r6393
2006-04-17 06:43:27 +00:00
Roger Dingledine
3791d3daaa forward-port the n_named log severity downgrade.
svn:r6385
2006-04-14 20:19:33 +00:00
Peter Palfrader
beb9e0721a Stop assuming every authority is a v1 authority
svn:r6377
2006-04-10 21:29:29 +00:00
Roger Dingledine
f89b0ea09f be willing to add our own routerinfo into the routerlist.
this means authorities will include themselves in their
directories and network-statuses.


svn:r6369
2006-04-10 20:00:31 +00:00
Roger Dingledine
b190c451b8 and one more kick to consider all live network statuses for versions
svn:r6359
2006-04-10 08:40:16 +00:00
Roger Dingledine
a9e7737c3a consider all live network statuses we have when deciding whether
our version is bad. also, unfix one of the unbugs from before.


svn:r6358
2006-04-10 08:37:16 +00:00
Nick Mathewson
71f1a77371 fix bugs in compute_recommended_versions
svn:r6356
2006-04-10 08:02:56 +00:00
Roger Dingledine
acc2eb445d and get rid of an extra variable
svn:r6349
2006-04-10 05:48:04 +00:00
Roger Dingledine
ac2070b35b stop being so picky about when we can start building circuits.
now clients are more likely to have circuits up soon after their
tor starts.


svn:r6346
2006-04-10 05:44:54 +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
b6b534c9dd quiet a bootstrapping message
svn:r6342
2006-04-09 20:19:56 +00:00
Roger Dingledine
b18d20ce32 Here is an attempted fix for directory mirrors that are frozen
in fear because they don't have all the networkstatuses. There's
no reason not to proceed if all the other checks are ok -- we just
shouldn't warn about certain things yet.


svn:r6337
2006-04-09 10:10:09 +00:00
Roger Dingledine
a589650496 i like the name FetchUselessDescriptors better.
svn:r6327
2006-04-08 21:48:14 +00:00
Roger Dingledine
2a94c8b493 add a new config option FetchUselessRouters, off by default, for
when you plan to run "exitlist" on this client and you want to know
about even the non-running descriptors.


svn:r6326
2006-04-08 21:35:17 +00:00
Roger Dingledine
3a5758e212 If we think of ourselves as authoritative, even if we're not
in the DirServers config lines, then we still are. This way we
give ourselves the "Authority" flag in our network-status.


svn:r6325
2006-04-08 21:19:40 +00:00
Roger Dingledine
557b174b8d Break out the checks to see if a routerstatus is something we
would use. This way when we're deciding if we have "enough" descriptors
to start building circuits, we can count them accurately.


svn:r6320
2006-04-08 06:56:38 +00:00
Nick Mathewson
7a804572ab fix an infinite loop; answer a question
svn:r6316
2006-04-07 22:55:46 +00:00
Nick Mathewson
c6d010b218 Dont warn about our own status unless weve tried and failed 4 times (or succeeded) for each authority.
svn:r6315
2006-04-07 04:52:32 +00:00
Roger Dingledine
c4fb9d22cf if there's more than one match for router-get-my-nickname,
try to pick one that's running.


svn:r6313
2006-04-04 03:46:40 +00:00
Roger Dingledine
0825f61102 fix crash bug reported in flyspray 279.
svn:r6312
2006-04-04 03:25:36 +00:00
Roger Dingledine
453062b028 fix typo, remove extraneous variable
svn:r6311
2006-04-03 11:24:14 +00:00
Roger Dingledine
7198af7fbe one more edge case that could paralyze a client with fear
svn:r6310
2006-04-03 06:59:07 +00:00
Roger Dingledine
a324871603 phrase the threshold comparison in the way we've been
phrasing it. these are equivalent, right?


svn:r6309
2006-04-03 06:37:35 +00:00
Nick Mathewson
eba6204315 fix some xxxs.
svn:r6307
2006-04-03 06:23:24 +00:00
Roger Dingledine
2cb3aeb4e1 another point that needs more thinking
svn:r6306
2006-04-03 06:22:54 +00:00
Roger Dingledine
9549d81d95 two more thresholds to look at
svn:r6305
2006-04-03 06:10:33 +00:00
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