Commit e88c51c9 authored by David Goulet's avatar David Goulet 🐼
Browse files

Merge branch 'stream-reexport' into 'main'

proto: Reexport the Incoming* types from tor_proto::stream

See merge request !4123
parents 6aa8f680 c72b89fd
Loading
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -467,11 +467,9 @@ impl ServiceOnionServiceDataTunnel {
        allow_commands: &'a [tor_cell::relaycell::RelayCmd],
        hop: TargetHop,
        filter: FILT,
    ) -> Result<
        impl futures::Stream<Item = tor_proto::client::stream::IncomingStream> + use<'a, FILT>,
    >
    ) -> Result<impl futures::Stream<Item = tor_proto::stream::IncomingStream> + use<'a, FILT>>
    where
        FILT: tor_proto::client::stream::IncomingStreamRequestFilter,
        FILT: tor_proto::stream::IncomingStreamRequestFilter,
    {
        self.tunnel_ref()
            .allow_stream_requests(allow_commands, hop, filter)
+2 −1
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@ use tor_cell::relaycell::msg as relaymsg;
use tor_error::{ErrorKind, HasKind, debug_report};
use tor_hsservice::{HsNickname, RendRequest, StreamRequest};
use tor_log_ratelim::log_ratelim;
use tor_proto::client::stream::{DataStream, IncomingStreamRequest};
use tor_proto::client::stream::DataStream;
use tor_proto::stream::IncomingStreamRequest;
use tor_rtcompat::{Runtime, SpawnExt as _};

use crate::config::{
+5 −5
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ use tor_proto::{
        self,
        hs_ntor::{self, HsNtorHkdfKeyGenerator},
    },
    client::stream::{IncomingStream, IncomingStreamRequestFilter},
    stream::{IncomingStream, IncomingStreamRequestFilter},
};

/// An error produced while trying to process an introduction request we have
@@ -215,15 +215,15 @@ pub(crate) struct RequestFilter {
impl IncomingStreamRequestFilter for RequestFilter {
    fn disposition(
        &mut self,
        _ctx: &tor_proto::client::stream::IncomingStreamRequestContext<'_>,
        _ctx: &tor_proto::stream::IncomingStreamRequestContext<'_>,
        circ: &tor_proto::circuit::CircHopSyncView<'_>,
    ) -> tor_proto::Result<tor_proto::client::stream::IncomingStreamRequestDisposition> {
    ) -> tor_proto::Result<tor_proto::stream::IncomingStreamRequestDisposition> {
        if circ.n_open_streams() >= self.max_concurrent_streams {
            // TODO: We may want to have a way to send back an END message as
            // well and not tear down the circuit.
            Ok(tor_proto::client::stream::IncomingStreamRequestDisposition::CloseCircuit)
            Ok(tor_proto::stream::IncomingStreamRequestDisposition::CloseCircuit)
        } else {
            Ok(tor_proto::client::stream::IncomingStreamRequestDisposition::Accept)
            Ok(tor_proto::stream::IncomingStreamRequestDisposition::Accept)
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ use tor_cell::relaycell::msg::{Connected, End, Introduce2};
use tor_circmgr::ServiceOnionServiceDataTunnel;
use tor_hscrypto::Subcredential;
use tor_keymgr::ArtiPath;
use tor_proto::client::stream::{IncomingStream, IncomingStreamRequest};
use tor_proto::stream::{IncomingStream, IncomingStreamRequest};

/// Request to complete an introduction/rendezvous handshake.
///
+1 −0
Original line number Diff line number Diff line
BREAKING: Many stream-related types are now exported from `tor_proto::stream` rather than `tor_proto::client::stream`
Loading