Commit Graph

454 Commits

Author SHA1 Message Date
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
Roger Dingledine
3b6ab71929 and notify the dirserver operator whenever we do
svn:r4890
2005-08-31 06:18:19 +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
Nick Mathewson
cd2bb915ed Fix a warning, add an assert.
svn:r4875
2005-08-26 23:12:13 +00:00
Nick Mathewson
70fe2a6cee Crashing dirservers on startup is often considered bad form.
svn:r4874
2005-08-26 23:04:12 +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
Roger Dingledine
715b972300 disarm a trap
svn:r4859
2005-08-26 21:12:53 +00:00
Nick Mathewson
47669fa0fd Fix assert failure on directory startup.
svn:r4858
2005-08-26 21:12:34 +00:00
Nick Mathewson
0e649ac60a Remove descriptor_list and use routerlist instead. Make directories manage routerlist a little better.
svn:r4854
2005-08-26 20:59:04 +00:00
Nick Mathewson
7f78be1659 Clean up the "add myself as a trusted dirserver" code.
svn:r4849
2005-08-26 19:31:51 +00:00
Nick Mathewson
43488472ec The circus music begins playing as nickm and arma juggle an ntohl. Hoop-lah!
svn:r4848
2005-08-26 19:25:36 +00:00
Nick Mathewson
ee76baae3d move a wandering ntohl
svn:r4847
2005-08-26 19:23:52 +00:00
Roger Dingledine
893acb3acc Make a new AssumeReachable config option that will publish anyway.
Also, let authdirservers start without setting their Address field.
Something is still not working though. Will fix in morning.


svn:r4839
2005-08-26 07:41:19 +00:00
Roger Dingledine
5e76bac1dd the tor-spec says router->address must be an IP address. so refuse
it if it's not.
(this also fixes some potential security problems with people providing
hostnames as their address and then preferentially resolving them and
partitioning users.)


svn:r4790
2005-08-16 02:52:27 +00:00
Roger Dingledine
f57d062d9c Implement exit enclaves: if we know an IP address for the destination,
and there's a running Tor server at that address which allows exit to
the destination, then extend the circuit to that exit first.
Also, if the user asks for a .exit node, cannibalize general circs for it.


svn:r4779
2005-08-15 03:25:40 +00:00
Roger Dingledine
2caa74e6ff quiet a noisy debug
svn:r4762
2005-08-12 00:34:50 +00:00
Nick Mathewson
249b72f53e Replace (Fascist)Firewall* with a new ReachableAddresses option that understands address policies.
svn:r4751
2005-08-08 21:58:48 +00:00
Nick Mathewson
01d0788950 Generalize FirewallPorts to FirewallIPs so I can run happily when locked in net 18.
svn:r4737
2005-08-07 21:24:00 +00:00
Nick Mathewson
18c11eb3bc Be consistent about preferring foo* to struct foo*
svn:r4637
2005-07-22 21:12:10 +00:00
Nick Mathewson
2cff73e7a4 Make "Couldnt add router to list" message more descriptive. Make messages consistenly punctuated.
svn:r4582
2005-07-15 19:40:38 +00:00
Roger Dingledine
545c2c6c87 the other half of the bugfix: tolerate a trusted dirserver claiming
dirport 0 in its descriptor.


svn:r4576
2005-07-15 18:56:59 +00:00
Roger Dingledine
055477f121 fix compile error (and likely a a crash bug in resolves)
svn:r4514
2005-07-01 01:59:37 +00:00
Roger Dingledine
6b21c8e74f make the local and private network masks explicit when we complain
svn:r4501
2005-06-29 19:15:23 +00:00
Roger Dingledine
9c67ae34f1 overall cleanup and streamlining and doccing
also fix a DoS avenue on dirservers


svn:r4468
2005-06-20 23:04:13 +00:00
Nick Mathewson
232861ba42 Docment or add DOCDOC comments to undocumented functions in src/or. Make function definition format uniform.
svn:r4411
2005-06-11 18:52:12 +00:00
Roger Dingledine
fcd0fc3364 flesh out the source file descriptions for doxygen
svn:r4404
2005-06-11 05:31:17 +00:00
Nick Mathewson
0831823763 Change end-of-file NLNL convention. It turns out arma I and I agree.
svn:r4382
2005-06-09 19:03:31 +00:00
Nick Mathewson
a6f51001a5 New whitespace normalization rule: no blank line at EOF.
svn:r4378
2005-06-09 16:46:51 +00:00
Roger Dingledine
0fa1890e0e fix the assumption that uninitialized variables are 0
clean up router_load_single_router() more


svn:r4266
2005-05-18 03:52:07 +00:00
Roger Dingledine
fe78aac027 fix seg faults when router_load_single_router fails
svn:r4265
2005-05-18 03:42:46 +00:00
Roger Dingledine
b7d6b8a397 doxygeny goodness from tyranix
svn:r4262
2005-05-17 17:01:36 +00:00
Roger Dingledine
07230a698c if router_resolve fails on the descriptor the controller
gives us, we shouldn't leave the routerinfo in the list.


svn:r4205
2005-05-14 05:01:41 +00:00
Nick Mathewson
00f2a09380 Append default exit policy before checking for implicit internal addresses: fix bug 129.
svn:r4201
2005-05-14 00:13:17 +00:00
Nick Mathewson
3893b3c7ac Patch for task 133
svn:r4189
2005-05-10 22:33:45 +00:00
Roger Dingledine
cee7c5988c fix massive memory leak
(50 megabytes over a couple of days, on the dirservers)


svn:r4181
2005-05-06 08:53:23 +00:00
Nick Mathewson
69dc4e1675 Remove support for looking at old directory/routerdesc elements; mark non-new elements optional; switch to new format for dir-signing-key; start accepting newer elements so we can mark them as non-opt later; make tor-spec say the right stuff.
svn:r4154
2005-05-02 21:22:31 +00:00
Roger Dingledine
769541ff7e be willing to load balance over up to 2mB, not 1mB, of advertised capacity
svn:r4080
2005-04-12 22:09:47 +00:00
Roger Dingledine
716d9bc99a when using preferred entry or exit nodes, ignore whether
the circuit wants uptime or capacity. they asked for the
nodes, they get the nodes.


svn:r4025
2005-04-06 06:17:35 +00:00
Nick Mathewson
1aedf3daf5 Only warn once per nickname from add_nickname_list_to_smartlist per failure.
svn:r3997
2005-04-03 05:53:34 +00:00
Nick Mathewson
4a90d37229 Better messages when POSTDESCRIPTOR fails
svn:r3989
2005-04-02 22:02:13 +00:00
Nick Mathewson
0e81265359 update copyright notices.
svn:r3982
2005-04-01 20:15:56 +00:00
Roger Dingledine
e786e5dedb when building testing circuits, always use middle hops
running at least 0.0.9.7


svn:r3966
2005-04-01 08:42:26 +00:00
Roger Dingledine
35953edae0 Implement controller's "extendcircuit" directive.
Also refactor circuit building so we plan the whole path ahead
of time.


svn:r3797
2005-03-22 00:42:38 +00:00
Nick Mathewson
b88c4ba11c Turn addr_policy_compare from a tristate to a quadstate; this should help address our "Ah, you allow 1.2.3.4:80. You are a good choice for google.com" problem.
svn:r3786
2005-03-19 06:57:16 +00:00
Nick Mathewson
df9c8feac7 Commit fixes for several pending tor core tasks: document all DOCDOCed functions; time out uncontrolled unattached streams; feed reasons to SOCKS5 (refactoring connection_ap_handshake_socks_reply in the process); change DirFetchPeriod/StatusFetchPeriod to have a special "Be smart" value.
svn:r3769
2005-03-17 12:38:37 +00:00
Nick Mathewson
f90ccf5648 Implement new controller events for changed descriptors and new (not-yet-attached) streams.
svn:r3731
2005-03-02 22:29:58 +00:00
Nick Mathewson
c5091e7134 When copying routerinfo, copy descriptor too to prevent later double-free.
svn:r3711
2005-02-28 03:37:27 +00:00
Roger Dingledine
a1f1fa6ab2 Checkpoint in-progress fixes:
Add 'testing' circuit purpose, for reachability testing.
Notice when our IP changes, and reset stats.
Try to pull down a directory via Tor to see if our DirPort is working.
Try to extend a circuit back to us to see if our ORPort is working.
Only publish a descriptor if they're both reachable.

These mostly work, and I'd better get them in before I cause conflicts.


svn:r3703
2005-02-27 09:47:01 +00:00
Nick Mathewson
8efb2a957d Make sure that router_get_by_* can always return "me"
svn:r3702
2005-02-27 07:23:42 +00:00
Nick Mathewson
bbaa3c7792 Implement more control spec functionality
- Mapaddress
- Postdescriptor
- GetInfo on descriptors

Required changes elsewhere:
- Keep the most recent running_routers_t in the routerlist_t. That way we
  can learn about new routers and remember whether we were last told that
  they were up or down.  Also enables more simplifications.
- Keep the signed descriptor inside routerinfo_t.  This makes
  descriptor_entry_t in dirservers.c unneeded.
- Rename AddressMap (the verb) to MapAddress. Keep AddressMap as a noun.
- Check addresses for plausibility before mapping them.


svn:r3696
2005-02-25 20:46:13 +00:00
Roger Dingledine
6329811a88 fix a seg fault from tor_free_all
svn:r3690
2005-02-24 23:01:26 +00:00
Nick Mathewson
60f234f42b Add more functions to free things to help dmalloc allong.
svn:r3613
2005-02-10 23:18:39 +00:00
Roger Dingledine
236aa86ae7 stop picking unverified dir mirrors, ever.
it only leads to misery.


svn:r3610
2005-02-10 07:00:23 +00:00
Roger Dingledine
1447145470 give a bit more load to servers that claim to be able to
handle a whole lot.


svn:r3489
2005-02-01 02:56:31 +00:00
Roger Dingledine
d273891107 if we fetch the dir from a mirror that has a wildly skewed
clock, then don't bother checking recommended-versions: it will
just make us sad.

as a side effect, people running obsolete versions and whose
clocks are wildly skewed will not be auto-shut-down. but they
will still get warns about their clock skew.


svn:r3459
2005-01-29 11:48:37 +00:00
Nick Mathewson
8115ca5f99 Log the offending policy, not the first policy
svn:r3394
2005-01-20 20:42:45 +00:00
Nick Mathewson
129e754ae4 Warn when exit policy implicitly allows local addresses.
svn:r3383
2005-01-20 18:39:48 +00:00
Roger Dingledine
0aff4ff4cb get rid of 0.0.8 backwards compatibility
svn:r3353
2005-01-13 20:22:38 +00:00
Roger Dingledine
84c81e0783 Annotate circuits w/ whether they aim to contain high uptime nodes and/or
high capacity nodes. When building circuits, choose appropriate nodes.

New config option LongLivedPorts to indicate application streams
that will want high uptime circuits.

When attaching a stream to a circuit, pay attention to its requirements.

This means that every single node in an intro rend circuit, not just
the last one, will have a minimum uptime.

Boost the min uptime from an hour to 24 hours.


svn:r3339
2005-01-12 04:58:23 +00:00
Nick Mathewson
91bafc476e Fix a fun bug: do not rewrite a cached directory back to the cache; otherwise we will think it is recent and not fetch a newer one.
svn:r3319
2005-01-06 20:11:52 +00:00
Nick Mathewson
0c4186d6ee Use correct logic to decide whether there are more directory servers to retry.
svn:r3257
2005-01-03 20:51:24 +00:00
Nick Mathewson
fca7ba9777 Resolve task 42: find where 19-char nicknames were getting truncated when read from certs, and fix it. Also audit use of MAX_NICKNAME_LEN; no other badness found, but some docs/code cleaned up a touch.
svn:r3244
2005-01-03 17:53:20 +00:00
Roger Dingledine
95f3e6161b require BandwidthRate to be at least 10kB/s
svn:r3232
2004-12-31 21:47:54 +00:00
Roger Dingledine
5d961c2c06 plug another memory leak
svn:r3104
2004-12-07 08:51:10 +00:00
Roger Dingledine
ef6c9d18e7 New circuit building strategy: keep a list of ports that we've used in the past 6 hours, and always try to have 2 circuits open or on the way
that will handle each such port. (We can extend this to include addresses
if exit policies shift to require that.) Seed us with port 80 so web
browsers won't complain that Tor is "slow to start up".

This was necessary because our old circuit building strategy just involved
counting circuits, and as time went by we would build up a big pile of
circuits that had peculiar exit policies (e.g. only exit to 9001-9100)
which would take up space in the circuit pile but never get used.

Fix router_compare_addr_to_addr_policy: it was not treating a port of *
as always matching, so we were picking reject *:* nodes as exit nodes too.

If you haven't used a clean circuit in an hour, throw it away, just to
be on the safe side.

This means after 6 hours a totally unused Tor client will have no
circuits open.


svn:r3078
2004-12-05 07:10:08 +00:00
Roger Dingledine
02b3229a04 plus add a comment re: the previous bug
svn:r3076
2004-12-04 10:18:41 +00:00
Roger Dingledine
52676364b9 bugfix: router_exit_policy_rejects_all() was broken, so we were
sometimes picking middleman nodes as our last hop, which wasn't
very useful.


svn:r3075
2004-12-04 08:56:59 +00:00
Nick Mathewson
fc87758ff3 Add function to check that addr_policy_t is okay; change struct addr_policy_t to addr_policy_t.
svn:r3070
2004-12-04 01:14:36 +00:00
Nick Mathewson
b457cfb5eb Spell-check strings and comments
svn:r3052
2004-12-01 03:48:14 +00:00
Nick Mathewson
7fbd297532 Suggestion from weasel: Make tor --version --version dump the cvs Id of every file.
svn:r3019
2004-11-29 22:25:31 +00:00
Nick Mathewson
aff5122685 Fetch cached running-routers from servers that serve it (that is, authdirservers, and servers running 0.0.9rc5-cvs or later.)
svn:r3018
2004-11-29 21:01:34 +00:00
Roger Dingledine
22727b4edc wrong is ok, and right is fine, but in between is apparently
totally unacceptable to me.


svn:r3005
2004-11-28 11:39:53 +00:00
Nick Mathewson
6f5dbefa7e Normalize space: add one between every control keyword and control clause.
svn:r3003
2004-11-28 09:05:49 +00:00
Roger Dingledine
7c9a707900 remove emacs droppings, since nick says he doesn't need them anymore
svn:r2989
2004-11-26 04:00:55 +00:00
Nick Mathewson
f91152ce6a Clarify a bunch of log messages
svn:r2983
2004-11-25 04:20:10 +00:00
Roger Dingledine
63353462f8 if your requested exit node has bandwidth 0, pick it anyway
svn:r2920
2004-11-20 12:41:05 +00:00
Roger Dingledine
50c15943a2 move second stat to a cleaner place
svn:r2890
2004-11-15 09:22:01 +00:00
Roger Dingledine
5dcc6fd8b2 ok ok the stat wasn't redundant
but the warn was


svn:r2852
2004-11-14 13:35:39 +00:00
Roger Dingledine
4564367b2a Remove redundant stat() for reading cached directory, and remove
confusing warn when the cached directory isn't there yet.


svn:r2847
2004-11-14 09:40:07 +00:00
Nick Mathewson
5109de5626 Rename exit_policy to addr_policy, since it gets used for SOCKS and directory connections too. Make all policies get validated in options_validate, and make SOCKS/directory policies get set in options_act.
svn:r2819
2004-11-12 19:39:13 +00:00
Nick Mathewson
5a5be93f80 Normalize whitespace; add a "tell me about all the unnormalized whitespace" target; fix a braino in dirserv.c
svn:r2758
2004-11-09 20:04:00 +00:00
Nick Mathewson
7daab4034d Fix windows build for VC6; centralize newline-fiasco-damage-control logic
svn:r2756
2004-11-09 19:13:08 +00:00
Nick Mathewson
a2079c074f Add some documentation to routerlist
svn:r2753
2004-11-09 17:14:15 +00:00
Roger Dingledine
3ce3d6eead resolve a 64-bit warning
svn:r2750
2004-11-09 11:36:38 +00:00
Roger Dingledine
6521c2ce51 Stop using the wrong DataDirectory when we're validating.
Also validate/normalize the DataDirectory better.


svn:r2732
2004-11-09 07:05:53 +00:00
Roger Dingledine
394554cfbf Clean up copyrights.
Break connection_consider_empty_buckets() out of
connection_read_bucket_decrement().


svn:r2698
2004-11-07 01:33:06 +00:00
Roger Dingledine
6c61ed4fb5 Make options no longer a global variable.
Now we can try setting an option but back out if it fails to parse, or
  if it's disallowed (e.g. changing RunAsDaemon from 1 to 0).
Use parse_line_from_str rather than parse_line_from_file.


svn:r2692
2004-11-06 05:18:11 +00:00
Roger Dingledine
2ba3a9de16 make the default default options.FirewallPorts be the default
svn:r2683
2004-11-04 23:39:57 +00:00
Roger Dingledine
f7a30fa73e break out validate_options
leave options.FirewallPorts NULL if it's NULL


svn:r2673
2004-11-04 10:23:30 +00:00
Nick Mathewson
451f8b5045 - Implement all of control interface except authentication, setconfig,
and actually making the sockets.
- Make sure that identity-based nicknames start with $.
- Use new string_join interface.


svn:r2661
2004-11-03 18:33:07 +00:00
Roger Dingledine
e541319dcb lay the groundwork for a default value for each config option.
tolerate null exitnodes, entrynodes, etc config options.


svn:r2655
2004-11-03 10:08:44 +00:00
Nick Mathewson
ad4dc74482 Use a stricter set of warnings; make them all pass.
svn:r2645
2004-11-02 03:02:17 +00:00
Nick Mathewson
11d330be5e Tweaks to prevent obsolete restarting tors from hammering the dirservers. (1) Cache a received directory as soon as the signature checks out. (2) Treat a cached directory as "recent" based on its mtime. (3) If we have a recent directory, we dont need to fetch a newer one for DirFetchPostPeriod. This needs review!
svn:r2618
2004-10-28 18:37:52 +00:00
Nick Mathewson
2fbf31533b Tricksy compiler warnings! We hates them, hates them forever, my precious!
svn:r2615
2004-10-27 21:14:11 +00:00
Nick Mathewson
6980929e64 Use strlcpy, not strcpy.
svn:r2610
2004-10-27 06:48:16 +00:00
Nick Mathewson
44d4516155 Use tor_snprintf, not snprintf
svn:r2609
2004-10-27 06:37:34 +00:00
Nick Mathewson
bc62f8e983 Replace sprintf with snprintf
svn:r2602
2004-10-27 05:53:07 +00:00
Nick Mathewson
b90b2bb848 Add and document router-status line using new unified liveness/verifiedness format; continue to generate running-routers; continue to parse running-routers when no router-status line is found
svn:r2592
2004-10-27 00:48:51 +00:00
Nick Mathewson
e5049d5aa3 Remove routerinfo_t->is_trusted_dir, and all the twisted machinery used to
maintain it.

Have clients default to the nickname "client" in their certificates.

Give a less frightening warning on obsolete (pre-0.0.8) routerinfo_t's.


svn:r2568
2004-10-19 18:19:59 +00:00
Roger Dingledine
97a0a43511 start the process of making 0.0.7* obsolete
svn:r2565
2004-10-17 21:51:20 +00:00
Nick Mathewson
56a592dbe3 Fix memory leak
svn:r2535
2004-10-16 08:39:56 +00:00
Nick Mathewson
9d5831341e Implement user-declared node families.
svn:r2534
2004-10-15 20:52:09 +00:00
Nick Mathewson
28dd458eaf Upload to trusted dir servers based on DirServer config options, not on routerinfos.
svn:r2529
2004-10-15 19:04:38 +00:00
Nick Mathewson
88e0c080cf Ignore fascistfirewall when dealing with service descriptors; obey fascistfirewall when posting server descriptors; ignore fascistfirewall on directory connections when httpproxy is set.
svn:r2527
2004-10-15 04:57:36 +00:00
Nick Mathewson
ff38cc06e1 Fix search-and-replace in comments: Friends->family does not imply friendship->familyhip.
svn:r2525
2004-10-15 03:55:53 +00:00
Nick Mathewson
7fa5d224d4 Implement "families" of coadministered nodes; prevent them all from appearing on the same circuit.
svn:r2523
2004-10-15 01:58:11 +00:00
Nick Mathewson
bd10bf4b5b Try to always dtrt if routerlist==NULL
svn:r2489
2004-10-14 03:44:45 +00:00
Roger Dingledine
89280e6c20 rename addr to address to we avoid this bug later
svn:r2488
2004-10-14 03:31:40 +00:00
Roger Dingledine
aebc3a03ba more int to size_t conversions, fixing one or more amd64 bugs
plus a whitespace patch on config.c from vicman


svn:r2482
2004-10-14 02:47:09 +00:00
Nick Mathewson
92bb360ad7 Add missing line; add similar check
svn:r2481
2004-10-14 02:29:03 +00:00
Nick Mathewson
0d5a847f12 Remove need for dirservers file: now, we note trusted dirservers in configuration options, and only need to remember addr:port and key digest for each one.
svn:r2479
2004-10-14 01:44:32 +00:00
Nick Mathewson
30dd1c87a5 Add default trusted-dir-server entries only when no dirserver lines are given in the config file
svn:r2467
2004-10-13 19:56:42 +00:00
Nick Mathewson
df3098367c Make directories get generated properly again; debug key lookup. Also, it is hard to find entries in a table when you never put them there.
svn:r2462
2004-10-13 18:28:39 +00:00
Nick Mathewson
0068415b80 Add an implementation of trusted_dir_server logic to switch towards simply remembering an addr/port/keyid for each trusted dir server
svn:r2443
2004-10-12 15:55:20 +00:00
Nick Mathewson
c7e8c2098a Include a dir-signing-key token in directories to tell the parsing entity which key is being used to sign. This is the first step in obsoleting the dirservers file.
svn:r2428
2004-10-07 21:10:40 +00:00
Nick Mathewson
dad7c71686 Workaround for bug on windows where cached-directories get crlf corruption.
svn:r2426
2004-10-07 20:22:58 +00:00
Roger Dingledine
8b02610bd5 when an OR starts up, it loads its directory from cache.
then it serves *that directory* to others who ask for a copy of the
directory. it's better to serve no directory at all until you have a
fresh copy.


svn:r2418
2004-10-06 05:05:43 +00:00
Nick Mathewson
9e8ae9766e Only check versions against downloaded directories, not cached directories.
svn:r2413
2004-10-03 02:37:52 +00:00
Roger Dingledine
136d4e5739 prefer tor_free to free
plus complain more loudly when we fail to parse a dir we just fetched


svn:r2401
2004-09-29 06:52:36 +00:00
Roger Dingledine
a31ba30ae6 if our local cached directory is new enough, go ahead and
start building circuits while we're fetching a new one


svn:r2394
2004-09-28 23:27:41 +00:00
Nick Mathewson
11384b6d92 Make sure that routerlists contain only routers; give a better error message if they start with a nonrouter.
svn:r2393
2004-09-28 22:49:34 +00:00
Nick Mathewson
0c653e5cc7 cached-directory has a directory, not a router list
svn:r2392
2004-09-28 22:43:11 +00:00
Roger Dingledine
4b3001a08c fix some local buffer overflows
fix a memory leak


svn:r2391
2004-09-28 22:38:21 +00:00
Roger Dingledine
ff622786f1 slightly better warn message
svn:r2357
2004-09-21 17:14:47 +00:00
Nick Mathewson
431b33a2ca Warn the user when we mark ourself as down.
svn:r2356
2004-09-21 16:44:20 +00:00
Roger Dingledine
959199340a don't pick administrative-friends when picking your path
(just a skeleton for now)


svn:r2349
2004-09-10 21:40:29 +00:00
Nick Mathewson
0ef85f6dba Some platforms have weird translations when you open files in "test" mode; make read/write_str_to_file aware.
svn:r2336
2004-09-08 07:16:34 +00:00
Nick Mathewson
c66e4c4870 Flush more changes from sandbox
- make clients cache directories and use them to seed their router lists
   at startup.  This means clients have a datadir again.
 - Introduce a global_write_bucket.  We need to respond better to exhausting
   it.
 - Remove the last vestiges of LinkPadding and TrafficShaping.
 - Configuration infrastructure support for warning on obsolete options.
 - Refactor directory header parsing to use smartlist_split_string.
 - Respond to content-encoding headers by trying to uncompress as appropriate.
 - Reply with a deflated directory when a client asks for "dir.z".
   (We could use allow-encodings instead, but allow-encodings isn't
   specified in HTTP 1.0.)


svn:r2335
2004-09-08 06:52:33 +00:00
Nick Mathewson
bda41ba3fd Use new split function and strcmpstart correctly
svn:r2327
2004-09-02 18:39:59 +00:00
Roger Dingledine
79df0aa18a when picking unverified routers, skip those with bad uptime or
bad bandwidth, depending on what properties you care about


svn:r2302
2004-08-20 21:34:36 +00:00
Roger Dingledine
8ddc029d07 if options.FascistFirewall but none are running on port 80, try
the others before giving up.


svn:r2293
2004-08-18 21:13:58 +00:00
Roger Dingledine
b500104cbe tolerate old 0.0.7 clients that demand a certain ip:port for a router
even though it's moved on to another one.

also reduce some log verbosity.


svn:r2288
2004-08-18 11:20:15 +00:00
Roger Dingledine
3937ecfaae when we try to exclude our routerinfo from being picked in the
path, it fails because we're using a pointer to the routerinfo we
generate, not a pointer to the routerinfo in the routerlist. so look
up the right one and use that.


svn:r2286
2004-08-18 10:32:50 +00:00
Roger Dingledine
b885db033e remove crazy notion that clique_mode() means we are
already connected to everybody we could be connected to.


svn:r2283
2004-08-18 09:07:11 +00:00
Roger Dingledine
6d661d1bc0 bugfix: make intro circuits work again
svn:r2280
2004-08-18 07:53:43 +00:00
Roger Dingledine
b294a037a4 choose exit nodes by bandwidth too
svn:r2274
2004-08-18 06:10:12 +00:00
Roger Dingledine
aa1e518446 when a verified routerinfo arrives with a new key than the previous
verified routerinfo with that name, close connections to the obsolete
key to make way for connections to the new key.


svn:r2257
2004-08-17 08:00:23 +00:00
Roger Dingledine
9e5fc55564 now that we parse router->uptime, make use of it
svn:r2251
2004-08-17 06:42:30 +00:00
Roger Dingledine
ee23b7a470 use unverified routers in the desired positions
svn:r2249
2004-08-17 06:27:32 +00:00
Nick Mathewson
590cd621f8 Clean up last patch; implement (mostly) proper handling for verified/unverified name collisions.
svn:r2248
2004-08-17 06:06:05 +00:00
Roger Dingledine
76eadc6f0a if a router claim huge bandwidth, don't believe it
svn:r2245
2004-08-17 02:00:36 +00:00
Nick Mathewson
0b91fd1cbe Add a generic Comma-separated-value config type, and a FirewallPorts option to tell FascistFirewall which ports are open. (Defaults to 80,443)
svn:r2244
2004-08-16 20:47:00 +00:00
Nick Mathewson
416653271a Implement strict{entry|exit}nodes config options
svn:r2236
2004-08-15 20:14:44 +00:00
Roger Dingledine
cd3da3fc12 o clients choose nodes proportional to advertised bandwidth
o and/or while avoiding unreliable nodes, depending on goals
o 'fascistfirewall' option to pick dirservers on port 80 and ORs on
  port 443.
o if a begin failed due to exit policy, but we believe the IP should                       have been allowed, switch that router to exitpolicy reject *:* until                     we get our next directory.


svn:r2231
2004-08-15 08:15:12 +00:00
Roger Dingledine
b2c7b5adfb fix a race condition in 008pre2: don't try to extend onto a connection
that's still handshaking.

for servers in clique mode, require the conn to be open before you'll
choose it for your path.


svn:r2198
2004-08-08 10:32:36 +00:00
Roger Dingledine
fb4b804c2c Don't warn about being unverified if you're not in the running-routers
list at all.


svn:r2193
2004-08-07 09:01:56 +00:00
Nick Mathewson
bc24c3f47d Allow multiple ORs with same nickname in routerlist
svn:r2187
2004-08-07 03:38:07 +00:00
Roger Dingledine
810ebc80d0 be willing to expire routers that have a dirport open
it's just the authoritative dirservers we want to not forget


svn:r2173
2004-08-06 22:47:41 +00:00
Roger Dingledine
e95ae1c9ad let purging routerinfos and descriptors take an age argument
svn:r2171
2004-08-06 22:15:25 +00:00
Nick Mathewson
78f12ffcca Bugfix: "Okay, I just shut down like you told me. Now let me verify your signature." Also fix error message when running over-new version.
svn:r2135
2004-08-04 02:35:06 +00:00
Roger Dingledine
a939796919 put a comment by routerlist_update_from_runningrouters() to
remind me that it's not used yet


svn:r2132
2004-08-04 01:25:21 +00:00
Roger Dingledine
a328aab316 clean whitespace and tabs
svn:r2115
2004-07-22 23:21:12 +00:00
Nick Mathewson
1391eafe67 Chek for overlong nicknames in add_nickname_list_to_smartlist
svn:r2109
2004-07-22 21:36:03 +00:00
Nick Mathewson
7b4865ec33 Add notion of "longest nickname-or-hex-digest-with-$"
svn:r2108
2004-07-22 21:31:04 +00:00
Nick Mathewson
0c990259de Add noisy debug log to hunt for bug in router_update_status_from_smartlist
svn:r2107
2004-07-22 21:20:23 +00:00
Nick Mathewson
33fe5e362f Never use time(NULL) as assumed publication time for a directory.
svn:r2105
2004-07-22 20:30:02 +00:00
Roger Dingledine
b48cdc9d40 populate router_get_my_routerinfo()->is_verified
svn:r2097
2004-07-22 06:03:53 +00:00
Roger Dingledine
ce7fcd110c solve the authdirserver initialization precedence problem
svn:r2085
2004-07-21 18:53:56 +00:00