Nick Mathewson
522907ac9a
Write more tests for RelayId and RelayIdRef.
2022-10-15 10:38:08 -04:00
Nick Mathewson
8e2ce9de1d
Write tests for RelayIdSet.
2022-10-15 10:06:02 -04:00
Nick Mathewson
ae07909a02
Fix deserialize impl for RelayId.
...
We need to handle String, not just str, since some deserializers
have to handle escapes and generate new strings.
Found while writing tests; fixes #605 .
2022-10-15 10:04:37 -04:00
Nick Mathewson
ddc5b63a19
linkspec: impl Hash for RelayIdRef
2022-10-15 09:57:45 -04:00
Jim Newsome
cc8ced13ea
shadow ci: Set stop time to 30m instead of 27m
...
This was a temporary stop-gap to work around a busy loop that seemed to
happen before. I am no longer able to reproduce any such problem.
2022-10-14 16:48:24 -05:00
Nick Mathewson
dbf4765832
Merge branch 'reorganize_factory_code' into 'main'
...
ChanMgr: Reorganize factory, builder, transport code.
See merge request tpo/core/arti!771
2022-10-13 14:52:31 +00:00
Nick Mathewson
31528202c5
chanmgr: Edit comments, fix docs
2022-10-13 10:32:02 -04:00
Nick Mathewson
913d5b68ec
chanmgr: Remove RegistryAsFactory.
...
Since there is no longer a blanket implementation of ChannelFactory
for TransportHelper, we no longer need a separate type here.
2022-10-13 10:15:05 -04:00
Nick Mathewson
fe2d44d10a
ChanMgr: Reorganize factory, builder, transport code.
...
There is no actual code change here: just movement.
2022-10-13 10:09:52 -04:00
Nick Mathewson
a77312a6ec
Merge branch 'rustdoc_fixes_20221013' into 'main'
...
Fix some rustdoc errors.
See merge request tpo/core/arti!770
2022-10-13 13:31:57 +00:00
Nick Mathewson
8f267ba166
Fix some rustdoc errors.
...
In addition to the usual "You named that method wrong!" errors, we
have a new rustdoc error that complains about bogus "HTML tags" that
are actually unquoted usage of types like `Result<Foo>`.
2022-10-13 09:08:46 -04:00
Nick Mathewson
85284ef847
Merge branch 'factory_redux' into 'main'
...
chanmgr: Build and use chanmgr factory APIs
See merge request tpo/core/arti!769
2022-10-13 12:58:28 +00:00
Nick Mathewson
7b58126706
Flatten TimeoutChannelFactory into ChannelBuilder.
2022-10-13 08:36:05 -04:00
Nick Mathewson
69b64a2795
chanmgr: clean up some TODO pt-client items and documentation.
2022-10-13 08:36:05 -04:00
Nick Mathewson
d759489530
Allow multiple ChannelBuilders to share a ChanMgrEventSender.
2022-10-13 08:36:05 -04:00
Nick Mathewson
6b587b25e1
chanmgr: Use ChannelFactory via a Box<dyn<ChannelFactory>>.
...
This will prepare for supporting multiple different ChannelFactory
implementations.
2022-10-13 08:36:05 -04:00
Nick Mathewson
15108be5ce
chanmgr: Move Timeout functionality into a decorator object.
2022-10-13 08:36:05 -04:00
Nick Mathewson
e21ac24c77
Have ChannelBuilder use TransportHelper.
...
This lets us build channels using different TransportHelpers,
including the (new) default TransportHelper, which just uses the old
connect_to_one() code.
2022-10-13 08:36:05 -04:00
Nick Mathewson
b4cc98b21b
Merge branch 'readmes' into 'main'
...
Abolish maint/readme and use doc include
Closes #603
See merge request tpo/core/arti!768
2022-10-12 15:16:18 +00:00
Ian Jackson
881f6edd9f
Abolish maint/readmes
...
This is not needed any more
2022-10-12 15:29:04 +01:00
Ian Jackson
f84d8777db
cargo fmt to remove blank lines
...
Apparently cargo fmt doesn't like these, which my perl rune didn't
delete.
This commit is precisely the result of `cargo fmt`.
2022-10-12 15:29:04 +01:00
Ian Jackson
d9910dba08
Replace all README copies in src/lib.rs with includes
...
The feature we want is `#[doc = include_str!("README.md")]`, which is
stable since 1.54 and our MSRV is now 1.56.
This commit is precisely the result of the following Perl rune:
perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
2022-10-12 15:29:03 +01:00
Ian Jackson
13654d7cd2
README doctests: fix tor-rtmock
2022-10-12 15:27:14 +01:00
Ian Jackson
af07e17b45
README doctests: fix safelog
...
Add some dummy definitions that support the example.
2022-10-12 15:27:02 +01:00
Ian Jackson
99f4511f1e
README doctests: fix fs-mistrust
...
Add fn main wrappers to allow use of ?.
Add ,no-run to test cases that fail due to accessing the filesystem.
2022-10-12 15:26:52 +01:00
Ian Jackson
03a6141865
README doctests: fix arti-client
...
Add ,ignore to ignore three shell runes.
2022-10-12 15:26:18 +01:00
Nick Mathewson
4d25049473
Implement ChannelFactory for (a wrapper of) TransportRegistry.
...
This will let us just have ChanMgr take a `dyn ChannelFactory`.
2022-10-12 10:15:00 -04:00
Nick Mathewson
28caae68d1
chanmgr: Clean up async-ness on factory types.
...
The traits that launch connections need to be async; the traits that
don't, shouldn't be async.
Additionally, we need a few more "Sync" annotations here for the
futures to work.
2022-10-12 10:15:00 -04:00
Nick Mathewson
a106d97503
Rename mgr::ChannelFactory to mgr::AbstractChannelFactory
...
This is an internal type (distinct from factory::ChannelFactory)
that we use to make the code in `tor_chanmgr::mgr` agnostic about
what a channel actually is, and how it is actually launched.
Therefore, I'm renaming it and giving better documentation in a
couple of places, to prevent confusion.
2022-10-12 10:15:00 -04:00
Nick Mathewson
5da9596a04
Add several accessors to ChannelMethod.
...
* Get `TransportId`
* Get the target address (of any type)
* Ask, "is this a direct connection"?
2022-10-12 10:15:00 -04:00
Ian Jackson
ac1c0bf8fb
README doctests: fix arti-client
...
Add ,ignore to ignore three examples that don't actually compile.
cargo readme would add these annotations to lib.rs, but the doc
include doesn't do stuff like that. pandoc seems to still render the
result just fine.
2022-10-12 14:56:37 +01:00
eta
71bbfbab48
Merge branch 'bridge-rename' into 'main'
...
Rename Bridge to BridgeConfig
Closes #599
See merge request tpo/core/arti!767
2022-10-12 13:52:07 +00:00
Ian Jackson
9004f94443
Merge branch 'bridge-config-example' into 'main'
...
Add bridges configuration section
See merge request tpo/core/arti!744
2022-10-12 13:18:02 +00:00
Ian Jackson
19de971775
struct BridgeConfig: Rename from Bridge
...
Fixes #599
2022-10-12 13:54:25 +01:00
Ian Jackson
029a11c833
struct Bridge: add ref to ticket
2022-10-12 13:51:52 +01:00
Ian Jackson
b8b885fcf5
cfg tests: bridges: Document test case assumptions
2022-10-12 13:50:29 +01:00
Ian Jackson
d1a84d9693
cfg tests: bridges: Remove now-redundant block { }
2022-10-12 13:50:29 +01:00
Ian Jackson
78d143c940
cfg test: bridges: Test all three feature cases
...
This demonstrates that:
* !bridge-client: uncommenting nondefault bridge config generates
urecognized config key warnings (but the config is still accepted)(
* bridge-client, !pt-client: uncommenting nondefault bridges generates
error due to attempting to use a PT. If that's filtered out,
everything is fine.
* pt-client: Everything is good (as before).
2022-10-12 13:50:29 +01:00
Ian Jackson
f0120534a2
cfg tests: bridges: Prepare for more comprehensive testing
...
* Introduce filter_examples and resolve_examples helpers,
which will become more complex in a moment.
* Move the API test into a { } block to minimise subsequent diff.
It's going to become conditional.
* In subsequent comparisons, use the parsed version, since
the API built one might not exist.
No overall functional change.
2022-10-12 13:50:29 +01:00
Ian Jackson
7378a00a28
cfg tests: Make ExampleSectionLines::resolve fallible
2022-10-12 13:50:29 +01:00
Nick Mathewson
fcea69bceb
Fix comment typo.
2022-10-12 13:50:29 +01:00
Nick Mathewson
63cd6b0c87
Fix error message
2022-10-12 13:50:29 +01:00
Ian Jackson
2fb052404d
bridge config: Clarify that examples are nonfunctional
2022-10-12 13:50:29 +01:00
Ian Jackson
a1b76bc04f
bridges: Test configuration
2022-10-12 13:50:29 +01:00
Ian Jackson
3c33108a85
pt and bridges: Parse configuration
2022-10-12 13:50:29 +01:00
Ian Jackson
df2b10ea77
config exhaust checking: Feature-limit some of the tests
2022-10-12 13:50:29 +01:00
Ian Jackson
cb1adb0103
tor-config: Provide MultilineListBuilder
...
This is what we'll use to parse the `bridges.bridges` config key.
2022-10-12 13:50:29 +01:00
Ian Jackson
f9e841841a
tor-guardmgr: Export BridgeParseError from toplevel
...
Callers could `use` it as `tor_guardmgr::config::BridgeParseError` but
it seems unecessary to force them to.
2022-10-12 13:50:29 +01:00
Ian Jackson
debfa1f107
tor-config: Remove unneeded braces in an example
2022-10-12 13:50:29 +01:00
Ian Jackson
4a6ac4090c
tor-config: Provide BoolOrAuto
...
We're going to use this for the config item `bridges.enabled`,
but it seems general enough that it ought to go here.
2022-10-12 13:50:29 +01:00