Nick Mathewson
38070d6ec9
netdoc: Add a bogus "Extent()" facility to remember where things were.
...
Also add the missing str.rs file (oops)
2020-11-14 10:32:17 -05:00
Nick Mathewson
8569af82dd
netdoc: split off string utils
2020-11-14 10:32:17 -05:00
Nick Mathewson
cb59ae3933
Move closed-check for circuits into an atomicbool.
2020-11-13 09:08:15 -05:00
Nick Mathewson
4a83f21ae9
Light refactoring on remaining ChannelImpl functions
2020-11-13 08:39:01 -05:00
Nick Mathewson
4b1ed6c39c
Turn the channel "closed" method into an AtomicBool
...
This lets us make the test for closed channels non-async.
2020-11-13 08:34:30 -05:00
Nick Mathewson
11b257e1ae
Move a few immutable fields from ChannelImpl outside the lock.
...
Since these don't change while the channel is alive, we don't need
the lock to protect them.
2020-11-13 08:17:36 -05:00
Nick Mathewson
6e5db3a0e7
Make Arc<>-ness of ClientCirc explicit.
2020-11-12 12:58:33 -05:00
Nick Mathewson
ac174c7666
Make the Arc-ness of channels more explicit.
...
Previously every channel was a secret Arc<>, which I think is bad
style, and which stopped us from using weak references in other
places.
2020-11-12 12:34:50 -05:00
Nick Mathewson
fabd6840ff
tor-circmgr: timeout and retry support.
2020-11-11 17:40:32 -05:00
Nick Mathewson
5b2e18e358
tor-chanmgr: timeout support.
2020-11-11 17:34:54 -05:00
Nick Mathewson
6ae2713763
Document tor-rtcompat crate a little
2020-11-11 14:40:01 -05:00
Nick Mathewson
9504086793
Remove a couple of unused dependencies
2020-11-11 13:48:38 -05:00
Nick Mathewson
59e4b5631a
Isolate async_std usage in a new tor_rtcompat crate.
...
Like tor_llcrypto, this crate is meant to expose only the part of
other crates (in this case, a async runtime crate) that we use.
2020-11-11 13:46:39 -05:00
Nick Mathewson
dc301094fd
Use anyhow in tor-circmgr and tor-chanmgr
2020-11-11 10:23:29 -05:00
Nick Mathewson
e417a9dc13
Use Infallible in tor-netdoc.
2020-11-11 10:09:16 -05:00
Nick Mathewson
ede252c1d3
Use anyhow for error management in client-demo.
2020-11-11 10:06:47 -05:00
Nick Mathewson
136c536123
Mark tor_netdoc::err::Pos as Send and Sync
...
I am about 99% sure this is safe: the pointer that this type
contains is never dereferenced, and is only compared to the bounds
of a string later on.
2020-11-11 10:00:48 -05:00
Nick Mathewson
c440f4d476
Use bitflags crate to represent RouterFlags.
2020-11-11 09:33:53 -05:00
Nick Mathewson
af16ec18a3
update some dependencies
2020-11-11 09:14:26 -05:00
Nick Mathewson
4d24fff9c0
Upgrade dependencies
2020-11-10 12:27:10 -05:00
Nick Mathewson
9c7ed1fdde
upgrade a few packages.
2020-11-05 16:56:29 -05:00
Nick Mathewson
44cbe2f89b
Add some tor-sockproto tests
2020-11-05 11:20:49 -05:00
Nick Mathewson
fee895b33a
Document tor-socksproto
2020-11-04 16:15:49 -05:00
Nick Mathewson
2e1f510225
rename tor_socks -> tor_socksproto.
2020-11-04 15:01:25 -05:00
Nick Mathewson
c0f9d94b34
Refactor DataStream to be splittable, and have internal locking.
...
This lets me fix the deadlock in the proxy code.
2020-11-04 12:10:09 -05:00
Nick Mathewson
954108e0ee
stream: Update to enable more fine-grained locking
...
Not sure this is quite right, or quite deadlock free, but it lets
us read/write cells on a stream we haven't locked.
2020-11-04 11:50:23 -05:00
Nick Mathewson
3289f2d44c
Add a (broken) SOCKS proxy to client-demo.
...
This is broken because it hits a deadlock when two tasks at once
want to use a DataStream for reading and writing.
2020-11-04 11:34:48 -05:00
Nick Mathewson
deb160ad54
Add a SOCKS protocol implementation. Needs tests and docs
2020-11-04 11:33:20 -05:00
Nick Mathewson
7d5829b0a8
netdir: remove interior mutability.
2020-11-04 11:32:12 -05:00
Nick Mathewson
6120a2ceac
circmgr: Make sure circmgr can be shared among threads
2020-11-04 11:31:39 -05:00
Nick Mathewson
d658532f84
chanmgr: Make sure chanmgr can be shared among threads
2020-11-04 11:30:57 -05:00
Nick Mathewson
7128c14f49
Make 'netdir' no longer a field in circmgr.
2020-11-02 14:25:49 -05:00
Nick Mathewson
80b70881af
Add a tiny bit of cleanup logic to tor-circmgr
2020-11-02 14:21:14 -05:00
Nick Mathewson
8ab8c52193
Document tor-circmgr
2020-11-02 14:11:31 -05:00
Nick Mathewson
7d2b2391ab
Implement rudimentary circuit-manager functionality
...
This code is meant to "get or launch a circuit as appropriate."
It's super dodgy, but it is probably good enough for a first pass.
2020-11-02 11:54:02 -05:00
Nick Mathewson
d9dafa0a28
Add a new circuit-manager crate and move path selection there.
2020-11-02 10:44:31 -05:00
Nick Mathewson
f6b5386ee7
Add missing testing.rs file
2020-10-30 16:30:44 -04:00
Nick Mathewson
fbbc14d4fb
Tests for tor-chanmgr.
2020-10-30 15:45:53 -04:00
Nick Mathewson
8d8ce482c9
chanmgr: don't return closing channels.
2020-10-30 09:51:52 -04:00
Nick Mathewson
d0a18a65c5
Use chanmgr in client-demo
2020-10-30 09:51:52 -04:00
Nick Mathewson
f399851bcf
Implement a channel-manager type to get or launch channels on request.
2020-10-30 09:51:31 -04:00
Nick Mathewson
67e39450fb
Remove duplication of ipaddr argument in handshake.
2020-10-29 17:03:12 -04:00
Nick Mathewson
0db18afa39
tor-cell: In netinfo, unspecified addresses are None.
2020-10-29 17:03:12 -04:00
Nick Mathewson
f8d526a85a
Function to check whether a channel matches a target.
2020-10-29 17:03:12 -04:00
Nick Mathewson
4cf972d69b
tor-proto API: Use new_ref, not clone.
...
Semantically, cloning a Channel or Circuit is actually increasing an
internal reference count. We should name the functions to reflect
that, to be more explicit about what we're doing.
2020-10-29 12:11:36 -04:00
Nick Mathewson
06675c180c
update the TODO
2020-10-27 14:58:34 -04:00
Nick Mathewson
5989b843cc
Add a simple test for stream creation.
2020-10-27 14:40:23 -04:00
Nick Mathewson
705d9c061f
Add a test for extending a circuit with ntor.
2020-10-27 14:26:22 -04:00
Nick Mathewson
911185ec38
circuit: test meta-cell receiving
2020-10-27 13:41:31 -04:00
Nick Mathewson
b90ca2acd7
Downgrade an XXXXM3 message.
2020-10-27 13:11:57 -04:00