| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
`StreamFlowCtrl` is no longer accessible via `tor_proto::client`, so I
had to update one of the (doc) imports with its new path
Also, I had to change a couple of imports to use `DataWriter` and
`DataStream` from `crate::client::stream` instead of
`crate::client::stream::data`, because the latter is not visible from
`flow_ctrl` anymore.
|
| | |
|
| |
|
|
| |
This will be used by exits too, so I am moving it out of `client`.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The `stream` module is client-specific, for the most part, so I am
moving it under `client`. Later on, we will factor out the parts that
can be shared with the relay implementation.
Note: this is a breaking change as the deleted `stream` module was
`pub`. We could've kept the module and reexported from it the public
types from `tor_proto::client::stream`, but I think it's better to have
this `client` namespacing, because it makes the separation between the
client and relay parts clearer.
|
| | |
|
| |
|
|
|
|
| |
The implementation from `tunnel` is client-specific, so we are renaming
the module accordingly. The more generic parts will be pulled into a
separate module in a future commit.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In order to pull this off, some client => tunnel renaming needed to
happen including the comments.
The send_raw_msg() is an experimental and expert mode method that any
tunnel should have access to in order to be able to send whatever
message in whatever tunnel type.
No behavior changes.
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`DataReader` -> `DataReaderInner`
`DataReaderNew` -> `DataReader`
This means that the `DataReader` now supports XON/XOFF flow control
using the `XonXoffReader`.
This means that it can receive requests for a new drain rate from the
reactor, and can send the new drain rate to the reactor once there is no
more stream data queued.
|
| |
|
|
| |
This will later become `DataReader`.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The idea here is that the reactor builds an `XonXoffReaderCtrl` for the
new stream, and the `XonXoffReaderCtrl` can receive notifications from
the reactor's `StreamFlowControl`. The `XonXoffReaderCtrl` can be
combined with any `AsyncRead` to build a `XonXoffReader`, essentially
wrapping the `AsyncRead` with a type that handles XON/XOFF flow control.
Essentially, the reactor gives you a type that allows you to add
XON/XOFF flow control support to any `AsyncRead`.
We will add this `XonXoffReader` to the `DataReader` in a future commit.
|
| |
|
|
|
| |
Nothing actually causes an XON to be sent yet. But this adds the code so
that anything holding the `StreamTarget` can request to send an XON.
|
| | |
|
| | |
|
| |
|
|
|
| |
XON/XOFF flow control will want to know how many data bytes are queued
on a stream, so the new types track that.
|
| |
|
|
|
|
| |
As we continue adding more functionality to streams like flow control,
we'll have more objects to pass around. This tries to group them
together.
|
| |
|
|
|
|
|
|
| |
The plan is to use `StreamSendFlowControl` (now `StreamFlowControl`) for
both outgoing and incoming directions, so a name change is needed.
This also updates some comments, and renames some related struct fields
that have the word "send" in them.
|
| |
|
|
|
| |
I don't see any further changes being needed for these types, and it
simplifies a lot of future code in tor-proto that uses these types.
|
| |\
| |
| |
| |
| | |
tor-proto: Handle incoming XON/XOFF messages
See merge request tpo/core/arti!3054
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Moves the `DataWriter` impl to immediately after the definition.
|
| | | |
|
| | |
| |
| |
| |
| | |
We only want to try to decode it if the circuit is using window-based
flow control.
|
| |/ |
|
| | |
|
| |
|
|
|
| |
Now that we no longer need to store a future, there's no need for this
state since we're never pending waiting for a future to complete.
|
| |
|
|
|
|
|
|
|
|
|
| |
Having this be a `futures::Stream` makes it nicer to work with. For
example we are able to remove a boxed future from `DataReaderState`,
which should be better for performance and makes the code simpler.
As mentioned in a previous commit when this type was named
`StreamReader`, this type is public in the API, but is not actually
accessible. As far as I can tell there is no way to construct it or
access it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are some pros/cons to this change:
Pros:
1. The only remaining `await` in `StreamReceiver::recv` is for polling
the receiver, which means we can turn the `StreamReceiver` into a
`Stream` in a future commit.
2. We won't block the user from receiving messages while we wait for the
circuit reactor to receive our SENDME message and send it on the
outgoing channel.
3. The `StreamReceiver` doesn't really care if it can't send the SENDME.
There isn't anything it can do, the circuit hop can go away for
external reasons like a DESTROY message, and we still want to return
all queued messages to the user anyways.
Cons:
1. If the `StreamReceiver` sends a SENDME request to the circuit
reactor, and the circuit reactor fails to send the SENDME, there's no
good way for the reactor to communicate this back to the
`StreamReceiver`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In rust, the typical nomenclature is to use "receiver" for channels, and
"reader" for byte streams. For example `mpsc::Receiver` for something
that returns objects and `AsyncRead` for something that reads bytes.
Since we also have a `DataReader` for reading bytes, I think renaming
this from `StreamReader` to `StreamReceiver` better describes what it is
(it's not a "reader" in the typical `Read`/`AsyncRead` sense).
This type is public in the API, but is not actually accessible. As far
as I can tell there is no way to construct it or access it.
|
| |
|
|
| |
This uses just a placeholder `Empty` stream for config updates.
|
| |
|
|
|
|
| |
We want the tokio trait to call into the futures trait, rather than
having each trait duplicate the logic of calling into the inner writer.
This is less error-prone.
|
| | |
|
| |
|
|
| |
The user now sets a constant amount of bytes to wait for.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Unfortunately the git diff thinks I moved the struct, but I really only
moved the comment.
|
| |
|
|
|
| |
`DataWriter` -> `DataWriterInner`
`DataWriterNew` -> `DataWriter`
|