Commit Graph

444 Commits

Author SHA1 Message Date
Nick Mathewson
4ea2a4595e Fix the first part of bug 681, as suggested by Robert Hogan on or-talk.
svn:r14754
2008-05-27 21:02:36 +00:00
Nick Mathewson
bd547e3cfc r18861@catbus: nickm | 2008-03-16 23:22:56 -0400
Fix a couple of bugs in setting control log callback severity.


svn:r14065
2008-03-17 03:37:52 +00:00
Nick Mathewson
365f16b199 r18787@catbus: nickm | 2008-03-13 11:11:52 -0400
Make set-option functions return sensible error codes from an enum, not mysterious negative integers


svn:r14004
2008-03-13 15:11:56 +00:00
Nick Mathewson
8b24e01599 r18723@catbus: nickm | 2008-03-11 00:25:30 -0400
Fix bug spotted by mwenge: a server_event should not be a sever_event.  Also, fix compile errors in config.c and control.c with --enable-gcc-warnings.


svn:r13957
2008-03-11 04:30:14 +00:00
Peter Palfrader
2704a2e129 And appease the whitespace nazis among us
svn:r13950
2008-03-10 12:43:47 +00:00
Peter Palfrader
79f1ee8a2d Implement LOADCONF control command
The LOADCONF control command allows posting a config file to Tor
over the control interface.  This config file is then loaded as if
it had been read from disk.  Sending a HUP signal to Tor will make
it try to load its old config from disk again, thereby forgetting
the config loaded with this command.


svn:r13948
2008-03-10 12:41:52 +00:00
Peter Palfrader
8987bd2fd9 If we decrement incoming_cmd's length when receiving the ending CRLF "." CRLF for a multi-line control command, also truncate the string by nul-terminating it in the correct place.
svn:r13939
2008-03-10 12:13:43 +00:00
Roger Dingledine
c5a7ff8e43 forward-port r13777
svn:r13778
2008-02-29 01:45:06 +00:00
Nick Mathewson
ee8dce3084 r14421@tombo: nickm | 2008-02-24 17:05:18 -0500
Patch from mwenge: always willingly serve our own extrainfo from the controlport


svn:r13699
2008-02-24 22:11:12 +00:00
Nick Mathewson
e7db789e82 r14399@tombo: nickm | 2008-02-22 14:09:38 -0500
More 64-to-32 fixes. Partial backport candidate. still not done.


svn:r13680
2008-02-22 19:09:45 +00:00
Nick Mathewson
5c03f82a65 r18345@catbus: nickm | 2008-02-21 13:45:04 -0500
Do the last part of arma's fix for bug 437: Track the origin of every addrmap, and use this info so we can remove all the trackhostexits-originated mappings for a given exit.


svn:r13660
2008-02-21 18:45:11 +00:00
Nick Mathewson
8c6b5d6640 r14246@tombo: nickm | 2008-02-17 19:33:02 -0500
Fix a wide line in control.c; make the check-spaces target ignore the openbsd malloc file.


svn:r13566
2008-02-19 05:08:27 +00:00
Nick Mathewson
faa56a500b r14236@tombo: nickm | 2008-02-17 13:44:55 -0500
Partial fix for bug 586: Add an ephemeral __HashedControlSessionPassword.


svn:r13543
2008-02-17 18:45:07 +00:00
Nick Mathewson
842a33ff20 Update some copyright notices: it is now 2008.
svn:r13412
2008-02-07 05:31:47 +00:00
Nick Mathewson
a869574c56 r17947@catbus: nickm | 2008-02-06 11:57:53 -0500
Fix a bunch of DOCDOC items; document the --quiet flag; refactor a couple of XXXX020 items.


svn:r13405
2008-02-06 16:58:05 +00:00
Roger Dingledine
bbcf406d9f If the networkstatus consensus lists no recommended versions, don't
complain to the user and demand that they upgrade to one of "".


svn:r13401
2008-02-06 12:45:04 +00:00
Nick Mathewson
7dc70c2405 r17917@catbus: nickm | 2008-02-05 16:38:15 -0500
Oops; fix compilation of control.c


svn:r13391
2008-02-05 21:39:51 +00:00
Nick Mathewson
fac2cd3b03 r17916@catbus: nickm | 2008-02-05 16:29:35 -0500
Fix some XXX020 items in control.c: add a maximum line length and note that the number of versioning authorities is no longer apparent to clients.


svn:r13390
2008-02-05 21:39:49 +00:00
Nick Mathewson
c11c48fc78 r17913@catbus: nickm | 2008-02-05 16:11:33 -0500
Correctly register failures in connection_add() in dnsserv_launch_request()


svn:r13387
2008-02-05 21:39:40 +00:00
Nick Mathewson
c8a689c9e8 r17909@catbus: nickm | 2008-02-05 14:48:22 -0500
As planned, rename networkstatus_vote_t to networkstatus_t, now that v3 networkstatuses are working and standard and v2 networkstatuses are obsolete.


svn:r13383
2008-02-05 21:39:29 +00:00
Nick Mathewson
4a3b7496f0 r17639@catbus: nickm | 2008-01-15 19:09:21 -0500
Fix some hard to trigger but nonetheless real memory leaks spotted by an anonymous contributor.  Needs review.  Partial backport candidate.


svn:r13147
2008-01-16 05:27:19 +00:00
Nick Mathewson
24aae484c9 r17624@catbus: nickm | 2008-01-15 00:42:01 -0500
Fixes to more anonymously-reported typos and logic errors.


svn:r13136
2008-01-15 05:57:19 +00:00
Nick Mathewson
3b8f76aa51 r17611@catbus: nickm | 2008-01-14 13:44:16 -0500
add some missing checks for failing return values.


svn:r13130
2008-01-14 19:00:23 +00:00
Roger Dingledine
2ac1e36248 minor cleanups
svn:r13095
2008-01-10 17:54:24 +00:00
Nick Mathewson
dd35fe59c4 r17499@catbus: nickm | 2008-01-07 13:39:46 -0500
Bugfix on fix for 557: Make values containing special characters work right with getconf, setconf, and saveconf.  Document this in control-spec.txt


svn:r13056
2008-01-07 18:54:55 +00:00
Nick Mathewson
48d7adca8a r15768@tombo: nickm | 2007-12-31 16:12:09 -0500
Patch from Tup: make NS events work again.


svn:r13009
2007-12-31 21:12:16 +00:00
Nick Mathewson
bd32982c77 r17426@catbus: nickm | 2007-12-28 21:12:29 -0500
Remove need for buf_pullup in fetch_line_from_buf().


svn:r13002
2007-12-29 02:33:42 +00:00
Nick Mathewson
da06bfb80f r15653@tombo: nickm | 2007-12-23 14:15:12 -0500
Refactor circuit_launch* functions to take a bitfield of flags rather than 4 separate nonconsecutive flags arguments.  Also, note a possible but in circuit_find_to_cannibalize, which seems to be ignoring its purpose argument.


svn:r12948
2007-12-23 19:15:22 +00:00
Roger Dingledine
366c273d27 Make "GETINFO/desc-annotations/id/<OR digest>" actually work.
svn:r12919
2007-12-22 05:27:30 +00:00
Roger Dingledine
f405f9b614 Make getinfo ns/purpose/bridge actually work
Also, dump our bridge router status entries to disk every 30 minutes.


svn:r12871
2007-12-19 04:58:58 +00:00
Roger Dingledine
74d05f4b2c answer getinfo ns/purpose/bridge queries
svn:r12860
2007-12-18 22:39:15 +00:00
Nick Mathewson
b8ac050e85 r15532@tombo: nickm | 2007-12-17 17:41:05 -0500
clean up whitesapce and debug a little on geoip stuff.


svn:r12847
2007-12-17 22:44:18 +00:00
Roger Dingledine
1d8a8063b9 clean up copyrights, and assign 2007 copyrights to The Tor Project, Inc
svn:r12786
2007-12-12 21:09:01 +00:00
Roger Dingledine
6dfd47467e Allow multiple HashedControlPassword config lines, to support
multiple controller passwords.


svn:r12732
2007-12-09 04:59:27 +00:00
Roger Dingledine
a107a1624b extra points if it compiles
svn:r12688
2007-12-06 07:17:05 +00:00
Roger Dingledine
8de470cf69 Add "GETINFO/desc-annotations/id/<OR digest>" so controllers can
ask about source, timestamp of arrival, purpose, etc. We need
something like this to help Vidalia not do GeoIP lookups on bridge 
addresses.


svn:r12687
2007-12-06 07:15:06 +00:00
Roger Dingledine
f8df8d791e start to refactor dirserver_mode()
svn:r12621
2007-12-01 04:58:53 +00:00
Roger Dingledine
b4a28f8b83 Bugfix on r7072, which turned out to basically be a no-op:
Respond to INT and TERM SIGNAL commands before we execute the
signal, in case the signal shuts us down. We had a patch in
0.1.2.1-alpha that tried to do this by queueing the response on
the connection's buffer before shutting down, but that really
isn't the same thing. Bug located by Matt Edman.

This is a bug in 0.1.2.x too, but there's no way we should backport
this fix. Speaking of which, can somebody double-check it? :)


svn:r12070
2007-10-21 04:15:28 +00:00
Roger Dingledine
85e746d060 revert a tiny bit of r12035
svn:r12037
2007-10-18 23:18:28 +00:00
Roger Dingledine
0a865bc277 various fixes from reading or-cvs the past few days
svn:r12035
2007-10-18 23:14:58 +00:00
Nick Mathewson
f988f93b1a r15877@catbus: nickm | 2007-10-17 12:54:56 -0400
Make unverified-consensus get removed when it is accepted or rejected.  Make a new get_datadir_fname*() set of functions to eliminate the common code of "get the options, get the datadir, append some stuff".


svn:r12000
2007-10-17 16:55:44 +00:00
Nick Mathewson
3ad6dc0e2e r15806@catbus: nickm | 2007-10-15 19:14:57 -0400
Implement v3 networkstatus client code.  Remove v2 networkstatus client code, except as needed for caches to fetch and serve v2 networkstatues and the routers they list.


svn:r11957
2007-10-15 23:15:24 +00:00
Roger Dingledine
3977ccbc80 Controllers should now specify cache=no or cache=yes when using
the +POSTDESCRIPTOR command.


svn:r11892
2007-10-12 07:57:29 +00:00
Roger Dingledine
ad8757fbeb Disable the SETROUTERPURPOSE controller command: it is now obsolete.
svn:r11891
2007-10-11 22:19:47 +00:00
Roger Dingledine
541aa72155 Bugfix on r11138:
Fix a minor memory leak whenever a controller sends the PROTOCOLINFO
command. Bugfix on 0.2.0.5-alpha.
Backport candidate.


svn:r11864
2007-10-11 03:27:47 +00:00
Nick Mathewson
8b71a76dd3 r15598@catbus: nickm | 2007-10-09 16:37:35 -0400
Turn all "Is DirPort nonzero? Because if it is, we must be a directory" logic into calls to dirserver_mode().


svn:r11817
2007-10-09 20:44:47 +00:00
Nick Mathewson
bb9cc4fb29 r14812@Kushana: nickm | 2007-10-09 10:22:00 -0400
Merge extra fields in local_routerstatus_t back into routerstatus_t.  See changelog for rationale.


svn:r11799
2007-10-09 15:27:15 +00:00
Nick Mathewson
6f7847b378 r15530@catbus: nickm | 2007-10-04 12:16:27 -0400
Add a bunch of function documentation; clean up a little code; fix some XXXXs; tag the nonsensical EXTRAINFO_PURPOSE_GENERAL as nonsesnse; note another bit of "do not cache special routers" code to nuke.


svn:r11761
2007-10-04 16:21:58 +00:00
Nick Mathewson
b5c8a8ae53 r15422@catbus: nickm | 2007-09-27 16:42:35 -0400
Use descriptor annotations to record the source, download t time, and purpose of every descriptor we add to the store.  The remaining to-do item is to stop setting do_not_cache on bridges.


svn:r11680
2007-09-27 20:46:30 +00:00
Nick Mathewson
f45dec1690 r15143@catbus: nickm | 2007-09-18 11:49:46 -0400
Add getinfo status/good-server-descriptor and status/reachability-succeeded. Patch from Robert Hogan.


svn:r11483
2007-09-18 15:53:55 +00:00
Nick Mathewson
1dbe726f04 r15068@catbus: nickm | 2007-09-14 15:25:02 -0400
Fix a couple typos in control.c; spotted by Robert Hogan.


svn:r11440
2007-09-14 19:27:04 +00:00
Nick Mathewson
565f5f32c5 r14363@Kushana: nickm | 2007-09-08 16:25:45 -0400
Another round of whitespeace fixes.


svn:r11407
2007-09-08 20:25:57 +00:00
Nick Mathewson
4c4280e249 Make sure that even dumb compilers can tell that bad_cookie and bad_password are set before use.
svn:r11390
2007-09-06 18:04:28 +00:00
Nick Mathewson
d57c1c5c56 r14328@Kushana: nickm | 2007-09-04 20:17:34 -0400
There is no good reason to make hashedcontrolpassword and cookieauthentication mutually exclusive.  So let's not.


svn:r11377
2007-09-05 00:31:07 +00:00
Nick Mathewson
91f83cfc2d r14830@catbus: nickm | 2007-08-29 13:50:10 -0400
Make controllers accept LF as well as CRLF.  Update spec to reflect this.  Remove now-dead code.  Make controller warning about v0 protocol more accurate.


svn:r11299
2007-08-29 19:02:33 +00:00
Nick Mathewson
7efc165095 r14204@Kushana: nickm | 2007-08-24 10:24:36 -0400
Fix a bug in last patch; add support for getting extrainfo documents by the control port (since it is silly to tell tools to do it without actually giving them an interface).


svn:r11270
2007-08-24 14:41:15 +00:00
Nick Mathewson
b9d43e2685 r14203@Kushana: nickm | 2007-08-24 10:15:58 -0400
Add a hacked-up GETINFO desc/all-recent-extrainfo-hack so that torstat can keep working with a minimum of fuss, until it learns about extrainfo documents.


svn:r11269
2007-08-24 14:41:10 +00:00
Roger Dingledine
8d524edb83 a single quote != a single double quote. i can't hear the
circus music from here, perhaps we should move closer.


svn:r11256
2007-08-23 23:03:32 +00:00
Roger Dingledine
c02fb8997b backport candidate:
Make it possible to read the PROTOCOLINFO response in a way that
conforms to our control-spec. Reported by Matt Edman.


svn:r11251
2007-08-22 07:57:10 +00:00
Roger Dingledine
a200f442fb avoid double-punctuation when we're reporting errors from the
config functions to the controller.


svn:r11221
2007-08-20 16:13:21 +00:00
Roger Dingledine
c88803d924 Fix a bug in ADDRMAP controller replies that would sometimes
try to print a NULL. Patch from tup.


svn:r11181
2007-08-19 04:58:55 +00:00
Nick Mathewson
718953dbe9 r14606@catbus: nickm | 2007-08-16 13:45:01 -0400
Implement CookieAuthFile and CookieAuthFileGroupReadable.  Backport candidate.


svn:r11141
2007-08-16 17:46:01 +00:00
Nick Mathewson
f4398feadb r14600@catbus: nickm | 2007-08-16 13:30:22 -0400
Implement proposal 119. Backport candidate.


svn:r11138
2007-08-16 17:31:23 +00:00
Nick Mathewson
181ba71a90 r14051@Kushana: nickm | 2007-08-15 15:55:36 -0400
Fix an XXXX020 and a few DOCDOCs.


svn:r11127
2007-08-15 19:56:01 +00:00
Roger Dingledine
7e5cee8110 this does not actually change anything (i hope), but it makes me a lot
more comfortable.
nick, can you confirm this?


svn:r11119
2007-08-15 15:36:34 +00:00
Roger Dingledine
f606d74f56 backport candidate:
- If we require CookieAuthentication but we fail to write the
  cookie file, we would warn but not exit, and end up in a state
  where no controller could authenticate. Now we exit.
- If we require CookieAuthentication, stop generating a new cookie
  every time we change any piece of our config.


svn:r11117
2007-08-15 15:26:14 +00:00
Roger Dingledine
659cdae145 a patch on r11016 that makes it work better
svn:r11018
2007-08-02 04:28:29 +00:00
Nick Mathewson
322b6f7e65 r13892@Kushana: nickm | 2007-08-01 18:27:13 -0700
Close immediately after anything but a successful authentication attempt on the control port.  Backport candidate.


svn:r11016
2007-08-02 01:28:40 +00:00
Nick Mathewson
34a3a5e2f4 r14016@catbus: nickm | 2007-07-30 13:45:55 -0400
More documentation


svn:r10992
2007-07-30 17:46:14 +00:00
Nick Mathewson
964e4a305d r13972@catbus: nickm | 2007-07-29 00:01:38 -0400
Make our control events for multi-line async replies conform to our old grammar.  Change back to the old grammar (which got "corrected" in r10931).


svn:r10964
2007-07-29 04:03:25 +00:00
Nick Mathewson
025a81fc18 r13907@catbus: nickm | 2007-07-25 18:51:25 -0400
Patch from tup: translate LFs to CRLFs in NS replies and
 ensures the data section is properly terminated with "\r\n.\r\n


svn:r10932
2007-07-25 22:57:02 +00:00
Nick Mathewson
a8821e2d82 r13905@catbus: nickm | 2007-07-25 18:48:44 -0400
ADDRMAP events should never have specified local time.  Extend them to have the proper gmt time, and make GETINFO address-mappings always do the right thing (since it is new in this version).


svn:r10930
2007-07-25 22:56:54 +00:00
Nick Mathewson
6e9f1f76f2 r13784@catbus: nickm | 2007-07-16 13:27:32 -0400
Apply patch from tup: remove extra space at the end of some circuit-status events, and stop translating CRLF to CRCRLF in control replies.


svn:r10845
2007-07-16 17:27:35 +00:00
Nick Mathewson
26a25edaec r13777@catbus: nickm | 2007-07-16 12:58:08 -0400
Patch from tup: new address-mappings/ GETINFO that includes expiry times.


svn:r10844
2007-07-16 16:58:11 +00:00
Roger Dingledine
98ce45bebf Backport candidate:
Fix a potential crash bug when we load many server descriptors at
once and some of them make others of them obsolete. Fixes bug
458. [Bugfix on 0.1.2.x]


svn:r10832
2007-07-16 00:11:03 +00:00
Nick Mathewson
d6ba1c3d96 r13676@catbus: nickm | 2007-07-10 13:41:24 -0400
Man. I thought I removed that code.


svn:r10785
2007-07-10 17:41:26 +00:00
Nick Mathewson
a8465adaa2 r13667@catbus: nickm | 2007-07-10 13:12:52 -0400
Patch from tup: add GETINFO status/enough-dir-info


svn:r10782
2007-07-10 17:14:55 +00:00
Nick Mathewson
74711479eb r13666@catbus: nickm | 2007-07-10 13:10:00 -0400
Get the RESOLVE controller code working.


svn:r10781
2007-07-10 17:14:51 +00:00
Nick Mathewson
7705314777 r13637@catbus: nickm | 2007-07-06 14:24:27 -0400
fix copy-paste error in config message src/or/config.c .  Apply
 initial (but pared-down) version of launch-resolve-via-controller
 patch from Robert Hogan.
 


svn:r10780
2007-07-10 17:13:24 +00:00
Nick Mathewson
d828915136 r13463@catbus: nickm | 2007-06-17 11:10:17 -0400
Add a SOURCE_ADDR field to STREAM NEW events so that controllers can match requests to applications. (Patch from Robert Hogan.)


svn:r10639
2007-06-17 15:10:51 +00:00
Nick Mathewson
77502ac82d r13102@catbus: nickm | 2007-05-31 13:56:25 -0400
Make "authdir_newdesc rejected" work again.


svn:r10421
2007-05-31 18:48:28 +00:00
Nick Mathewson
a312afd67e r12936@catbus: nickm | 2007-05-24 14:12:34 -0400
Review XXXX comments without a version; upgrade some to XXXX020.


svn:r10315
2007-05-24 18:12:52 +00:00
Nick Mathewson
6975a093e9 r12853@catbus: nickm | 2007-05-22 11:36:54 -0400
Make connection_array into a smartlist.


svn:r10292
2007-05-22 15:49:14 +00:00
Nick Mathewson
e935d73b34 r12852@catbus: nickm | 2007-05-22 11:00:27 -0400
Use svn revisions consistently throughout all log messages.


svn:r10291
2007-05-22 15:48:46 +00:00
Nick Mathewson
b837191fd0 r12768@catbus: nickm | 2007-05-16 17:25:33 -0400
Fix GCC warnings related to local parameters/variables getting shadowed.


svn:r10198
2007-05-16 22:15:14 +00:00
Nick Mathewson
e043b86f47 r12764@catbus: nickm | 2007-05-15 17:17:39 -0400
Enable (and cope with) more GCC 4.2 warnings.


svn:r10196
2007-05-15 21:17:48 +00:00
Nick Mathewson
ca32b4d5b5 r12761@catbus: nickm | 2007-05-15 03:13:52 -0400
Be a lot smarter when parsing lists of routers and extrainfos.


svn:r10193
2007-05-15 07:13:56 +00:00
Roger Dingledine
440b7f0c70 polish r9726-r9903
svn:r10182
2007-05-13 09:25:06 +00:00
Nick Mathewson
11f3e894d3 r12708@catbus: nickm | 2007-05-10 15:18:08 -0400
Patch from shibz: implement a getinfo status/version/... so a controller can tell whether the current version is recommended, whether any versions are good, and how many authorities agree.


svn:r10162
2007-05-10 19:30:02 +00:00
Roger Dingledine
43411ceed3 Implement "getinfo status/circuit-established"
svn:r10120
2007-05-05 22:51:02 +00:00
Nick Mathewson
e97a6dd01f r12587@catbus: nickm | 2007-04-30 15:47:39 -0400
Backport candidate: correctly set the purpose of routers that are inserted by the controller with purpose=controller.


svn:r10071
2007-04-30 19:48:45 +00:00
Roger Dingledine
5ba4eaba1c Let the controller specify HOP=%d as an argument to ATTACHSTREAM,
so we can exit from the middle of the circuit.


svn:r10056
2007-04-30 11:10:45 +00:00
Roger Dingledine
5bdb138d11 cleanups, and note a bug
svn:r10022
2007-04-25 06:05:46 +00:00
Nick Mathewson
38a5f09502 r12349@catbus: nickm | 2007-04-11 09:18:15 -0400
Add code to shrink the cell memory pool by discarding empty chunks that have been empty for the last 60 seconds.  Also, instead of having test.c duplicate declarations for exposed functions, put them inside #ifdef foo_PRIVATE blocks in the headers.  This prevents bugs where test.c gets out of sync.


svn:r9944
2007-04-11 13:18:25 +00:00
Nick Mathewson
306d5400c3 r12643@0-41-wifi: nickm | 2007-03-23 14:56:35 -0400
Refactor a bunch of functions that take edge_connection_t not to also take a crypt_path_t; the cpath is implicit.


svn:r9899
2007-03-24 15:57:51 +00:00
Nick Mathewson
141efb86ff r12230@catbus: nickm | 2007-03-17 17:34:32 -0400
Remove some duplicated code in control.c: unify the "parse space-separated arguments and warn if there are too few" logic into a single helper function.


svn:r9866
2007-03-17 21:34:41 +00:00
Nick Mathewson
d787ef906a r12229@catbus: nickm | 2007-03-17 17:20:28 -0400
Add a warning when using obsolete "GUARDS" event.  Also, remove obsolete "if (1) {}"s from control.c: big patch, mostly just dedenting block contents.


svn:r9865
2007-03-17 21:34:37 +00:00
Roger Dingledine
9d7dc1b37b forward-port r9850 and the changelogs
(it's a band)


svn:r9853
2007-03-17 04:32:04 +00:00
Roger Dingledine
ad304a5cbb change my mind -- correct the spec to match the code's
behavior for getinfo addr-mappings/*. this is because
the code and spec have been mismatched since at least
0.1.1.x, so i would be surprised if nobody at all is
relying on the current behavior.

backport candidate.
backbackport candidate.


svn:r9823
2007-03-15 06:25:00 +00:00
Roger Dingledine
8ca31c8195 Make the response to 'getinfo addr-mappings/*' follow the spec.
svn:r9822
2007-03-15 06:10:58 +00:00