Skip to main content

Module reactor

Module reactor 

Source
Expand description

Code to handle incoming cells on a channel.

The role of this code is to run in a separate asynchronous task, and routes cells to the right circuits.

TODO: I have zero confidence in the close-and-cleanup behavior here, or in the error handling behavior.

Re-exportsยง

use super::circmap::CircEnt; ๐Ÿ”’
use super::circmap::CircMap; ๐Ÿ”’
use crate::circuit::CircuitRxSender; ๐Ÿ”’
use crate::client::circuit::halfcirc::HalfCirc; ๐Ÿ”’
use crate::client::circuit::padding::PaddingController; ๐Ÿ”’
use crate::client::circuit::padding::PaddingEvent; ๐Ÿ”’
use crate::client::circuit::padding::PaddingEventStream; ๐Ÿ”’
use crate::client::circuit::padding::SendPadding; ๐Ÿ”’
use crate::client::circuit::padding::StartBlocking; ๐Ÿ”’
use crate::util::err::ReactorError; ๐Ÿ”’
use crate::Error; ๐Ÿ”’
use crate::HopNum; ๐Ÿ”’
use crate::Result; ๐Ÿ”’
use tor_async_utils::SinkPrepareExt as _; ๐Ÿ”’
use tor_async_utils::oneshot_broadcast; ๐Ÿ”’
use tor_cell::chancell::ChanMsg; ๐Ÿ”’
use tor_cell::chancell::msg::Destroy; ๐Ÿ”’
use tor_cell::chancell::msg::DestroyReason; ๐Ÿ”’
use tor_cell::chancell::msg::Padding; ๐Ÿ”’
use tor_cell::chancell::msg::PaddingNegotiate; ๐Ÿ”’
use tor_cell::chancell::AnyChanCell; ๐Ÿ”’
use tor_cell::chancell::CircId; ๐Ÿ”’
use tor_cell::chancell::msg::AnyChanMsg; ๐Ÿ”’
use tor_error::debug_report; ๐Ÿ”’
use tor_rtcompat::DynTimeProvider; ๐Ÿ”’
use tor_rtcompat::Runtime; ๐Ÿ”’
use tor_error::error_report; ๐Ÿ”’
use tor_rtcompat::StreamOps; ๐Ÿ”’
use futures::channel::mpsc; ๐Ÿ”’
use oneshot_fused_workaround as oneshot; ๐Ÿ”’
use futures::Sink; ๐Ÿ”’
use futures::StreamExt as _; ๐Ÿ”’
use futures::sink::SinkExt; ๐Ÿ”’
use futures::stream::Stream; ๐Ÿ”’
use futures::select; ๐Ÿ”’
use futures::select_biased; ๐Ÿ”’
use tor_error::internal; ๐Ÿ”’
use std::fmt; ๐Ÿ”’
use std::pin::Pin; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use crate::channel::ChannelDetails; ๐Ÿ”’
use crate::channel::CloseInfo; ๐Ÿ”’
use crate::channel::kist::KistParams; ๐Ÿ”’
use crate::channel::padding; ๐Ÿ”’
use crate::channel::unique_id; ๐Ÿ”’
use crate::circuit::celltypes::CreateResponse; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use tracing::trace; ๐Ÿ”’
use crate::channel::Channel; ๐Ÿ”’
use crate::circuit::celltypes::CreateRequest; ๐Ÿ”’
use crate::relay::channel::create_handler::CreateRequestHandler; ๐Ÿ”’
use crate::relay::channel::create_handler::RelayCircComponents; ๐Ÿ”’
use std::sync::Weak; ๐Ÿ”’
use tor_llcrypto::pk::ed25519::Ed25519Identity; ๐Ÿ”’
use tor_llcrypto::pk::rsa::RsaIdentity; ๐Ÿ”’
use crate::util::sink_blocker::SinkBlocker; ๐Ÿ”’
use crate::util::sink_blocker::CountingPolicy; ๐Ÿ”’
use crate::channel::params::*; ๐Ÿ”’

Structsยง

CreateRequestHandlerAndData ๐Ÿ”’
If the channel is configured to handle CREATE* requests, this contains anything that is needed solely for this purpose.
Reactor
Object to handle incoming cells and background tasks on a channel.
SpecialOutgoing ๐Ÿ”’
Outgoing cells introduced at the channel reactor

Enumsยง

CtrlMsg
A message telling the channel reactor to do something.

Type Aliasesยง

BoxedChannelSink ๐Ÿ”’
A boxed trait object that can sink ChanCells.
BoxedChannelStream ๐Ÿ”’
A boxed trait object that can provide ChanCells.
BoxedChannelStreamOps ๐Ÿ”’
A boxed trait object that can provide additional StreamOps on a BoxedChannelStream.
ChannelOutputSink ๐Ÿ”’
Type used by a channel reactor to send cells to the network.
ReactorResultChannel ๐Ÿ”’
The type of a oneshot channel used to inform reactor users of the result of an operation.