Commit Graph

497 Commits

Author SHA1 Message Date
Nick Mathewson
b998fed9b9 Remove support for events without the extended format or long names.
Supporting the old formats made our code complex; running without them
has been discouraged since 0.2.1.x.
2009-05-25 12:52:25 -04:00
Karsten Loesing
9b32e8c141 Update copyright to 2009. 2009-05-04 11:28:27 -04:00
Karsten Loesing
4ebcc4da34 Update copyright to 2009. 2009-05-02 22:00:54 +02:00
Roger Dingledine
235a1196b3 only log that at loglevel notice if there's a problem with the
version. otherwise there's no reason to tell the user we're
doing behind-the-scenes cleaning.


svn:r19288
2009-04-11 12:06:27 +00:00
Roger Dingledine
48118b228e Clients replace entry guards that were chosen more than a few months
ago. This change should significantly improve client performance,
especially once more people upgrade, since relays that have been
a guard for a long time are currently overloaded.


svn:r19287
2009-04-11 12:00:18 +00:00
Nick Mathewson
a335b43a67 If we have a routerstatus but no routerinfo to name a router, use the routerstatus instead when generating circuit events. Also refactor a little.
svn:r19078
2009-03-18 19:30:30 +00:00
Roger Dingledine
5d50bc3e1d We were already rejecting relay begin cells with destination port
of 0. Now also reject extend cells with destination port or address
of 0. Suggested by lark.


svn:r18812
2009-03-09 00:53:42 +00:00
Nick Mathewson
261670b57e Patch from lark: if we get two extend cells for the same circuit id, drop the second. Previously, we had leaked an extend_info if the target connection was not open when the second arrived.
svn:r18668
2009-02-21 19:07:05 +00:00
Roger Dingledine
decdf4537a If we're using bridges and our network goes away, be more willing
to forgive our bridges and try again when we get an application
request. Bugfix on 0.2.0.x.


svn:r18396
2009-02-04 23:27:35 +00:00
Nick Mathewson
0d5f4d4e73 Remove some dead code.
svn:r18301
2009-01-28 17:36:34 +00:00
Nick Mathewson
c4b8fef362 Remove svn $Id$s from our source, and remove tor --version --version.
The subversion $Id$ fields made every commit force a rebuild of
whatever file got committed.  They were not actually useful for
telling the version of Tor files in the wild.

svn:r17867
2009-01-04 00:35:51 +00:00
Roger Dingledine
89d268848f take out my IMPOSSIBLE_TO_DOWNLOAD+1 hack
svn:r17850
2009-01-02 20:46:32 +00:00
Roger Dingledine
dfc6555ddd switch over the bridge descriptor download mechanism to
use the same download mechanism as other places.

i had to make an ugly hack around "IMPOSSIBLE_TO_DOWNLOAD+1".
we should unhack that sometime.


svn:r17834
2008-12-31 14:19:57 +00:00
Nick Mathewson
8625297cee Actually log reasons on unusable guards again.
svn:r17822
2008-12-29 20:17:20 +00:00
Nick Mathewson
df608fef45 Checkpoint my big bug-891 patch.
svn:r17757
2008-12-24 02:38:04 +00:00
Nick Mathewson
1e666bfcc1 Partially apply bug 891 parch from forest: check EXTEND cell address against real_addr, not addr. I have questions about the rest of the patch: see the flyspray entry.
svn:r17730
2008-12-22 16:22:04 +00:00
Nick Mathewson
55348884b5 Fix all of the doxygen warnings not pertaining to missing documentation.
svn:r17727
2008-12-22 14:56:16 +00:00
Nick Mathewson
a259af179b When we need to open a new origin circuit, log why.
svn:r17705
2008-12-19 18:51:49 +00:00
Nick Mathewson
122170c1d3 Downlgrade tweak, and answer lots of XXX021s. No actual code fixes in this patch.
svn:r17686
2008-12-18 16:11:24 +00:00
Nick Mathewson
26632d59dd Rename or_is_obsolete and move it to or_connection_t where it belongs.
svn:r17642
2008-12-17 14:59:19 +00:00
Nick Mathewson
e53ffaa4e4 Don't extend circuits over noncanonical connections with mismatched addresses.
Also, refactor the logic to check whether we will use a connection or
launch a new one into a new function.

svn:r17628
2008-12-15 21:17:53 +00:00
Roger Dingledine
e5be0504ab When the client is choosing entry guards, now it selects at most
one guard from a given relay family. Otherwise we could end up with
all of our entry points into the network run by the same operator. 
Suggested by Camilo Viecco. Fix on 0.1.1.11-alpha.

Not a backport candidate, since I think this might break for users
who only have a given /16 in their reachableaddresses, or something
like that.


svn:r17514
2008-12-08 00:04:29 +00:00
Roger Dingledine
ebe4ef12b9 when building preemptive circuits, ignore streams that have a
chosen exit node in mind already. otherwise we get tricked into
trying to build a new circuit that will handle them.


svn:r17184
2008-11-03 07:00:56 +00:00
Roger Dingledine
3e5a584d37 fix the other half of r17091. now that best_support can be -1,
we were complaining about no support for our one-hop streams,
when in fact choose_good_exit_server_general() has no business
caring about one-hop streams. patch from miner.


svn:r17181
2008-11-01 23:49:14 +00:00
Nick Mathewson
846e40d193 Patch from rovv: when we have no pending streams, choose exits with choose_good_exit_server_general() rather than with circuit_get_unhandled_ports() and friends. Bugfix on 0.1.1.x, at least.
svn:r17091
2008-10-14 17:05:52 +00:00
Roger Dingledine
c9bddb24b2 another coverity-found memory leak
svn:r17062
2008-10-12 03:21:05 +00:00
Roger Dingledine
95aace5aae minor memory leak found by coverity
svn:r17061
2008-10-12 03:19:17 +00:00
Nick Mathewson
745e5b0e22 Make sure ExcludeSingleHopRelays works for an exit.
svn:r16984
2008-09-26 19:09:12 +00:00
Nick Mathewson
e147e867be Proposal 152 implementation from Josh Albrecht, with tweaks.
svn:r16983
2008-09-26 18:58:45 +00:00
Nick Mathewson
8bbbbaf87b Add country-code support to configured node lists to implement the ever-popular "no exits in Monaco" feature (ExcludeExitNodes {MC}). Also allow country codes and IP ranges in ExitNodes. (EntryNodes needs more work.) Based on code by Robert Hogan. Needs more testing.
svn:r16966
2008-09-25 20:21:35 +00:00
Nick Mathewson
545b317e1f Fix for bug 797 (by arma, with tweaks): always use create_fast for circuits where we do not know an onion key.
svn:r16942
2008-09-23 20:13:23 +00:00
Roger Dingledine
cfff21e78a backport candidate:
If not enough of our entry guards are available so we add a new
one, we might use the new one even if it overlapped with the
current circuit's exit relay (or its family). Anonymity bugfix
pointed out by rovv.


svn:r16698
2008-08-31 06:33:39 +00:00
Roger Dingledine
8f5642edbc Relays now reject risky extend cells: if the extend cell includes
a digest of all zeroes, or asks to extend back to the relay that
sent the extend cell, tear down the circuit. Ideas suggested
by rovv.


svn:r16605
2008-08-20 05:21:43 +00:00
Nick Mathewson
960a0f0a99 r17641@31-33-44: nickm | 2008-08-05 16:07:53 -0400
Initial conversion of uint32_t addr to tor_addr_t addr in connection_t and related types.  Most of the Tor wire formats using these new types are in, but the code to generate and use it is not.  This is a big patch.  Let me know what it breaks for you.


svn:r16435
2008-08-05 20:08:19 +00:00
Roger Dingledine
d01813a8dd Take out the TestVia config option, since it was a workaround for
a bug that was fixed in Tor 0.1.1.21.


svn:r16409
2008-08-05 00:12:05 +00:00
Karsten Loesing
d166b9dc45 Make check-spaces happy.
svn:r16406
2008-08-04 23:39:07 +00:00
Karsten Loesing
3c9cd463d2 Fix a false assertion when extending a circuit to a relay to which a connection is already established. In that case the circuit should not need to memorize extend info for that relay. circuitbuild.c:389 contains a similar assertion.
svn:r16375
2008-08-03 17:45:24 +00:00
Nick Mathewson
186097906d r17436@tombo: nickm | 2008-07-30 09:03:19 -0400
Move n_addr, n_port, and n_conn_id_digest fields of circuit_t into a separately allocated extend_info_t.  Saves 22 bytes per connected circuit_t on 32-bit platforms, and makes me more comfortable with using tor_addr_t in place of uint32_t n_addr.


svn:r16257
2008-07-30 13:04:32 +00:00
Nick Mathewson
ed781e6971 r17338@aud-055: nickm | 2008-07-24 11:21:06 +0200
Refactor the router_choose_random_node interface: any function with 10 parameters, most of which are boolean and one of which is unused, should get refactored like this.


svn:r16167
2008-07-24 09:22:34 +00:00
Nick Mathewson
2748afe609 r17322@aud-055: nickm | 2008-07-23 16:50:50 +0200
Make circid_t and streamid_t get used instead of uint16_t; it is possible we will soon want to make circid_t change to uint32_t.


svn:r16155
2008-07-23 15:58:30 +00:00
Nick Mathewson
15b2b8bd69 r17309@aud-055: nickm | 2008-07-23 16:05:43 +0200
Patch from Christian Wilms: remove (HiddenService|Rend)(Exclude)?Nodes options.  They never worked properly, and nobody seems to be using them.  Resolves bug 754.


svn:r16144
2008-07-23 14:07:32 +00:00
Nick Mathewson
087094961b r17302@aud-055: nickm | 2008-07-23 14:55:28 +0200
Never allow a circuit to be created with the same circid as a circuit that has been marked for close.  May be a fix for bug 779.  Needs testing.  Backport candidate.


svn:r16136
2008-07-23 12:55:55 +00:00
Nick Mathewson
c8160bce1f r17188@tombo: nickm | 2008-07-18 14:35:18 -0400
Add new ExcludeExitNodes option.  Also add a new routerset type to handle Exclude[Exit]Nodes.  It is optimized for O(1) membership tests, so as to make choosing a random router run in O(N_routers) time instead of in O(N_routers*N_Excluded_Routers).


svn:r16061
2008-07-18 18:36:32 +00:00
Nick Mathewson
bdcbd23e23 Stop trying to detect versions of Tor on the server-side older than 0.1.1.15-rc; they simply do not work any more. Also add comment about how or_is_obsolete is a terrible field name.
svn:r15982
2008-07-16 13:15:11 +00:00
Roger Dingledine
267e61d0f3 When relays do their initial bandwidth measurement, don't limit
to just our our entry guards for the test circuits. Otherwise we
tend to have multiple test circuits going through a single entry
guard, which makes our bandwidth test less accurate. Fixes part
of bug 654; patch contributed by Josh Albrecht.

(Actually, modify Josh's patch to avoid doing that when you're
a bridge relay, since it would leak more than we want to leak.)


svn:r15850
2008-07-11 21:42:09 +00:00
Roger Dingledine
94dabd2c23 If you're using bridges, generate "bootstrap problem" warnings
as soon as you run out of working bridges, rather than waiting
for ten failures -- which will never happen if you have less than
ten bridges.


svn:r15368
2008-06-20 04:34:39 +00:00
Roger Dingledine
dd50ffb1de Big bridge bugfixes. Backport candidates.
If you have more than one bridge but don't know their keys,
you would only learn a request for the descriptor of the first one
on your list. (Tor considered launching requests for the others, but
found that it already had a connection on the way for $0000...0000
so it didn't open another.)
If you have more than one bridge but don't know their keys, and the
connection to one of the bridges failed, you would cancel all
pending bridge connections. (After all, they all have the same
digest.)


svn:r15366
2008-06-20 03:13:16 +00:00
Roger Dingledine
45cc25c019 minor fixes and notes
svn:r15111
2008-06-10 23:00:11 +00:00
Roger Dingledine
3bb5d3ba6d include tags in the bootstrap status events. also document the
bootstrapping process and how the phases break down.


svn:r15020
2008-06-08 02:53:32 +00:00
Roger Dingledine
5aeb89447e infrastructure for the 'bootstrap status event' feature, so we can
tell the controller how we're doing at bootstrapping, and it can
tell the user.


svn:r15008
2008-06-07 05:27:34 +00:00
Roger Dingledine
ce64ca48b8 make some log entries more accurate
svn:r14998
2008-06-06 22:31:36 +00:00
Peter Palfrader
01c1a355c2 Also add create/create fast/extends to the dir-usage stats.
svn:r14900
2008-06-02 15:09:35 +00:00
Peter Palfrader
ca43044600 I bet I screwed up while merging in the changes from the feature branch into my git-svn repository. Undo r14451
svn:r14452
2008-04-24 15:43:25 +00:00
Peter Palfrader
016e67f941 Merge conditional consensus downloading
svn:r14451
2008-04-24 15:39:14 +00:00
Peter Palfrader
788404dacf and the client part of the consensus-by-authority-fpr proposal (ifdef'ed out)
svn:r14446
2008-04-24 15:38:57 +00:00
Nick Mathewson
e623d9baff r15277@tombo: nickm | 2008-04-22 13:14:18 -0400
Note a place to refactor.


svn:r14412
2008-04-22 17:21:09 +00:00
Nick Mathewson
296289de82 r18873@catbus: nickm | 2008-03-17 00:06:31 -0400
oops.  guard status logging change had a bug.  it is non-obvious how to make the code perfect atm; just make it work.


svn:r14070
2008-03-17 04:07:56 +00:00
Nick Mathewson
e6b617bf05 r18872@catbus: nickm | 2008-03-16 23:56:48 -0400
Only dump all guard node status to the log when the guard node status actually changes.  Downgrade the 4 most common remaining INFO log messages to DEBUG.


svn:r14069
2008-03-17 04:07:51 +00:00
Nick Mathewson
b98c437fcc r18195@catbus: nickm | 2008-02-19 14:11:15 -0500
TOR_PERF has not not been a sane thing for ages. Remove it.


svn:r13579
2008-02-19 19:30:37 +00:00
Roger Dingledine
3abafccd0e Start choosing which bridge to use proportional to its advertised
bandwidth, rather than uniformly at random. This should speed up Tor
for bridge users. Also do this for people who set StrictEntryNodes.


svn:r13486
2008-02-12 22:02:47 +00:00
Roger Dingledine
a89e523f19 note a simplification for the future
svn:r13466
2008-02-11 06:34:10 +00:00
Nick Mathewson
b5c03f05d8 r14102@tombo: nickm | 2008-02-10 13:30:04 -0500
Remove some deadcode.


svn:r13459
2008-02-10 18:40:27 +00:00
Roger Dingledine
509d2912dc doxygen and other cleanups
svn:r13440
2008-02-09 03:11:10 +00:00
Nick Mathewson
141a5877f3 r14063@tombo: nickm | 2008-02-08 15:48:32 -0500
Add a bunch more code documentation; change the interface of fetch_var_cell_from_buf() so it takes the current link protocol into account and can't get confused by weird command bytes on v1 connections.


svn:r13430
2008-02-08 21:13:15 +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
12071df6c8 r17930@catbus: nickm | 2008-02-05 18:20:40 -0500
Initial attempts to track down bug 600, and refactor possibly offending code.  1) complain early if circuit state is set to OPEN when an onionskin is pending.  2) refactor onionskin field into one only used when n_conn is pending, and a separate onionskin field waiting for attention by a cpuworker.  This might even fix the bug.  More likely, it will make it fail with a more useful core.


svn:r13394
2008-02-05 23:20:49 +00:00
Roger Dingledine
fdbefc8934 If we're a relay, avoid picking ourselves as an introduction point,
a rendezvous point, or as the final hop for internal circuits. Bug
reported by taranis and lodger. Bugfix on 0.1.2.x.


svn:r13372
2008-02-04 17:25:24 +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
4fb573fddd bugfix on r10612:
When we load a bridge descriptor from the cache,
and it was previously unreachable, mark it as retriable so we won't
just ignore it. Also, try fetching a new copy immediately.


svn:r12950
2007-12-24 10:31:39 +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
6097e46420 Fix a crash when we load a bridge descriptor from disk but we don't
currently have a Bridge line for it in our torrc. Bugfix on
0.2.0.12-alpha.


svn:r12921
2007-12-22 06:11:49 +00:00
Roger Dingledine
73ff2e5d5e Fix a crash when we fetch a descriptor that turns out to be
unexpected (it used to be in our networkstatus when we started
fetching it, but it isn't in our current networkstatus), and we
aren't using bridges. Bugfix on 0.2.0.x.


svn:r12911
2007-12-21 22:58:22 +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
52363d23d7 If we can't expand our list of entry guards (e.g. because we're
using bridges or we have StrictEntryNodes set), don't mark relays
down when they fail a directory request. Otherwise we're too quick
to mark all our entry points down.


svn:r12755
2007-12-10 17:16:41 +00:00
Roger Dingledine
07dbaaac16 We were ignoring our RelayBandwidthRate for the first 30 seconds
after opening a circuit -- even relayed circuits. Bugfix on
0.2.0.3-alpha.


svn:r12638
2007-12-02 11:24:06 +00:00
Roger Dingledine
b02e154470 minor cleanups
svn:r12571
2007-11-26 06:26:17 +00:00
Roger Dingledine
91bb09cb28 Only update guard status (usable / not usable) once we have
enough directory information. This was causing us to always pick
two new guards on startup (bugfix on 0.2.0.9-alpha), and it was
causing us to discard all our guards on startup if we hadn't been
running for a few weeks (bugfix on 0.1.2.x). Fixes bug 448.


svn:r12570
2007-11-26 02:18:57 +00:00
Roger Dingledine
d09439872d If we're using bridges or have strictentrynodes set, and our
chosen exit is in the same family as all our bridges/entry guards,
then be flexible about families.


svn:r12514
2007-11-16 07:37:49 +00:00
Roger Dingledine
b669fb7344 i'm a little teapot, ...
svn:r12513
2007-11-16 07:33:57 +00:00
Roger Dingledine
0871e02da8 If we're trying to fetch a bridge descriptor and there's no way
the bridge authority could help us (for example, we don't know
a digest, or there is no bridge authority), don't be so eager to
fall back to asking the bridge authority.


svn:r12512
2007-11-16 07:31:51 +00:00
Roger Dingledine
06a1e4124f Fix a small memory leak whenever we decide against using a
newly picked entry guard. Reported by Mike Perry.


svn:r12506
2007-11-15 11:14:08 +00:00
Roger Dingledine
e9af56cf2f If bridge users set UpdateBridgesFromAuthority, but the digest
they ask for is a 404 from the bridge authority, they now fall
back to trying the bridge directly.


svn:r12368
2007-11-04 00:15:42 +00:00
Nick Mathewson
20b1085989 r16242@catbus: nickm | 2007-10-28 16:28:13 -0400
Implement if-modified-since for consensus networkstatuses so that we do not download duplicates needlessly.


svn:r12258
2007-10-28 20:30:21 +00:00
Roger Dingledine
900ddcb8fd bugfix on r11298:
Fix a minor memory leak whenever we parse guards from our state
file. Bugfix on 0.2.0.7-alpha.


svn:r11862
2007-10-11 02:03:53 +00:00
Roger Dingledine
a5851939c0 i heard that users know the phrase 'system clock' better than 'clock'. hm.
svn:r11820
2007-10-09 21:11:16 +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
Roger Dingledine
193a144c9f Make "UpdateBridgesFromAuthority" torrc option work: when bridge
users configure that and specify a bridge with an identity
fingerprint, now they will lookup the bridge descriptor at the
default bridge authority via a one-hop tunnel, but once circuits
are established they will switch to a three-hop tunnel for later
connections to the bridge authority.


svn:r11550
2007-09-21 06:14:36 +00:00
Nick Mathewson
eca3634f62 r14294@Kushana: nickm | 2007-09-01 13:50:03 -0400
Oops. Initialize "changed" variable when removing obsolete guards.


svn:r11346
2007-09-01 17:50:29 +00:00
Nick Mathewson
4266039c19 r14826@catbus: nickm | 2007-08-29 13:19:55 -0400
Add a line to the state file for each guard to let us know which version added the guard.  If the line is absent, assume the guard was added by whatever version of Tor last wrote the state file.  Remove guards if the version that added them was using a bad guard selection algorithm.  (Previously, we removed guards if the version that wrote the file was using a bad guard selection algorithm, even if the guards themselves were chosen by a good version.) 


svn:r11298
2007-08-29 17:22:00 +00:00
Nick Mathewson
a4cc3e4be1 r14821@catbus: nickm | 2007-08-27 19:57:56 -0400
Check for absent nickname when making extend info.  I still dont know when this happens, but it is easy enough to check for.  Fixes bug 467.


svn:r11293
2007-08-28 00:00:32 +00:00
Nick Mathewson
c3805e753a r14200@kushana: nickm | 2007-08-24 08:33:41 -0400
In new code, let's try to prefer named flags to mazes of twisted boolean arguments, all alike.


svn:r11267
2007-08-24 12:33:53 +00:00
Roger Dingledine
d39c7515d1 patch from mike perry to a) stop overloading guards as much, and
b) raise the max-believable-bandwidth to 10MB/s.


svn:r11258
2007-08-24 06:30:34 +00:00
Roger Dingledine
79066b4851 backport candidate:
Fix a minor memory leak when we fail to find enough suitable
servers to choose a circuit. Bugfix on 0.1.2.x.


svn:r11247
2007-08-22 03:03:24 +00:00
Nick Mathewson
676d8622de r14659@catbus: nickm | 2007-08-18 14:19:34 -0400
When we are loading state info from disk, never believe any date in the future.  Doing so can keep us from retrying guards, rotating onion keys, storing bandwidth info, etc.  Fixes bug 434, and others. Backport candidate, once it has been tested.


svn:r11166
2007-08-18 18:20:42 +00:00
Roger Dingledine
ca7c53d3cc Be even more aggressive about separating local traffic from relayed
traffic when RelayBandwidthRate is set. (Refines proposal 111.)


svn:r10974
2007-07-29 22:13:44 +00:00
Roger Dingledine
eca2a30060 make progress towards retrying our bridges when they're all
down and we get a new socks request


svn:r10967
2007-07-29 04:38:21 +00:00
Nick Mathewson
189bc7cf9f r13920@catbus: nickm | 2007-07-26 16:25:25 -0400
whitespace fixes


svn:r10935
2007-07-26 20:26:53 +00:00
Nick Mathewson
701fce8e5c r13858@catbus: nickm | 2007-07-22 18:44:02 -0400
Fix/note some relatively trivial mem usage issues


svn:r10905
2007-07-22 22:49:49 +00:00
Roger Dingledine
6fc336d217 handle fetching bridge descriptors from the bridge authority too.
svn:r10898
2007-07-22 00:16:48 +00:00
Roger Dingledine
a916e07ea6 when requesting tor/server/authority, ask for tor/server/authority.z
instead. same functionality, saves a bit of bandwidth. and might even
work.


svn:r10896
2007-07-21 22:04:18 +00:00