Commit Graph

478 Commits

Author SHA1 Message Date
Roger Dingledine
1d3bb103a4 clean up some function argument names
svn:r10138
2007-05-08 10:01:33 +00:00
Nick Mathewson
38c0bb3a99 r12651@Kushana: nickm | 2007-03-24 18:26:42 -0400
Initial version of circuit-based cell queues.  Instead of hammering or_conns with piles of cells, queue cells on their corresponding circuits, and append them to the or_conn as needed.  This seems to work so far, but needs a bit more work.  This will break the memory-use-limitation patch for begin_dir conns: the solution will be a fun but fiddly.


svn:r9904
2007-03-26 14:07:59 +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
Roger Dingledine
c36a6210a2 put the stopgap on whether we've sent a create cell, not
whether we've attached a stream.


svn:r9883
2007-03-20 03:26:51 +00:00
Nick Mathewson
7fcceb2c25 r12074@catbus: nickm | 2007-03-04 15:11:43 -0500
Make all LD_BUG log messsages get prefixed with "Bug: ".  Remove manually-generated "Bug: "s from log-messages.  (Apparently, we remembered to add them about 40% of the time.)


svn:r9733
2007-03-04 20:11:46 +00:00
Nick Mathewson
1a3e1c5510 r11970@catbus: nickm | 2007-02-27 19:17:27 -0500
Fix a bug found by Udo van den Heuvel: avoid an assertion failure when a controller sets and clears EntryNodes before the next call to choose_random_entry().  Also make a function static.


svn:r9669
2007-02-28 00:23:05 +00:00
Roger Dingledine
50f22e858a doc pedant
svn:r9634
2007-02-24 07:50:38 +00:00
Nick Mathewson
f599adf40a r11909@catbus: nickm | 2007-02-24 02:37:40 -0500
Move tricky "delete the member of the smartlist currently under iteration" logic into its own happyfun macro.


svn:r9633
2007-02-24 07:37:45 +00:00
Roger Dingledine
2015479b5a fix crash introduced in r9622
svn:r9632
2007-02-24 06:44:40 +00:00
Roger Dingledine
d63c58249e make it stop crashing when i exercise the new entrynodes behavior in
r9574. this hack is getting pretty darn hackish; perhaps it's time to
not use SMARTLIST_FOREACH in this situation.


svn:r9629
2007-02-24 04:17:29 +00:00
Nick Mathewson
f1d207b29a r11885@catbus: nickm | 2007-02-23 13:34:24 -0500
Fix an XXXX012: make entry guards _really_ get retried when the network comes back online.


svn:r9622
2007-02-23 18:34:35 +00:00
Nick Mathewson
d2893398f6 r11832@catbus: nickm | 2007-02-16 15:31:59 -0500
Fix 35 remaining DOCDOC comments. Yowza.


svn:r9596
2007-02-16 20:39:37 +00:00
Nick Mathewson
3c691b9da6 r11785@catbus: nickm | 2007-02-12 20:27:48 -0500
Node-picking fixes: Never warn when a down node is listed in a config option (bug 348); always warn when a node in a config option is unnamed.  Also, when entrynodes is configured, then build the guard list as: (parts of EntryNodes that were guards before), (the rest of EntryNodes), (the rest of the old guards).  This last point ensures that EntryNode users will get the EntryNodes they want with the minimum change to their guard list.


svn:r9574
2007-02-13 01:27:55 +00:00
Nick Mathewson
759c58151e r11775@catbus: nickm | 2007-02-12 16:39:09 -0500
Update copyright dates.


svn:r9570
2007-02-12 21:39:53 +00:00
Nick Mathewson
0c40a080a4 r11773@catbus: nickm | 2007-02-12 15:18:48 -0500
Implement proposal 106: stop requiring clients to have certificates, and stop checking for nicknames in certificates.  [See proposal 106 for rationale.]  Also improve messages when checking TLS handshake, to re-resolve bug 382.


svn:r9568
2007-02-12 21:39:33 +00:00
Nick Mathewson
e00a1cbf16 r11726@catbus: nickm | 2007-02-08 16:04:53 -0500
Resolve some XXXX012 items:
   - Remove PathlenCoinWeight: if we want it again, we can add it
     back in.
   - Ditto with RelayBandwidth*.
   - Decide to leave in the "hey, you didn't set end_reason!" BUG log message,
     but stop telling people to bug me personally.
   - Postpone strengthening assert_connection_ok(): it's important, but 
     it's also a good way to introduce weird bugs.
   - Move some expensive consistency checking from dns_free_all() into
     assert_cache_ok().


svn:r9533
2007-02-08 22:07:56 +00:00
Nick Mathewson
85d3c2fbaf r11702@catbus: nickm | 2007-02-08 02:10:19 -0500
Wow. Remember when I wrote that script to tell me about macros that were never used?  Good times.


svn:r9525
2007-02-08 07:24:15 +00:00
Roger Dingledine
9aa8e490f8 cleanups based on looking through svn commits
svn:r9491
2007-02-06 00:27:03 +00:00
Nick Mathewson
03ef2156c9 r11637@catbus: nickm | 2007-02-05 12:41:51 -0500
Fix an XXXX012, and make circuits_pending_or_conns a static variable.  In addition to cleaning up the code, this may also resolve Bug 386 if Roger has the right intuition there.


svn:r9482
2007-02-05 17:42:40 +00:00
Nick Mathewson
fefba95363 r11629@catbus: nickm | 2007-02-02 15:06:17 -0500
Removing the last DOCDOC comment hurt so much that I had to use Doxygen to identify undocumented macros and comments, and add 150 more DOCDOCs to point out where they were.  Oops.  Hey, kids!  Fixing some of these could be your first Tor patch!


svn:r9477
2007-02-02 20:06:43 +00:00
Nick Mathewson
76f896e714 r11607@catbus: nickm | 2007-01-30 17:19:27 -0500
Audit non-const char arguments; make a lot more of them const.


svn:r9466
2007-01-30 22:19:41 +00:00
Nick Mathewson
1894e7ea01 r11606@catbus: nickm | 2007-01-30 16:52:23 -0500
Write the entry guards section of path-spec; note a possible bug in cirbuitbuild.c; add a const; defer work on torrc.complete to be part of a bigger config documentation reorg.


svn:r9465
2007-01-30 22:19:31 +00:00
Roger Dingledine
d8d074f2e5 If the user asks to use invalid exit nodes, be willing to use the
unstable ones.


svn:r9441
2007-01-27 19:40:49 +00:00
Roger Dingledine
add7d7af19 Bring us one step closer to being able to establish an encrypted
directory tunnel without knowing a descriptor first. Still not
ready yet. As part of the change, now assume we can use a
create_fast cell if we don't know anything about a router.


svn:r9440
2007-01-27 19:29:16 +00:00
Nick Mathewson
71f47320f8 r11493@catbus: nickm | 2007-01-24 18:41:52 -0500
Use set_uint16/32 instead of raw assignments in order to make gcc happier.


svn:r9399
2007-01-24 23:42:00 +00:00
Nick Mathewson
792f819212 r11285@catbus: nickm | 2007-01-23 19:43:50 -0500
More documentation. (Again, trying to see whether I have buildbot working).


svn:r9394
2007-01-24 00:43:52 +00:00
Roger Dingledine
9f733c31cc minor cleanups
svn:r9387
2007-01-22 19:20:33 +00:00
Nick Mathewson
380f8983c7 r11966@Kushana: nickm | 2007-01-15 16:12:17 -0500
Tidy up ORCONN reason patch from Mike Perry.  Changes: make some of the handling of TLS error codes less error prone.  Enforce house style wrt spaces.  Make it compile with --enable-gcc-warnings.  Only set or_conn->tls_error in the case of an actual error.  Add a changelog entry.


svn:r9355
2007-01-15 21:21:05 +00:00
Nick Mathewson
ead35ef944 r11957@Kushana: nickm | 2007-01-15 15:25:57 -0500
Patch from Mike Perry: Track reasons for OR connection failure; display them in control events. Needs review and revision.


svn:r9354
2007-01-15 21:13:37 +00:00
Nick Mathewson
bba5a3533f r11679@Kushana: nickm | 2006-12-23 21:38:41 -0500
Update the state file less often when AvoidDiskWrites is set.


svn:r9174
2006-12-24 02:45:46 +00:00
Nick Mathewson
31e09bb524 r11614@Kushana: nickm | 2006-12-15 17:39:42 -0500
Implement SETEVENTS GUARD.  Needs review and testing.


svn:r9137
2006-12-15 22:40:20 +00:00
Roger Dingledine
c44dd3870e clarify our use of local time vs GMT
svn:r9109
2006-12-14 23:39:14 +00:00
Roger Dingledine
97c83a4c09 finish enabling begin-dir cells. require one-hop circs for
socks-command-connect-dir streams, so we don't open new anonymity
questions.


svn:r9099
2006-12-13 02:49:45 +00:00
Roger Dingledine
e206d22297 some more cleanups and a bugfix on r9052
svn:r9062
2006-12-10 08:04:50 +00:00
Roger Dingledine
f7319a0b6d correction and cleanups on r9047
svn:r9060
2006-12-09 19:40:16 +00:00
Nick Mathewson
cf04e1e6e7 r11479@Kushana: nickm | 2006-12-07 23:38:54 -0500
Refactor GETINFO into a table-driven dispatch, as suggested by arma.  My brain hurts.


svn:r9052
2006-12-08 04:39:13 +00:00
Nick Mathewson
7c79495137 r11468@Kushana: nickm | 2006-12-07 14:56:57 -0500
Revise logic used to flush state to disk. Now, we try to batch non-urgent changes so that we do not do too many writes, and we save very-non-urgent changes every once in a rare while, and we never save more than once per second.


svn:r9047
2006-12-07 20:11:30 +00:00
Nick Mathewson
aef64c1277 r9577@Kushana: nickm | 2006-11-20 11:07:28 -0500
Oops; fix bug in last fix. Time to get some coffee.


svn:r8970
2006-11-20 16:07:33 +00:00
Nick Mathewson
a667f2e514 r9567@Kushana: nickm | 2006-11-20 11:05:59 -0500
Fix leak in choose_good_exit_server_general()


svn:r8969
2006-11-20 16:06:09 +00:00
Roger Dingledine
77c8c0ee51 spec and implement some more status events. start to build
some conventions.


svn:r8805
2006-10-23 10:16:43 +00:00
Roger Dingledine
2a1c294717 implement a few status events, so we can make sure they work,
and so vidalia can start handling them if it wants.


svn:r8802
2006-10-23 05:51:46 +00:00
Nick Mathewson
b713b370bf r9060@totoro: nickm | 2006-10-17 11:12:48 -0400
Apply patch from Mike Perry: add more reasons for circuit destroys. (Slightly tweaked to avoid allocating a number for an "internal" reason.)


svn:r8739
2006-10-17 15:20:00 +00:00
Nick Mathewson
eca28f24f5 r9004@totoro: nickm | 2006-10-11 18:05:24 -0400
Add client support for a 'BadExit' flag, so authorities can say "Server X is a poor choise for your nytimes.com connections, as it seems to direct them to HoorayForMao.com or (more likely) WouldYouLikeToBuyTheseFineEncyclopedias.com"
 


svn:r8690
2006-10-11 22:06:01 +00:00
Roger Dingledine
655859f76b When reporting verbose nicknames in entry_guards_getinfo(), avoid
printing a duplicate "$" in the keys we send. (Reported by mwenge)


svn:r8681
2006-10-09 21:26:34 +00:00
Nick Mathewson
26283e69ba r8973@totoro: nickm | 2006-10-09 11:45:47 -0400
Touch up last patch (to add REASON to CIRC events): make some reasons
 more sensible, send reasons only to controllers that have enabled
 extended events, and clean up whitespace.
 
 


svn:r8672
2006-10-09 15:47:50 +00:00
Nick Mathewson
b76fd968b4 r8972@totoro: nickm | 2006-10-09 10:36:22 -0400
Patch from Mike Perry: add a REASON field to closed and failed circ events.


svn:r8671
2006-10-09 15:47:27 +00:00
Roger Dingledine
604b13c910 remove some old debugging code
svn:r8657
2006-10-08 23:20:43 +00:00
Nick Mathewson
ea00437f74 r8933@totoro: nickm | 2006-10-07 20:33:16 -0400
whitespace fixes; add changelog for last commit.


svn:r8644
2006-10-08 00:33:43 +00:00
Nick Mathewson
e230fe8ea6 r8926@totoro: nickm | 2006-10-07 15:56:14 -0400
refactor circuit_list_path and circuit_list_path_verbose into a common _impl function.


svn:r8642
2006-10-07 19:56:49 +00:00
Roger Dingledine
9fb98b269c finish poking and prodding. i'm all happy now.
svn:r8633
2006-10-07 09:13:30 +00:00
Roger Dingledine
f2bd0e2f16 more minor cleanups
svn:r8630
2006-10-07 06:28:50 +00:00
Roger Dingledine
4f3827f1d1 resolve the entryguard uptime/capacity question. and mark a
new xxx that we'll want to address one day.


svn:r8628
2006-10-07 02:55:44 +00:00
Roger Dingledine
06e5b2283c minor cleanups
svn:r8622
2006-10-07 00:50:39 +00:00
Roger Dingledine
1cf37f90c4 bugfix and cleanups re: entry guards.
svn:r8620
2006-10-06 23:37:07 +00:00
Nick Mathewson
50320ac420 r8862@totoro: nickm | 2006-10-03 14:54:14 -0400
Make verbose names get used (when appropriate and selected) in responses to getinfo requests.


svn:r8593
2006-10-03 19:00:18 +00:00
Nick Mathewson
6e0b90a902 r8838@totoro: nickm | 2006-10-02 15:24:39 -0400
Partial implementation of revised nickname syntax for controllers.  Implement ability to look up routers by "verbose" nicknames; add a per-v1-control-connection flag to turn the feature on in events.  Needs testing, spec, ability to actually turn on the flag, double-checking that we wont overflow any nickname buffers, and changelog.


svn:r8582
2006-10-03 18:58:40 +00:00
Roger Dingledine
246fecb585 the other half of the is_local_IP patch
svn:r8581
2006-10-03 05:45:58 +00:00
Nick Mathewson
4c56ac93ca r8851@totoro: nickm | 2006-10-02 18:13:27 -0400
Remove/clarify some XXXs for no longer being accurate; for begin things we do not indend to fix; for already being parts of big todo issues (like "/* XXX ipv6 */"); etc. Also fix some spaces.


svn:r8580
2006-10-02 22:13:42 +00:00
Nick Mathewson
57ffca883d r8826@totoro: nickm | 2006-10-01 17:58:45 -0400
Disprefer exit nodes for entry, middle positions (fixes bug 200).  Also, switch to using a uint64_t to hold "total bandwidth for all nodes" under consideration; crypt_rand_int would have died at 2GB/s network capacity.


svn:r8571
2006-10-01 21:59:09 +00:00
Nick Mathewson
ce72a9914e r8822@totoro: nickm | 2006-10-01 16:24:22 -0400
Fix bug 303: reject attempts to use Tor as a one-hop proxy.


svn:r8566
2006-10-01 20:50:11 +00:00
Nick Mathewson
723ff1c93d r8800@totoro: nickm | 2006-09-29 23:10:49 -0400
Resolve bug 336: When displaying circuit paths with non-named routers, use their digests, not their nicknames.


svn:r8548
2006-09-30 03:11:13 +00:00
Nick Mathewson
1a444e089a r8976@Kushana: nickm | 2006-09-28 17:18:57 -0400
Another tweak to guard logic: ignore check for the Guard flag if a server is listed on EntryNodes.  (Also remove redundant checks for always-set variables.)


svn:r8522
2006-09-28 23:57:56 +00:00
Nick Mathewson
d174cccd0b r8975@Kushana: nickm | 2006-09-28 17:13:53 -0400
Document entry-guard related functions


svn:r8521
2006-09-28 23:57:52 +00:00
Nick Mathewson
d3a06684bc r8974@Kushana: nickm | 2006-09-28 17:05:59 -0400
Improvement to last entry guards patch: track when we last attempted to connect to a node in our state file along with how long it has been unreachable.  Also clarify behavior of parse_iso_time() when it gets extra characters.


svn:r8520
2006-09-28 23:57:49 +00:00
Nick Mathewson
9988112c87 r8973@Kushana: nickm | 2006-09-28 16:53:19 -0400
Refactor entry guard status logic a lot; allow more factors [like not
 having a Guard flag or being listed in ExcludeNodes] to render a guard
 "unlisted" (now called "unusable"); track guard down status (now
 called "unreachable") separately from is_running.


svn:r8519
2006-09-28 23:57:44 +00:00
Roger Dingledine
c22dc94fe6 make my bandwidth exercises actually happen
svn:r8400
2006-09-15 05:53:00 +00:00
Nick Mathewson
09a895e222 r7324@Kushana: nickm | 2006-08-10 23:23:15 -0700
Add more warnings to the list of those we tolerate. Start using GCC attributes more, for better error checking and better code generation.


svn:r7020
2006-08-11 07:09:17 +00:00
Roger Dingledine
2bcb081cb1 defense in depth
svn:r6939
2006-07-30 04:32:58 +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
Nick Mathewson
7239262f71 Don't tell anybody, but we're going OO here. This patch splits
circuit_t into origin_circuit_t and or_circuit_t.  I fixed some
segaults; there may be more.  We still need to move more rendezvous
stuff into subtypes.

This is a trial run for splitting up connection_t; if the approach is
insane, please say so soon so we can do something smarter.

Also, this discards the old HALF_OPEN code, which nobody seems to
want.


svn:r6817
2006-07-23 07:37:35 +00:00
Roger Dingledine
9283ddb760 an entry guard that is "unlisted", as well as not known to be "down", is
not therefore "up".


svn:r6798
2006-07-21 07:06:18 +00:00
Roger Dingledine
237c7ecbfd tweak
svn:r6796
2006-07-20 23:45:26 +00:00
Roger Dingledine
42e2057d67 fix some more places where we shouldn't crash if we can't build
our own descriptor yet.


svn:r6775
2006-07-17 06:54:28 +00:00
Roger Dingledine
0ec293b189 actually, that excludenodes fix was redundant. take it out.
svn:r6727
2006-07-05 18:19:42 +00:00
Roger Dingledine
98c6bf6192 oops, we were ignoring options->ExcludeNodes when picking entry guards.
it is still the case that we ignore it with respect to entry guards
that we've already picked.


svn:r6726
2006-07-04 20:25:17 +00:00
Roger Dingledine
dc79dd6a46 minor fixes
svn:r6709
2006-07-04 03:19:59 +00:00
Roger Dingledine
d45757ebcb also remove word 'middleman' from a log notice
svn:r6704
2006-06-29 13:11:23 +00:00
Roger Dingledine
37c441d96f correct a function comment in compute_preferred_testing_list()
svn:r6660
2006-06-18 21:07:45 +00:00
Roger Dingledine
4e4cc9aa27 lower the number of seconds before we yell about clock jump.
and make the yelling only happen if you're a server.


svn:r6625
2006-06-15 09:03:15 +00:00
Roger Dingledine
de7a9c83d8 upgrade the severity of the 'clock jump' warn, and ask people
to report if it occurs.


svn:r6623
2006-06-14 22:28:16 +00:00
Roger Dingledine
09dfe1b265 bugfix: discourage picking directory authorities as our TestVia
hops, even if they're running the right versions, since we probably
already have a connection established to them.


svn:r6622
2006-06-14 11:06:43 +00:00
Roger Dingledine
977574e48d back off and add the $ at the beginning of the preferrednodes list
we generate.


svn:r6620
2006-06-13 12:57:19 +00:00
Roger Dingledine
23e2c6a7dd first cut at a workaround for the reachability bug: explicitly find a
server running the right version, if we can, and ask for that one.


svn:r6616
2006-06-13 10:25:22 +00:00
Roger Dingledine
279e86f3c8 Defense in depth: fix the reachability bug a second way too.
Now if we establish a connection with the right digest, regardless
of what the addr/port is, and we have pending create cells, use it.


svn:r6614
2006-06-13 05:51:28 +00:00
Roger Dingledine
889b8d5bac Add a new config option TestVia, that lets you specify preferred middle
hops to use for testing circuits. Perhaps this will let me debug the
reachability problem better.


svn:r6581
2006-06-10 00:26:39 +00:00
Roger Dingledine
6531a31aad actually, don't fix it that far. we should still do some
error checking.


svn:r6576
2006-06-09 09:07:59 +00:00
Roger Dingledine
0071d67efd when only one router is labelled as a guard, and we've
already picked him, we would cycle endlessly picking him
again, being unhappy about it, and so forth.

now we specifically exclude guards when picking a new guard.


svn:r6575
2006-06-09 09:02:32 +00:00
Roger Dingledine
1e9b35aee3 make connection_or_nonopen_was_started_here() based on something less
voodooey. it turns out we already do keep a flag like that around.


svn:r6560
2006-06-07 07:11:42 +00:00
Roger Dingledine
96914760bc fix the bug where we sometimes would fail to send some create cells
once we'd connected to a(nother) tor server.


svn:r6552
2006-06-06 03:33:24 +00:00
Roger Dingledine
a2fec314b6 scream louder if you've got a pending circuit for a given
addr/port but the intended n_conn digest is wrong.


svn:r6544
2006-06-05 09:47:19 +00:00
Roger Dingledine
4e773352c2 bugfix: if we are making our first ever connection to any entry
guard, then don't mark it down at first. we had this implemented
but it was disabled due to a bug.


svn:r6541
2006-06-05 08:58:18 +00:00
Roger Dingledine
bf09898f79 Note a bug that causes servers to sometimes never send the pending
create cell. Nick, is this a bug? If so, is my fix right?


svn:r6538
2006-06-05 07:27:48 +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
1f0e20806b END_CIRC_REASON_OR_IDENTITY apparently means that we were told to
connect to a different OR than lives on the addr:port we connected
to. we don't actually remember whether that was the case, currently.
so call it END_CIRC_REASON_OR_CONN_CLOSED as a compromise.


svn:r6515
2006-05-30 06:17:28 +00:00
Roger Dingledine
1e4923652b simplify a log message
svn:r6512
2006-05-30 05:29:03 +00:00
Roger Dingledine
701341ef8a put one of the XXX's back in
svn:r6422
2006-04-25 07:06:48 +00:00
Nick Mathewson
6ebd886511 forward-port: "Resolve" all XXX011 items, mostly by marking them non-011.
svn:r6396
2006-04-18 03:07:24 +00:00
Nick Mathewson
785d25e06c If I could forget that I had enabled StrictExitNodes, others will too.
svn:r6295
2006-04-02 22:59:59 +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
b899b9592a When the controller's *setconf commands fail, collect an error message
in a string and hand it back. This starts to resolve bug 275.


svn:r6241
2006-03-26 06:51:26 +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
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
7d141c6776 but i made the line too long
svn:r6176
2006-03-17 19:25:36 +00:00
Roger Dingledine
f1bcc2d6f8 stop tricking server operators into thinking they got their
torrc perfect, just because tor could build a circuit.


svn:r6175
2006-03-17 19:20:07 +00:00
Roger Dingledine
8d1f65a222 quiet another entry guard log message
svn:r6169
2006-03-15 22:48:48 +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
Roger Dingledine
86a72f73b9 make entry guard logs even quieter
svn:r6116
2006-03-10 16:51:26 +00:00
Roger Dingledine
82d1fdbaea don't abandon entry guards until they've been dead a whole month.
make entry guard log messages quieter.


svn:r6106
2006-03-09 00:55:55 +00:00
Roger Dingledine
2bfd2a2400 clean up a log message
svn:r6074
2006-02-21 17:54:56 +00:00
Peter Palfrader
5eea6c76df Split ReachableAddresses into ReachableDirAddresses and ReachableORAddresses
svn:r6009
2006-02-13 21:17:20 +00:00
Roger Dingledine
36484f873a convert some more source files to the new log convention
svn:r6002
2006-02-13 08:28:42 +00:00
Roger Dingledine
3c4e68488b Clients now honor the "guard" flag in the router status when
picking entry guards, rather than looking at is_fast or is_stable.

Now dirservers can change how they define it and clients will
automatically use their new definition.


svn:r5979
2006-02-12 03:43:39 +00:00
Roger Dingledine
5f051574d5 Happy new year!
svn:r5949
2006-02-09 05:46:49 +00:00
Roger Dingledine
1c596156aa tweak comment
svn:r5930
2006-02-09 00:08:23 +00:00
Roger Dingledine
bdba6e42dc avoid a minor confusing log message
svn:r5887
2006-02-01 03:05:52 +00:00
Roger Dingledine
8fc44169e5 only start testing reachability once we've established a circuit.
this will make startup on dirservers less noisy.
it may also break things in subtle ways.


svn:r5878
2006-01-29 01:11:41 +00:00
Roger Dingledine
cca9a2f7b0 oh, and the other bits of the commit
svn:r5836
2006-01-17 04:03:23 +00:00
Roger Dingledine
5ca40affeb we were leaking a smartlist every time we built a circuit
svn:r5795
2006-01-11 04:14:10 +00:00
Nick Mathewson
8907391ad6 Fix wide lines
svn:r5793
2006-01-11 04:04:42 +00:00
Roger Dingledine
284fe9cad5 if we learn that a down entry guard is up, count our working entry
guards correctly when logging.


svn:r5791
2006-01-11 03:58:59 +00:00
Roger Dingledine
7d1f675c85 entry nodes are now entry guards.
this is our last easy chance for a wholesale change. heave ho.


svn:r5782
2006-01-10 22:42:44 +00:00
Roger Dingledine
210d9db54d and even more so
svn:r5776
2006-01-10 21:01:30 +00:00
Roger Dingledine
aea0a78254 make entry node logging slightly less chatty.
still quite chatty. it's an alpha, that's ok.


svn:r5775
2006-01-10 20:59:39 +00:00
Roger Dingledine
9796733e89 "Pending" is a bad term for a circuit that uses your server as its last hop.
svn:r5751
2006-01-07 02:31:14 +00:00
Roger Dingledine
f88fa3efc1 helper nodes are dead
svn:r5743
2006-01-07 00:41:50 +00:00
Nick Mathewson
878962bee1 Add reasons to DESTROY and RELAY_TRUNCATED cells.
svn:r5734
2006-01-05 21:23:03 +00:00
Roger Dingledine
1d474e14d7 strictentrynodes means we should clear the current entry_nodes list.
svn:r5703
2006-01-02 11:33:14 +00:00
Roger Dingledine
1a11b97b15 get rid of the special case for 'testing' circuits
svn:r5684
2005-12-31 06:37:34 +00:00
Roger Dingledine
5947388968 Finish implementing config's EntryNodes and StrictEntryNodes option.
The logging is way verbose for now.


svn:r5683
2005-12-31 06:32:57 +00:00
Roger Dingledine
dbd7b97eff helper nodes are dead. long live entry nodes.
(config options EntryNodes and StrictEntryNodes still not
implemented.)


svn:r5673
2005-12-28 09:07:31 +00:00
Roger Dingledine
5d9256a367 but only close the new conn if one of the earlier helper nodes
that we mark up is actually reachable, fast enough, etc to use.


svn:r5672
2005-12-28 07:27:41 +00:00
Roger Dingledine
c1145138ea but only close it if we have marked an earlier helper as up.
that way we don't close it too needlessly.


svn:r5671
2005-12-28 07:20:33 +00:00
Roger Dingledine
60cd03069a when we connect to a helper node for the first time, close
that connection and its circuits. this lets us go back to
using the old helper nodes rather than immediately using
the last one in the list.


svn:r5670
2005-12-28 07:19:55 +00:00
Roger Dingledine
f46c135fac when we succeed at connecting to a helper that we've never connected
to before, mark all the previous helpers as up. This is handy if the
network went away and then returned.


svn:r5666
2005-12-27 08:54:37 +00:00
Roger Dingledine
25fcb5fa9c helpful log
svn:r5665
2005-12-27 08:38:22 +00:00
Roger Dingledine
976bf06463 slightly more accurate log messages
svn:r5664
2005-12-27 07:37:21 +00:00
Roger Dingledine
25052c6f4b first cut of the new helper stuff. seems to work in the normal
case, but many edge cases still need testing.


svn:r5663
2005-12-27 07:23:52 +00:00
Nick Mathewson
d94b9fd7d2 normalize spaces
svn:r5658
2005-12-27 04:52:34 +00:00
Roger Dingledine
815df977cf comments? i'll show you comments.
svn:r5652
2005-12-26 05:52:44 +00:00
Roger Dingledine
40c267a89f prevent a rare infinite loop on two-byte architectures,
and be more thorough and starting over when the clock jumps.


svn:r5647
2005-12-25 04:37:33 +00:00
Roger Dingledine
7e0d62b14a stop being sneaky, especially if we're being incorrectly sneaky
svn:r5646
2005-12-24 23:39:20 +00:00
Roger Dingledine
b0144276db more comments, and start to use the made_contact entry.
svn:r5645
2005-12-24 23:32:35 +00:00
Roger Dingledine
35986a2374 simplify because we weren't using those return values anyway
svn:r5643
2005-12-24 22:48:12 +00:00
Roger Dingledine
3a2ce447b4 start to document the helper node functions
svn:r5642
2005-12-24 20:07:19 +00:00
Roger Dingledine
7cd46d7f95 fix a seg fault when you finish connecting to a server but
at that moment you dump his server descriptor, and you also
happen to be logging at loglevel info.
(found by weasel)


svn:r5615
2005-12-18 22:59:47 +00:00
Nick Mathewson
1af630d32c Bite the bullet and limit all our source lines to 80 characters, the way IBM intended.
svn:r5582
2005-12-14 20:40:40 +00:00
Roger Dingledine
d853c9a009 bugfix: when we removed a dead helper node, we never committed that
change to disk.


svn:r5576
2005-12-13 02:52:38 +00:00
Roger Dingledine
bf4da967c1 Don't use helper nodes for circuits with purpose 'testing'.
Also, when picking the helper node for a given circuit,
exclude the circuit's exit from your choices.


svn:r5569
2005-12-11 12:14:26 +00:00
Roger Dingledine
a131783c8b when removing dead helpers, only write or_state to disk once at the
end, not for every helper you remove.


svn:r5568
2005-12-11 11:56:17 +00:00
Roger Dingledine
9c01fa3d59 fix yet another time comparison bug. we were abandoning helpers
as soon as they became unavailable. (is this true?)


svn:r5565
2005-12-11 11:23:36 +00:00
Roger Dingledine
f3349d6ed3 fix an error in reporting why we abandoned a helper node
svn:r5564
2005-12-11 11:20:26 +00:00
Roger Dingledine
b974f67c01 choose helper nodes to have high capacity always
svn:r5563
2005-12-11 11:20:01 +00:00
Roger Dingledine
defa3804cf explain why 0.1.1.9-alpha-cvs is a special version.
svn:r5552
2005-12-10 21:07:21 +00:00
Roger Dingledine
58366ffd24 when we changed from log_fn to debug/info/notice/warn/err,
we screwed up the formatting in wild and unpredictable ways.

fix it before it becomes convention to format logs in wild and
unpredictable ways.

still need to do src/common/ someday.


svn:r5551
2005-12-10 09:36:26 +00:00
Roger Dingledine
9b0a40ec78 crank the max line limit down to 150 chars.
svn:r5550
2005-12-10 08:27:01 +00:00
Roger Dingledine
8730190914 when we're checking reachability, make it clearer in the logs
what to expect.


svn:r5538
2005-12-08 21:12:47 +00:00
Roger Dingledine
d3dcea08af remove a redundant memcpy when extending to a new server
and attaching circuits to it.


svn:r5537
2005-12-08 20:33:57 +00:00
Nick Mathewson
e9b66ec906 Document CREATE_FAST better in the code. Move our key expansion algorithm into a separate function in crypto.c
svn:r5530
2005-12-08 17:38:32 +00:00
Nick Mathewson
f031ee8246 Make clients use CREATE_FAST cells. add an option to disable this.
svn:r5524
2005-12-07 22:09:02 +00:00
Roger Dingledine
4902ece698 what the heck is wrong with this little piece of code?
why can none of us get it right?
it looks so simple.


svn:r5521
2005-12-07 04:43:39 +00:00
Nick Mathewson
1b0134dda8 Clean up some comments; remove some dead code
svn:r5493
2005-12-03 16:32:29 +00:00
Nick Mathewson
148a1e969d Shave off another 4.7%: remove a linear search when figuring out which circuits wanted us to open a given OR connection.
svn:r5489
2005-12-03 02:12:37 +00:00
Nick Mathewson
3bd613b44d Rename connection_get_by_identity_digest to reflect that it is OR-only. Make it use a hashtable instead of a linear search.
svn:r5469
2005-11-30 03:01:16 +00:00
Roger Dingledine
2350e487a2 minor cleanup
svn:r5454
2005-11-24 06:44:13 +00:00
Roger Dingledine
ea7fe0c267 Fix a bug found by Lasse Overlier: when we were making internal circuits
(intended to be cannibalized later for rendezvous and introduction
circuits), we were picking them so that they had useful exit nodes. There
was no need for this, and it actually aids some statistical attacks.


svn:r5453
2005-11-24 06:43:39 +00:00
Roger Dingledine
5b583073a1 remove some more dead code (found while hunting lasse's bug)
svn:r5452
2005-11-24 06:06:50 +00:00
Roger Dingledine
7aae63994f Recover better from TCP connections to Tor servers that are broken but
don't tell you (it happens!); and rotate TLS connections once a week.

1) If an OR conn becomes more than a week old, make it obsolete.
2) If it's obsolete and empty, kill it.
3) When an OR makes a second connection to you, allow it.
4) If we want to send a new create cell, but the best conn we've
   got is obsolete, and the router is 0.1.1.9-alpha-cvs or later, ask
   for a new conn instead.
5) When we time out on circuit building on the first hop, make that
   connection obsolete.


svn:r5429
2005-11-19 06:57:44 +00:00
Roger Dingledine
f824fb5f83 Bugfix: it looks like some middleman circuits were spending the
first few moments of their existence in CIRCUIT_STATE_OPEN, then
when Alice sent an extend request for a Tor that they're not connected
to, they switched to CIRCUIT_STATE_OR_WAIT and spent the rest of
their sorry little lives in that state, even when the connection
was established and they were shuttling relay cells back and forth.

And I'm not going to backport this (yet), because somehow it worked!


svn:r5427
2005-11-19 01:55:58 +00:00
Nick Mathewson
75d85c8214 On directory servers, old_routers was wasting hundreds of bytes per superseded router descriptor. Roll the signed descriptor info and identifying info into a cache_info struct, and use only that for old_routers.
svn:r5349
2005-11-05 20:15:27 +00:00
Roger Dingledine
44b3f3060a make circ->onionskin a pointer, not a static array. moria2 was using
125000 circuit_t's after it had been up for a few weeks, which translates
to 20+ megs of wasted space.


svn:r5333
2005-10-29 19:13:48 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Nick Mathewson
26caf69555 Fix possible minor memory leak when parsing helpernode state
svn:r5305
2005-10-25 07:00:03 +00:00
Nick Mathewson
fa338d85db Fix one possible source of reuse-a-circuit-id bug; convert circuitbuild to new logging
svn:r5301
2005-10-24 19:37:45 +00:00
Nick Mathewson
3347c1741d Refactor routerlist access slightly: always use router_get_by_routerlist(); change its interface; add modifier functions to add/remove elements from the current routerlist (so we can add indices).
svn:r5276
2005-10-18 17:43:54 +00:00
Roger Dingledine
bec2271029 fix a few comments
svn:r5262
2005-10-17 08:41:58 +00:00
Peter Palfrader
7b15f77dd6 Make a few INFO log lines into DEBUG
svn:r5257
2005-10-17 02:13:36 +00:00
Roger Dingledine
ae92a91d96 more log uncluttering
svn:r5254
2005-10-17 01:29:28 +00:00
Nick Mathewson
905ef987e2 Make --hash-password not craash on exit.
svn:r5243
2005-10-12 19:08:48 +00:00
Nick Mathewson
61ea516885 Check for named servers when looking them up by nickname;
warn when we'recalling a non-named server by its nickname;
don't warn twice about the same name.

Fix a bug in routers_update_status_from_networkstatus that made nearly
all clients never update routerinfo_t.is_named.

Try to list MyFamily elements by key, not by nickname.

Only warn about names that we generated ourself, or got from the local
user.

On TLS handshake, only check the other router's nickname against its
expected nickname if is_named is set.


svn:r5185
2005-10-04 22:23:31 +00:00
Roger Dingledine
88c37f2d24 comment cleanups
svn:r5181
2005-10-04 06:53:59 +00:00
Nick Mathewson
9e54e2e293 free helper node status info on shutdown
svn:r5177
2005-09-30 21:38:57 +00:00
Nick Mathewson
5c53545d81 Add a bunch more warnings to out warning suite; resolve them; pack structs a little better.
svn:r5150
2005-09-29 22:59:17 +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
922cee3d0c Clean up a few warnings that make gcc twig out a bit.
svn:r5062
2005-09-14 20:59:25 +00:00
Roger Dingledine
26cc51ffea a bit more code cleanup
svn:r5033
2005-09-13 21:24:51 +00:00
Roger Dingledine
1d9786a392 generalize route length to three plus one if the exit node is risky.
svn:r4978
2005-09-10 01:01:40 +00:00
Roger Dingledine
69da0ef757 add punctuation
svn:r4924
2005-09-08 06:49:02 +00:00
Nick Mathewson
e863771485 Log when falling back to nonfast/nonstabl routers
svn:r4869
2005-08-26 22:16:32 +00:00
Roger Dingledine
6577e08e38 when we're trying to build a circuit and we're being picky about what
sort we get but there aren't any suitable servers, try being less picky
rather than simply failing.


svn:r4867
2005-08-26 22:10:22 +00:00
Roger Dingledine
23ed3c9786 whoops, avoid printing a null string sometimes
svn:r4815
2005-08-22 22:58:38 +00:00
Roger Dingledine
435d2d8fde when we begin reachability testing, log the address:port for each
port we're testing, so people are more likely to notice that they're
using the wrong ip address.


svn:r4808
2005-08-22 05:46:02 +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
Nick Mathewson
789374dbbd Make GCC very happy, even with lots of warnings set. Also, try to fix some reported Solaris x86 warnings.
svn:r4770
2005-08-12 17:24:53 +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
4cb89fd557 Implement some more GETINFO goodness: expose helper nodes, config options, getinfo keys.
svn:r4694
2005-08-04 19:56:41 +00:00
Nick Mathewson
d90841ff5a Fix bug in state parsing
svn:r4681
2005-07-28 19:08:51 +00:00
Nick Mathewson
299af3d393 Possibly broken implementation of persistant state; handles helper nodes; does not handle accounting info yet.
svn:r4680
2005-07-28 19:01:48 +00:00