summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/stream.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-proto: Draft API to handle incoming BEGIN requests.Nick Mathewson2023-01-171-0/+5
| | | | Onion services (and later, exits and caches) will need this.
* Improve the layout of crate exports; add runtime convenience functionseta2022-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | This commit addresses multiple problems highlighted by arti#182: - `arti-client` had some types in its public API that weren't accessible without importing another crate (`CfgPath`, `DataReader`, `DataWriter`). This has been fixed. - In addition, the doc comments for `DataReader` and `DataWriter` were cleaned up to be of better quality, now that they're public. - It was impossible to use `arti-client` without also importing `tor-rtcompat`. This is now fixed by the addition of two convenience methods: `TorClient::bootstrap_with_tokio` and `TorClient::bootstrap_with_async_std`. - Potentially controversially: `tor-rtcompat` now returns *concrete* types from methods like `current_runtime`, instead of `impl Runtime`. - This was needed in order to actually be able to name the `TorClient` type that results from using these methods. - This does mean we lose API flexibility, but on balance I think this is a good thing, because the API we *do* have is actually usable...
* Get rid of unbounded stream sender, and RawCellStreameta2021-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | Previously, the reactor would use an `UnboundedSender` to send things to the `RawCellStream`, in order that the reactor wouldn't block if you failed to read from the latter. This is bad, though, since it means people can just run us out of memory by sending lots of things. To fix this, we make the new `StreamReader` type (which does the reading parts from `RawCellStream`) keep track of the stream's receive window and issue SENDMEs once *it* has consumed enough data to require it, thus meaning that we shouldn't get sent enough data to fill the channel between reactor and `StreamReader` (and, if we do, that's someone trying to flood us, and we abort the circuit). As hinted to above, the `RawCellStream` was removed and its reading functionalities replaced by `StreamReader`; its writing functionalities are handled by `StreamTarget` anyway, so we just give out one of those for the write end. This now means we don't need any mutexes! note: this commit introduces a known issue, arti#230
* Merge IpVersionPreferences and the optimistic flag into one type.Nick Mathewson2021-11-101-0/+4
| | | | | It seems like a good time to do this, before we add a zillion other arguments to begin_stream.
* Update our disclaimers and limitations sections.Nick Mathewson2021-10-271-4/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+21
This will cause some pain for now, but now is really the best time to do this kind of thing.