Commit Graph

274 Commits

Author SHA1 Message Date
Roger Dingledine
3c6b6a53a9 and another
svn:r2727
2004-11-09 06:03:20 +00:00
Roger Dingledine
5c2278aea8 fix some dereferences
svn:r2726
2004-11-09 05:59:22 +00:00
Roger Dingledine
ef6bdd6c1e make datadirectory work again
svn:r2724
2004-11-09 05:35:49 +00:00
Nick Mathewson
2677395aaf Normalize DataDirectory in options_validate, making SIGHUP survivable.
svn:r2722
2004-11-09 05:26:49 +00:00
Nick Mathewson
a5903b737a Document accounting
svn:r2721
2004-11-09 05:18:15 +00:00
Nick Mathewson
929b172955 Stop DataDirectory from changing; also stop using new as an identifier?
svn:r2717
2004-11-09 04:46:24 +00:00
Roger Dingledine
90b47172bd Make an options_act() where we do all the things a new options set
needs.
Still needs more work.


svn:r2716
2004-11-09 04:28:18 +00:00
Roger Dingledine
3805221262 stop breaking the get_options() abstraction in config.c
svn:r2715
2004-11-09 02:12:55 +00:00
Roger Dingledine
8c7b2ff7ed various fixes
svn:r2712
2004-11-09 01:24:10 +00:00
Nick Mathewson
cb5de85585 Separate validate from activate. Document undocumented stuff in config.c.
svn:r2711
2004-11-08 23:12:40 +00:00
Nick Mathewson
f9c85c4d1c Make set-option functions distinguish between bad keys and bad values, in case the caller cares
svn:r2707
2004-11-07 22:59:30 +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
53a2b22742 fix the next subtle memory-crunching bug
now hup works


svn:r2696
2004-11-06 08:55:22 +00:00
Roger Dingledine
e2e6d19e76 fix subtle bug that was causing logs to not show anything
svn:r2695
2004-11-06 07:40:20 +00:00
Roger Dingledine
28a297ebe7 only play the accounting game if it's possible you'll choose to hibernate
svn:r2694
2004-11-06 06:56:28 +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
Nick Mathewson
f490e5cdb6 Update log documentation
svn:r2691
2004-11-05 21:22:38 +00:00
Nick Mathewson
2e8353e2f4 Use new log format; convert old format to new format.
svn:r2684
2004-11-05 05:50:35 +00:00
Roger Dingledine
2ba3a9de16 make the default default options.FirewallPorts be the default
svn:r2683
2004-11-04 23:39:57 +00:00
Nick Mathewson
1b49198081 Support code for resettable options, and option sets. Still needs validate-and-then-replace logic
svn:r2679
2004-11-04 22:31:50 +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
Roger Dingledine
cadbae6aa5 make free_options() and init_options() use the big array.
also remove obsolete config_assign_defaults().


svn:r2672
2004-11-04 08:26:34 +00:00
Roger Dingledine
59453ac6ef add a ControlPort and control listener conn.
note that print_usage is obsolete.


svn:r2671
2004-11-04 06:41:49 +00:00
Nick Mathewson
b74b72a5ce Fix windows build
svn:r2670
2004-11-04 04:01:19 +00:00
Roger Dingledine
d0c158c8d6 clarify the bandwidthburst and bandwidthrate are in bytes
(niels had thought they were in bits, or kb, or something)


svn:r2669
2004-11-04 03:25:43 +00:00
Roger Dingledine
a4753283dd better interface for connection_ap_handshake_socks_reply()
make --list-fingerprint print the fingerprint again


svn:r2668
2004-11-03 23:13:28 +00:00
Nick Mathewson
cea9125d71 Implement two flavors of authentication for control connections: one for trusted FS, one for untrusted FS.
svn:r2664
2004-11-03 19:49:03 +00:00
Nick Mathewson
86ba00290b Add function to generate/copy the config_lines, given the name of an option
svn:r2660
2004-11-03 18:29:29 +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
8db0abb687 First attempt at hibernation code. It needs more work around the XXXXs, but first I want arma to review the basic approach while I meditate on how to fix them.
svn:r2649
2004-11-02 23:47:32 +00:00
Roger Dingledine
282816b498 change min required number of fd's to 1024
svn:r2636
2004-11-01 08:09:59 +00:00
Nick Mathewson
9510d9a792 tor --list-fingerprint to print fingerprint and exit
svn:r2627
2004-10-30 19:18:37 +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
6874c39904 Fix windows build
svn:r2613
2004-10-27 18:14:38 +00:00
Nick Mathewson
c5eb95b644 Add ability for some-but-not-all abbrevs to work in config file. Add a bunch of singular/plural abbrevs suggested by arma
svn:r2612
2004-10-27 17:37:01 +00:00
Nick Mathewson
5369ee921e Make it compile on Linux
svn:r2600
2004-10-27 03:42:09 +00:00
Nick Mathewson
482c309db9 Document new config code
svn:r2596
2004-10-27 03:08:04 +00:00
Nick Mathewson
a24eb4db91 Re-write configuration option lookup code: use a table, not a big if( || || || ||). Deprecate unoffical abbrevs and abbrevs not on the command line.
svn:r2594
2004-10-27 02:30:28 +00:00
Nick Mathewson
26f3cb8652 Add SysLog option to direct log messages to the system log instead of a FILE*.
svn:r2591
2004-10-26 21:48:41 +00:00
Roger Dingledine
0113a643a2 quick-and-dirty dir policy since the dirservers are getting hammered
nick, could you abstract this sometime so we don't repeat the
sockspolicy code twice?


svn:r2589
2004-10-25 06:16:26 +00:00
Nick Mathewson
04ca660b2a Fix typo in last windows patch
svn:r2580
2004-10-24 00:58:29 +00:00
Nick Mathewson
78a2c3aa39 Make windows fall back to CWD if SHGetSpecialFolderLocation is borked
svn:r2578
2004-10-24 00:52:10 +00:00
Nick Mathewson
c7151d8bed Add "pass" target for RedirectExit, to make it easier to break out of a sequence of rules
svn:r2566
2004-10-19 17:46:06 +00:00
Roger Dingledine
e66d5f897a fix a seg fault with exitredirect
svn:r2555
2004-10-17 04:44:02 +00:00
Nick Mathewson
6d1e1b7f46 Unify windows special-dir handling
svn:r2552
2004-10-17 03:38:02 +00:00
Nick Mathewson
8d27385c23 Implement RedirectExit.
svn:r2550
2004-10-17 01:57:34 +00:00
Roger Dingledine
7c3ab346f6 various tweaks and fixes
svn:r2548
2004-10-16 22:56:46 +00:00
Nick Mathewson
a1bf39f698 Code to parse (but not yet actually use) RedirectExit lines
svn:r2546
2004-10-16 22:37:08 +00:00
Roger Dingledine
de65052312 don't assert multiple things in the same tor_assert()
svn:r2544
2004-10-16 22:14:52 +00:00
Nick Mathewson
47dc024f7e Change interface of parse_addr_port() to return address in host order, since most users seem to want that.
svn:r2542
2004-10-16 21:53:30 +00:00
Nick Mathewson
a42adce362 fix memory leak in router.c; start relying on NULL==(zero bytes)
svn:r2538
2004-10-16 20:38:57 +00:00
Nick Mathewson
9d5831341e Implement user-declared node families.
svn:r2534
2004-10-15 20:52:09 +00:00
Nick Mathewson
99f7955372 Use the real default exit policy, not reject *:*
svn:r2531
2004-10-15 19:18:08 +00:00
Nick Mathewson
01eacbca9e Make RecommendedVersions a CONFIG_TYPE_LINELIST option, and have it tolerate whitespace a little better.
svn:r2528
2004-10-15 05:09:48 +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
Roger Dingledine
56e151eb41 advertise moria2's dirport as 18.244.0.114:80
svn:r2511
2004-10-14 10:05:22 +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
8b325c142e Patch from "J Doe": Use SHGetSpecialFolderLocation instead of
SHGetSpecialFolderPath in order to find application data folder.

Apparently, until IE 4 (!?) came out, nobody realized that programmers
might like to get paths as strings.  Clearly, a fancy pseudo-OO list
of "identifiers" is a far more convenient way to deal with these
things.  And while we're being OO, why return object that you can free
with free()?  Instead, let's make the user get a handle to an abstract
allocation object, and ask it to free the fancy list, and then ask it
to release itself.  Won't that be fun and convenient?

Navigating ancient Win32 APIs is like bikini-waxing creatures from HP
Lovecraft: to do a good job you must understand what's going on... but
the understanding itself can blast your sanity.


svn:r2480
2004-10-14 02:04:43 +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
508970f85d fix typo
svn:r2466
2004-10-13 19:55:40 +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
Roger Dingledine
0b4d3c4df7 parse HttpProxy address in config
fix a potential confusion in fetch_from_buf_http()
make all our int config options non-negative
better bounds checking on options that are ports


svn:r2456
2004-10-12 20:22:09 +00:00
Nick Mathewson
e8748b3fa0 Add default directory servers
svn:r2449
2004-10-12 19:01:28 +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
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
57d7857def don't mind empty exit policy entries
svn:r2373
2004-09-23 22:57:32 +00:00
Roger Dingledine
02e3e3327c discourage people from setting their dirfetchpostperiod more often
than once per minute


svn:r2369
2004-09-23 19:23:32 +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
Roger Dingledine
a475ccf5b8 we should exit(1) if $HOME doesn't exist and we needed it
svn:r2344
2004-09-10 19:16:01 +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
ecf414f05e Stop using separate defaults for no-config-file and empty-config-file
svn:r2329
2004-09-02 22:08:36 +00:00
Nick Mathewson
bda41ba3fd Use new split function and strcmpstart correctly
svn:r2327
2004-09-02 18:39:59 +00:00
Roger Dingledine
d91cacb839 agree with nick: this legal-chars-in-filename stuff gets us nothing
svn:r2310
2004-08-24 21:57:12 +00:00
Nick Mathewson
015232bd39 As far as I can tell, CONFIG_LEGAL_FILENAME_CHARACTERS is both pointless and broken. #if it out, pending agreement from arma. This fixes a bug on win32 that rejected paths with a : in them.
svn:r2309
2004-08-24 20:48:22 +00:00
Nick Mathewson
ae46b6b077 Fix some DOCDOCs
svn:r2295
2004-08-18 21:56:45 +00:00
Roger Dingledine
cf6159abb9 fix a seg fault on hup when FascistFirewall is defined
svn:r2294
2004-08-18 21:46:53 +00:00
Nick Mathewson
555f8f30f4 Avoid segfault when freeing options_t without firewall_ports
svn:r2279
2004-08-18 07:06:53 +00:00
Nick Mathewson
86980cf6e2 Functions to test nickname validity
svn:r2269
2004-08-18 04:44:24 +00:00
Nick Mathewson
fffb4dbb8b fix unix build: CONFDIR, not CONF_DIR
svn:r2267
2004-08-18 04:04:08 +00:00
Nick Mathewson
8626c7724e Clean windows whitespace
svn:r2266
2004-08-18 03:47:55 +00:00
Nick Mathewson
17ce7d499f On windows, default datadir is APPDATA/tor, and default config file is APPDATA/tor/torrc. (APPDATA is usually somedrive:/Documents and Settings/.../Application Data/)
svn:r2265
2004-08-18 03:42:55 +00:00
Nick Mathewson
7cb93e5bb6 Move string-splitting into a separate function
svn:r2263
2004-08-17 21:06:36 +00:00
Roger Dingledine
4c47e07a11 make csv parsing notice the last letter of each entry too
svn:r2261
2004-08-17 11:55:47 +00:00
Roger Dingledine
0131d94a6c bugfix: make receiving csv lines not seg fault
svn:r2260
2004-08-17 11:52:20 +00:00
Roger Dingledine
6cf09a5dc0 people with no torrc allow unverified middle/rendezvous nodes by default
svn:r2259
2004-08-17 11:42:22 +00:00
Nick Mathewson
4e026f5b1d Fix crash when looking for ~/.torrc with no $HOME set
svn:r2256
2004-08-17 07:33:06 +00:00
Roger Dingledine
ee23b7a470 use unverified routers in the desired positions
svn:r2249
2004-08-17 06:27:32 +00:00
Nick Mathewson
74621132a9 Implement AllowUnverifiedNodes
svn:r2246
2004-08-17 05:13:58 +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
Roger Dingledine
0a6e27208b o Handle servers with dynamic IP addresses: don't replace
options->Address with the resolved one at startup.
  o detect our address right before we make a routerinfo each time.
o external IP vs bind-IP. Already done, just use options->Address.
o OutboundBindAddress config option, to bind to a specific
  IP address for outgoing connect()s.


svn:r2241
2004-08-16 11:43:18 +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
699a9d8b46 commit some minor fixes from this sandbox so i can commit the next one
svn:r2229
2004-08-15 05:28:09 +00:00
Roger Dingledine
d0cfbcf875 only pick a default nickname if you're a server
svn:r2134
2004-08-04 02:15:22 +00:00
Roger Dingledine
6c56f34aaf clients shouldn't create datadir until we have something to put there
svn:r2092
2004-07-22 00:13:42 +00:00
Roger Dingledine
dc7951a5a7 a whole swath of fixes
introduce an authdir_mode() macro to match the others.
don't initialize uptime to the number of seconds since 1970.
non-authoritative dirservers don't cache their directory on disk.
make only authdirservers use clique_mode.
only read approved-routers file if you're an authdirserver.
even authdirservers fetch a new directory in do_hup.
retry_all_connections() is now called retry_all_listeners().
router_parse_list_from_string() correctly reports the router number
  it's working on.
only call dirserv_add_own_fingerprint() and
   dirserv_add_descriptor() on startup if we're an authdirserver.
if AuthDir and !ORPort then fail.
if AuthDir and ClientOnly then fail.


svn:r2061
2004-07-20 10:17:43 +00:00
Nick Mathewson
54c129d8dc abstract ORPort/SocksPort checks into server_mode(), proxy_mode(), clique_mode(), etc. Dont change underlying comments.
svn:r2054
2004-07-18 21:47:04 +00:00
Nick Mathewson
0b3357d573 Look in .torrc if no CONFDIR "torrc" is found.
svn:r2048
2004-07-16 19:43:58 +00:00
Nick Mathewson
c2103eb63a Finish most pre2 items: make running-routers list work right; rename secret key files; make even more lookup-by-nickname use lookup-by-id; default nicknames to hostname.
svn:r2043
2004-07-13 18:23:40 +00:00