From f3520478b1c757f291532bca72aca42a471d2e07 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 24 Feb 2022 18:56:07 +0000 Subject: [PATCH] tor-proto datastream: Do not dump packet data in DataWriterImpl --- crates/tor-proto/src/stream/data.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/tor-proto/src/stream/data.rs b/crates/tor-proto/src/stream/data.rs index 203bf66fe..ddf30f2b3 100644 --- a/crates/tor-proto/src/stream/data.rs +++ b/crates/tor-proto/src/stream/data.rs @@ -279,7 +279,6 @@ impl Debug for DataWriterState { } /// Internal: the write part of a DataStream -#[derive(Debug)] struct DataWriterImpl { /// The underlying StreamTarget object. s: StreamTarget, @@ -295,6 +294,15 @@ struct DataWriterImpl { n_pending: usize, } +impl Debug for DataWriterImpl { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("DataWriterImpl") + .field("sr", &self.s) + .field("n_pending", &self.n_pending) + .finish_non_exhaustive() + } +} + impl DataWriter { /// Helper for poll_flush() and poll_close(): Performs a flush, then /// closes the stream if should_close is true. @@ -479,7 +487,6 @@ impl std::fmt::Debug for DataReaderState { } /// Wrapper for the read part of a DataStream -#[derive(Debug)] struct DataReaderImpl { /// The underlying StreamReader object. s: StreamReader,