summaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat
Commit message (Collapse)AuthorAgeFilesLines
* Semantic version changes for Arti 0.4.0 releaseNick Mathewson2022-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | I followed the following procedure to make these changes: * I used maint/changed_crates to find out which crates had changed since 0.3.0. * I used grep and maint/list_crates to sort those crates in topological (dependency) order. * I looked through semver_status to find which crates were listed as having semver-relevant changes (new APIs and breaking changes). * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no changes. For those crates, I incremented their patch-level version _without_ changing the version that other crates depend on. * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no obvious breaking changes. * I treated all crates that depend on `arti` and/or `arti-client` as having breaking changes. * I identified crates that depend on crates that have changed, even if they have not changed themselves, and identified them as having a non-breaking change. * For all of the crates, I used `cargo set-version -p $CRATE --bump $STATUS` (where `STATUS` is `patch` or `minor`) to update the versions, and the depended-upon versions.
* Improve documentation around Cargo features; make Runtime require Debugeta2022-05-111-0/+3
| | | | | | | | | | | | | | - arti#445 highlighted the lack of good documentation around Arti's multiple runtime support, as well as it being difficult to determine what runtime was actually in use. - Improve the documentation to solve the first problem. - To solve the second problem, make Runtime require Debug (which is arguably a good idea anyway, since it makes them easier to embed in things), and print out the current runtime's Debug information when arti is invoked with `--version`. - (It also prints out other Cargo features, too!) fixes arti#445
* tor-rtcompat: make CompoundRuntime handle SleepProviders properlyeta2022-05-101-0/+11
| | | | | | Previously, CompoundRuntime would use the default implementations of SleepProvider::now() and ::wallclock(), instead of using its wrapped SleepProvider. This mildly embarrassing omission has been rectified.
* Bump the version of every* crate to 0.3.0Nick Mathewson2022-05-061-1/+1
| | | | * Except for safelog and fs-mistrust, which are new.
* Update README.md files (automated).Nick Mathewson2022-05-061-3/+3
|
* Fix grammar and typosSamanta Navarro2022-04-271-3/+3
|
* Bump async_executors to 0.6Nick Mathewson2022-04-261-1/+1
|
* Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+1
| | | | | | | | | | This is an automated change made with a perl one-liner and verified with grep -L and grep -l. Some warnings are introduced with this change; they will be removed in subsequent commits. See arti#208 for older discussion on this issue.
* Add 'rust-version = "1.56"' to every Cargo.toml file.Nick Mathewson2022-04-251-0/+1
| | | | | | | This change was made automatically with a perl one-liner, and confirmed with `grep -L`. The `rust-version` field itself was introduced in 1.56.0.
* Reformat all not-yet-reformatted Cargo.toml files.Nick Mathewson2022-04-251-12/+19
| | | | | There are no semantic changes here; only formatting. This is in preparation for other changes (wrt MSRV and edition)
* Bump all arti*, tor* crates to 0.2.0Nick Mathewson2022-04-011-1/+1
| | | | | | | | Not all of these strictly need to be bumped to 0.2.0; many could go to 0.1.1 instead. But since everything at the tor-rtcompat and higher layers has had breaking API changes, it seems not so useful to distinguish. (It seems unlikely that anybody at this stage is depending on e.g. tor-protover but not arti-client.)
* Merge branch 'disallowed_lint' into 'main'eta2022-03-302-2/+0
|\ | | | | | | | | Remove allow(clippy::disallowed_methods) lint flag. See merge request tpo/core/arti!437
| * Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-302-2/+0
| |
* | Make daemon tasks self-contained; introduce NetDirProvidereta2022-03-301-0/+6
|/ | | | | | | | | | | | | | | The various background daemon tasks that `arti-client` used to spawn are now handled inside their respective crates instead, with functions provided to spawn them that return `TaskHandle`s. This required introducing a new trait, `NetDirProvider`, which steals some functionality from the `DirProvider` trait to enable `tor-circmgr` to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it can't depend on `DirProvider` directly). While we're at it, we also make some of the tasks wait for events from the `NetDirProvider` instead of sleeping, slightly increasing efficiency.
* Merge branch 'no-system-time' into 'main'eta2022-03-303-3/+5
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * use wallclock where possible in teststrinity-1686a2022-02-262-3/+4
| |
| * remove most usage of SystemTime::nowtrinity-1686a2022-02-251-0/+1
| |
* | tor-rtcompat/scheduler: add unit tests, FireIn -> FireAteta2022-03-242-7/+142
| | | | | | | | | | Addressing review comments: added some unit tests for the new scheduler type, and made FireIn use an Instant instead (making it FireAt).
* | Implement a periodic task scheduler, and a basic dormant modeeta2022-03-232-0/+149
| | | | | | | | | | | | | | | | | | | | | | This is a revised version of !397; it implements a scheduling system for periodic tasks that can be externally controlled, and then uses the external control aspect to implement a basic dormant mode (#90). More technically, the scheduling system consists of a `Stream` that periodic tasks are expected to embed in a `while` loop or similar, a way for tasks themselves to choose how long to wait until the stream next yields a result, and a handle to control this outside of the task.
* | UdpSocket: remove support for connect().Nick Mathewson2022-03-183-47/+10
| | | | | | | | | | | | | | | | Currently, Arti doesn't need this. But once it does, it will be way better to have a separate type for connected sockets, rather than having to error-check every time somebody gives us a socket. Part of #410
* | add simple unit test on UDPtrinity-1686a2022-03-144-2/+47
| |
* | fix typos and minor issuestrinity-1686a2022-03-141-1/+1
| |
* | add skeleton for DNS handlingtrinity-1686a2022-03-143-6/+9
| |
* | add udp to runtimetrinity-1686a2022-03-148-23/+210
| |
* | Merge branch 'educe-traits' into 'main'Ian Jackson2022-03-042-10/+4
|\ \ | | | | | | | | | | | | Replace many manual trait impls with use of educe See merge request tpo/core/arti!375
| * | Replace manual Clone impl with educe in tor-rtcompatIan Jackson2022-03-022-10/+4
| | |
* | | Replace manual Default, and abolish new, in tor-rtcompatIan Jackson2022-03-021-13/+1
|/ / | | | | | | The Default impl was the only call site for new()
* | Merge branch 'clippy-allow-arc-clone' into 'main'Nick Mathewson2022-03-011-1/+0
|\ \ | | | | | | | | | | | | Disable clippy::clone_on_ref_ptr See merge request tpo/core/arti!352
| * | Disable clippy::clone_on_ref_ptrIan Jackson2022-02-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lint is IMO inherently ill-conceived. I have looked for the reasons why this might be thought to be a good idea and there were basically two (and they are sort of contradictory): I. "Calling ‘.clone()` on an Rc, Arc, or Weak can obscure the fact that only the pointer is being cloned, not the underlying data." This is the wording from https://rust-lang.github.io/rust-clippy/v0.0.212/#clone_on_ref_ptr It is a bit terse; we are left to infer why it is a bad idea to obscure this fact. It seems to me that if it is bad to obscure some fact, that must be because the fact is a hazard. But why would it be a hazard to not copy the underlying data ? In other languages, faliing to copy the underlying data is a serious correctness hazard. There is a whose class of bugs where things were not copied, and then mutated and/or reused in multiple places in ways that were not what the programmer intended. In my experience, this is a very common bug when writing Python and Javascript. I'm told it's common in golang too. But in Rust this bug is much much harder to write. The data inside an Arc is immutable. To have this bug you'd have use interior mutability - ie mess around with Mutex or RefCell. That provides a good barrier to these kind of accidents. II. "The reason for writing Rc::clone and Arc::clone [is] to make it clear that only the pointer is being cloned, as opposed to the underlying data. The former is always fast, while the latter can be very expensive depending on what is being cloned." This is the reasoning found here https://github.com/rust-lang/rust-clippy/issues/2048 This is saying that *not* using Arc::clone is hazardous. Specifically, that a deep clone is a performance hazard. But for this argument, the lint is precisely backwards. It's linting the "good" case and asking for it to be written in a more explicit way; while the supposedly bad case can be written conveniently. Also, many objects (in our codebase, and in all the libraries we use) that are Clone are in fact simply handles. They contain Arc(s) (or similar) and are cheap to clone. Indeed, that is the usual case. It does not make sense to distinguish in the syntax we use to clone such a handle, whether the handle is a transparent Arc, or an opaque struct containing one or more other handles. Forcing Arc::clone to be written as such makes for code churn when a type is changed from Arc<Something> to Something: Clone, or vice versa.
* | | Bump all crates to 0.1.0arti-v0.1.0Nick Mathewson2022-03-011-1/+1
| | |
* | | Update README.md files from rustdoc.Nick Mathewson2022-03-011-10/+33
| | |
* | | Fix rustdoc errors.Nick Mathewson2022-03-011-1/+1
| | |
* | | arti-client: use PreferredRuntime by default, doc cleanupseta2022-02-281-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes using the `PreferredRuntime` the first-class option inside `arti-client`, freeing users who don't want to think about runtimes from having to do so. `TorClient::create_unbootstrapped` and `builder` now automatically use this runtime, leaving only `builder_custom` for users who wish to manually specify a runtime. This lets us clean up the docs a lot: mentions of using custom runtimes are now relegated to nearer the end of the crate-level documentation, and we mostly just link to `tor_rtcompat`'s docs to explain more there. Instead, we take some more time to explain how you use the builder API to create clients synchronously. Other doc cleanups included getting rid of the explanation of `TorAddr` in the main crate-level doc; this is already well-documented elsewhere, and is something users should discover organically later. fixes arti#326
* | | tor-rtcompat: refactor PreferredRuntime, clean up docseta2022-02-253-55/+142
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | `PreferredRuntime` is now an opaque wrapper struct that contains the "actual" preferred runtime as a type alias. The `current_user_runtime` and `create_runtime` functions become `PreferredRuntime::current` and `PreferredRuntime::create`, respectively. This removes the dependence on `impl Trait`, meaning we can now name the returned runtime (yay!). In addition, the documentation was cleaned up a bit to make it (hopefully) flow better. Items that don't make sense to publicize, like testing implementation details, have been marked #[doc(hidden)] and semver warnings added.
* | Bump minimum tokio to 1.7, since tokio-util now needs that.Nick Mathewson2022-02-251-1/+1
| |
* | Upgrade dependency to new version of tokio-util.Nick Mathewson2022-02-251-1/+1
| |
* | Merge branch 'tls-trait' into 'main'Ian Jackson2022-02-257-29/+38
|\ \ | | | | | | | | | | | | tor-rtcompat: Provide TLS wrapping for all streams See merge request tpo/core/arti!349
| * | Fix rustdoc "skip this" markupIan Jackson2022-02-241-1/+1
| | |
| * | tor-rtcompat: Provide TLS wrapping for all streamsIan Jackson2022-02-247-29/+38
| | | | | | | | | | | | | | | | | | | | | | | | Now all of the runtime types we provide all impl<S> TlsProvider<S> where S: ... rather than merely TlsProvider<Self::TcpStream>. And we document and intent to perhaps require this in the future.
* | | Merge branch 'http-layer' into 'main'eta2022-02-241-0/+2
|\ \ \ | |_|/ |/| | | | | | | | Initial cut of hyper bindings as a library crate See merge request tpo/core/arti!342
| * | Add missing documentation for TLS features to two readmesIan Jackson2022-02-231-0/+2
| |/
* / add example of tcp hooktrinity-1686a2022-02-231-0/+5
|/ | | | this required to make additional types public
* rename *.py scripts to bare nameIan Jackson2022-02-181-0/+0
| | | | | | Update all references. There are three remaining hits for git-grep '\.py\b' all of which are scripts in "little-t-tor", not here in arti.
* Change deny(clippy::all) to warn(clippy::all).Nick Mathewson2022-02-141-1/+1
| | | | Closes #338.
* Upgrade required version of futures crate to 0.3.14Nick Mathewson2022-02-011-1/+1
| | | | | Earlier versions have a bug in UnboundedReceiver that make our new dirclient tests fail.
* Bump the patch version of every crate that changed since 0.0.3Nick Mathewson2022-01-311-1/+1
|
* Use script to update README.md files.Nick Mathewson2022-01-281-6/+8
|
* tor-rtcompat: remove some unused code.Nick Mathewson2022-01-271-16/+0
| | | | | Nothing actually used these accessor functions, and it's not clear what would. We can add them later if they're needed.
* tor-rtcompat: Add some miscellaneous testsNick Mathewson2022-01-274-0/+91
| | | | | These probably aren't for things that will fail IRL, but it's nice to have coverage on the code, just in case.
* tor-rtcompat: Simplify test-declaration macros.Nick Mathewson2022-01-271-60/+35
| | | | Now there's much less copy-and-paste.