| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
| |
Change the typss of StreamMpscSender and StreamMpscReceiver.
|
| |
|
|
| |
This will save circuits etc. keeping their own clone of the time provider.
|
| |
|
|
|
|
|
|
| |
We use the *channel*'s memquota account. This is arguably wrong, but
it's hard to get right now. See #1652.
Change the type of the queue, and the places it's constructed.
The use sites can all stay the same.
|
| |
|
|
|
| |
This provides a nice place to change in the tests, when we want to
change the way the queue is made.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This gets it as far as the outbound circuit->channel mpsc queue creation.
Also, we provide an accessor for it.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Making a channel is going to involve making a memquota Participant,
which can fail.
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
Implement tor_memquota:HasMemory cost for a lot of types
See merge request tpo/core/arti!2459
|
| | | |
|
| |\ \
| |/
|/|
| |
| | |
tor-proto: SometimesUnboundedSink: provide as_inner accessor
See merge request tpo/core/arti!2483
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
tor-proto: Introduce type aliases for some queues
See merge request tpo/core/arti!2484
|
| | | |
| | |
| | |
| | | |
This will make it a little easier to change the type later.
|
| | | | |
|
| | |/
| |
| |
| | |
This will make it easier to change their types.
|
| |\ \
| |/
|/|
| |
| | |
Provide and implement SinkCloseChannel
See merge request tpo/core/arti!2485
|
| | | |
|
| | |
| |
| |
| | |
This prepares us to change the types of these queues.
|
| | | |
|
| |/
|
|
|
|
|
| |
The memquota arranagements are going to use this.
We *don't* apply this to Channel (or to other types that aren't
already generic over SleepProvider).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes
cargo check -p tor-chanmgr --all-features --all-targets
which otherwise prints
warning: method `reply` is never used
--> crates/tor-proto/src/crypto/handshake.rs:73:8
|
65 | pub(crate) trait AuxDataReply<H>
| ------------ method in this trait
...
73 | fn reply(&mut self, msg: &H::ClientAuxData) -> Option<H::ServerAuxData>;
| ^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We introduce the new constructor and call it at the error generation
sites. But there is still not yet any functional change.
Change the type of Truncated's field to be Sensitive.
The original reason for not doing this no longer applies, since we
don't generally want to open-code construction of this variant.
Conveniently, changing the type means we get to find all the sites
where one *is* constructed and adjust them.
In reader.rs and tor-proto we can just call incomplete_error.
In tor-cell, there's a call site where we previously provided an
underestimate, and where the Reader isn't available. We adjust that
ad-hoc but this is fine because the error variant will
change. (relaycell is using a Reader from from_slice.)
|
| | |
|
| |
|
|
| |
This will allow us to fix #1592, but it doesn't do so yet.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having this in the `tor-async-utils` crate prevents us from doing both
of the following without introducing a circular dependency:
* using it in `tor-rtmock` (which we currently do, particularly in
tests).
* using `tor-rtmock` to test things in `tor-async-utils`. We don't do
this yet, but it is generally sensible to do so. In particular we
want to move the `stream_peak` module there, which is currently tested
with `tor-rtmock`.
Moving this into its own crate avoids this circular dependency.
|
| | |
|
| |
|
|
|
| |
There is now (sendme-style) flow control, and some fairness
(via round robin scheduling of streams).
|
| |
|
|
|
|
| |
There is a mutex for some of the "mutable state", but the reactor only
needs to lock it when adding a hop. It's not needed "to process a cell"
or when streams send. Probably not worth calling out here.
|
| | |
|
| |
|
|
|
| |
From
<https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2340#note_3062531>
|
| |
|
|
|
| |
In particular, clarify that stream-flow-control msgs don't get blocked
on circuit congestion control.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update `StreamPollSet` to require that its streams implement
`PeekableStream`, and to not do its own buffering of values read from
the stream.
This avoids an extra layer of buffering for streams that already
buffer a value, and makes the interior state a little simpler and more
robust.
It does have a downside of making the API a little less convenient,
since the caller must do its own `poll_peek` call if it wants a
reference to the item.
* Update `StreamMap` to implement `PeekableStream` for
`OpenStreamEntStream`, as it must to satisfy the updated
`StreamPollSet` API. We have to somewhat constrain the
`poll_ready_streams_iter` API to no longer return both a reference to
the stream and the message. I don't see a way to return both
while satisfying the borrow checker. Luckily we don't really need both
anymore.
* Update the Circuit reactor to handle the updated
`StreamMap::poll_ready_streams_iter` API.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
As clippy points out otherwise, this no longer actually loops.
Since the iterator already guarantees that the messages it produces
are ready to send with respect to flow control, and we've already
validated that we can send with respect to the circuit window,
the loop, we can always handle the first item from the iterator.
i.e. this changes a `while let` to an `if let`.
|
| |
|
|
| |
This is no longer needed. Removing it shouldn't change any behavior.
|
| |
|
|
|
|
|
| |
When we've exhausted circuit-level SENDME window, iterating over streams
is likely to be a waste of CPU. Theoretically we might be able to send
some messages that don't count towards windows, but on balance it
doesn't seem worth it.
|
| |
|
|
|
|
| |
This prevents us from having to iterate over streams blocked on flow
control inside the circuit reactor, and potentially allows further
simplification.
|
| |
|
|
|
|
| |
Encapsulate flow-control into a separate object that partially abstracts
away the difference between window-based (legacy) flow control and
xon-based (prop324) flow control.
|