Commit Graph

1923 Commits

Author SHA1 Message Date
Roger Dingledine
233f516d61 if you're going to ask it to use a body of length 0,
don't give it a body.


svn:r2742
2004-11-09 10:18:41 +00:00
Roger Dingledine
dd3a12c929 fix a memory-squashing bug that was causing an infinite loop
svn:r2741
2004-11-09 10:08:42 +00:00
Roger Dingledine
6a504efdd3 mark_logs_temp() before init'ing new ones.
we were seeing double, triple, etc each time we setconf'ed.


svn:r2738
2004-11-09 08:01:39 +00:00
Roger Dingledine
3901473bf3 change the interface to config_trial_assign()
svn:r2737
2004-11-09 07:55:48 +00:00
Roger Dingledine
2d18d9eefb when you try a new set of options, and you like them, make sure they stick
svn:r2736
2004-11-09 07:45:24 +00:00
Roger Dingledine
9f3e3d2b71 stop wanting to split init_keys()
svn:r2735
2004-11-09 07:29:05 +00:00
Roger Dingledine
cad26b343d once normalized, DataDirectory is always defined
svn:r2734
2004-11-09 07:20:21 +00:00
Nick Mathewson
180e0a9326 Make check_private_dir trimodal (check/create/ignore), not bimodal (create/ignore).
svn:r2733
2004-11-09 07:12:31 +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
Nick Mathewson
48a0b6c476 Separate is-recognized-option from get-option-value, since NULL is ambiguous and returning "" misrepresents.
svn:r2731
2004-11-09 06:40:32 +00:00
Roger Dingledine
005b02fd57 when rejecting an old-style router descriptor, tell us its nickname
svn:r2730
2004-11-09 06:37:58 +00:00
Roger Dingledine
677124fd0c During options_dup, don't copy LINELIST_S or OBSOLETE options.
And recognize obsolete options now in config_get_assigned_option().


svn:r2729
2004-11-09 06:18:17 +00:00
Roger Dingledine
94b9525f6e EntryNodess is not the plural of EntryNodes
svn:r2728
2004-11-09 06:09:06 +00:00
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
Roger Dingledine
6b22360eb8 fix mistake in comments
svn:r2723
2004-11-09 05:30:48 +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
e3a067c73a fix comments in hibernate.c
svn:r2714
2004-11-09 02:12:41 +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
Roger Dingledine
8b9d7da59f while we hibernate, our declared bandwidth capacity is 0
svn:r2710
2004-11-07 23:19:12 +00:00
Nick Mathewson
2640be28fa Document hibernate.c. Also fix handling of corner case where we hit the end of the interval while we are in HIBERNATE_STATE_LOWBANDWIDTH
svn:r2709
2004-11-07 23:14:47 +00:00
Nick Mathewson
fc9c6e7c95 Fix compile errors
svn:r2708
2004-11-07 23:11:29 +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
Nick Mathewson
c514a06663 Fix up error codes
svn:r2706
2004-11-07 22:58:35 +00:00
Nick Mathewson
0059ee5fea More tests for split
svn:r2705
2004-11-07 22:58:16 +00:00
Roger Dingledine
dac5d6715e add saveconf control command.
allow authentication by localhost, but if tor demands more, require more.


svn:r2704
2004-11-07 22:37:59 +00:00
Nick Mathewson
66779137bf Add missing dereference; stop throwing zeroes around.
svn:r2702
2004-11-07 22:18:00 +00:00
Nick Mathewson
2cacb4e0f9 Document control.c
svn:r2700
2004-11-07 21:37:50 +00:00
Roger Dingledine
3236ee3127 allow unauth control connections for now
let control connections recognize eof


svn:r2699
2004-11-07 11:33:04 +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
efad93feb4 tor --list-fingerprint as a client shouldn't try to print null
svn:r2697
2004-11-06 09:22:08 +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
865f341708 parse_line_from_file is obsolete.
svn:r2693
2004-11-06 05:18:29 +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
7c0792d89a Write hibernation code. Needs docs and tests.
svn:r2689
2004-11-05 17:55:34 +00:00
Nick Mathewson
38ed0ce5e6 Unify tor_parse_(numeric); make sure MAX_UINT32 and MAX_UINT64 are defined
svn:r2688
2004-11-05 17:54:50 +00:00
Roger Dingledine
0c583a6cf2 clarify it even better
svn:r2687
2004-11-05 11:58:34 +00:00
Roger Dingledine
0ab8b8a4e4 resolve misleading torrc comments
svn:r2686
2004-11-05 11:55:35 +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
b56ef496d9 Twiddle header order to compile on OS X again
svn:r2681
2004-11-04 22:33:20 +00:00
Nick Mathewson
19868fe968 Move accounting code into hibernate; start adding logic to track bandwidth-per-seconds-active
svn:r2680
2004-11-04 22:33:06 +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
Nick Mathewson
d9e0f3f9bc Make sure control command bodies are always followed by a NUL
svn:r2678
2004-11-04 22:30:49 +00:00
Nick Mathewson
9d604ec615 Add code to read configuration lines from a string as well as a file
svn:r2676
2004-11-04 22:29:45 +00:00
Nick Mathewson
831c988ea1 fix problems introduced by rpm spec patch.
svn:r2675
2004-11-04 15:34:04 +00:00
Nick Mathewson
69e5e8d0ad Merge RPM spec patch from jbash
svn:r2674
2004-11-04 15:17:22 +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
5b312541d7 fix windows warnings
svn:r2667
2004-11-03 21:53:54 +00:00
Nick Mathewson
70f7e32ec6 fix typos
svn:r2666
2004-11-03 21:53:12 +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
871bf904ae Remove extraneous local
svn:r2663
2004-11-03 19:15:38 +00:00
Nick Mathewson
d5244e3872 Add a write_bytes_to_file so we can have files with NULs in them.
svn:r2662
2004-11-03 19:02:48 +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
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
Nick Mathewson
11de62aa60 Add a slightly trickier string-join interface for making NUL-terminated string messages
svn:r2659
2004-11-03 18:28:00 +00:00
Nick Mathewson
11979dc1f5 Add a callback log handler type
svn:r2658
2004-11-03 18:27:19 +00:00
Nick Mathewson
4fdaa5de51 Streamline the two redundant "Has the second rolled over?" checks in prepare_for_poll and connection_bucket_refill; also, generate BANDWIDTH control events
svn:r2657
2004-11-03 16:38:04 +00:00
Roger Dingledine
12e92eb82f connection_read_bucket_decrement() has a side-effect that
we need to get even if we just read 0 bytes


svn:r2656
2004-11-03 10:18:31 +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
Roger Dingledine
e761cc9750 my assert.h takes extra pains to be certain to _re-include_
itself if you include it twice. this is dumb, but hey.


svn:r2653
2004-11-03 07:29:03 +00:00
Nick Mathewson
347d3f9d62 Start implementing control interface.
svn:r2652
2004-11-03 01:32:26 +00:00
Nick Mathewson
d63d420930 Fix another typo
svn:r2651
2004-11-03 01:31:42 +00:00
Nick Mathewson
3e16515343 The spelling is "d-e-f-i-n-e".
svn:r2650
2004-11-03 00:02:17 +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
Nick Mathewson
a2f6210b3e Add compatibility macros for printf and scanf-ing 64-bit unsigned ints
svn:r2648
2004-11-02 22:14:34 +00:00
Nick Mathewson
67f14032b1 Handle strlcat/strlcpy correctly on platforms that have them.
svn:r2647
2004-11-02 19:25:52 +00:00
Nick Mathewson
509c0bdc22 untabify. This should hold it.
svn:r2646
2004-11-02 03:11:01 +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
Roger Dingledine
85c79ffbc7 canonicalize "src" and "dest" arg order in crypto.c (and others)
svn:r2644
2004-11-02 02:28:51 +00:00
Nick Mathewson
1433a0b26f Fix signed/unsigned comparison warning
svn:r2643
2004-11-01 22:41:32 +00:00
Roger Dingledine
037fba7595 util.c needs ctype.h for tolower and isspace
svn:r2642
2004-11-01 21:54:12 +00:00
Roger Dingledine
b390786582 Hidden service operators had a bug in version 1 style INTRODUCE cells
that made them fail. Fix the bug, and revert clients to use version 0
until 0.0.9pre4 is obsolete.


svn:r2641
2004-11-01 21:46:27 +00:00
Nick Mathewson
ce79bab7f1 Split util into util (general utilities), container (smartlist and strmap), and compat (cross-platform compatability).
svn:r2640
2004-11-01 20:41:47 +00:00
Roger Dingledine
4689243242 make sure options.MaxConn can be reached
svn:r2638
2004-11-01 08:24:34 +00:00
Roger Dingledine
282816b498 change min required number of fd's to 1024
svn:r2636
2004-11-01 08:09:59 +00:00
Roger Dingledine
790349c645 oh, and add the actual file too
svn:r2631
2004-10-31 20:29:25 +00:00
Roger Dingledine
984ffec105 implement first piece of hibernation
still need to track bandwidth, and make decisions based on bandwidth


svn:r2630
2004-10-31 20:28:41 +00:00
Nick Mathewson
ae7495dd55 Only tor and test binaries need to link against openssl and zlib; tor-resolve can be smaller.
svn:r2629
2004-10-30 19:27:06 +00:00
Nick Mathewson
5bc0dba933 Move all util functions that need openssl into crypto.c; make non-openssl functions that util needs into util. Now openssl can be separated.
svn:r2628
2004-10-30 19:26:31 +00:00
Nick Mathewson
9510d9a792 tor --list-fingerprint to print fingerprint and exit
svn:r2627
2004-10-30 19:18:37 +00:00
Roger Dingledine
51e16233cb Fix paul gardner's assert bug. Turns out when circuit_launch_by_nickname()
failed at the first hop, it would try to relaunch another circ right
then, even though the first circuit hadn't been populated yet with its
pending_final_cpath.


svn:r2624
2004-10-30 05:04:52 +00:00
Nick Mathewson
5c68db8b3d Link tools directory into rest of build system
svn:r2623
2004-10-28 20:31:15 +00:00
Nick Mathewson
54b8f7e503 Add a pure-C tor-resolve implementation
svn:r2620
2004-10-28 20:28:13 +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
36bbab2f2b Fix in warning fix
svn:r2617
2004-10-27 21:54:44 +00:00