Repository navigation
WebTransport: count a session's expired outgoing datagrams #3986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,20 +4,22 @@ | |
| // option. This file may not be copied, modified, or distributed | ||
| // except according to those terms. | ||
|
|
||
| #[cfg(test)] | ||
| use std::num::NonZeroUsize; | ||
| use std::{ | ||
| cell::RefCell, | ||
| fmt::{self, Debug, Display, Formatter}, | ||
| mem, | ||
| rc::Rc, | ||
| time::Instant, | ||
| }; | ||
| #[cfg(test)] | ||
| use std::{num::NonZeroUsize, time::Duration}; | ||
|
|
||
| use neqo_common::{ | ||
| Bytes, Decoder, Header, MessageType, Role, qdebug, qerror, qinfo, qtrace, qwarn, | ||
| }; | ||
| use neqo_qpack as qpack; | ||
| #[cfg(test)] | ||
| use neqo_transport::DatagramQueueCapacity; | ||
| use neqo_transport::{ | ||
| AppError, CloseReason, Connection, DatagramQueueOutcome, DatagramTracking, State, StreamId, | ||
| StreamType, ZeroRttState, | ||
|
|
@@ -1016,7 +1018,7 @@ | |
| stream_id: StreamId, | ||
| error: AppError, | ||
| ) -> Res<()> { | ||
| qdebug!("[{self}] Reset sending side of stream {stream_id} error={error}"); | ||
Check failureCode scanning / CodeQL Cleartext logging of sensitive information High
This operation writes
session_id Error loading related location Loading This operation writes session_id to a log file. This operation writes stream_info.session_id() to a log file. |
||
|
|
||
| if self.send_stream_is_critical(stream_id) { | ||
| return Err(Error::InvalidStreamId); | ||
|
|
@@ -1055,7 +1057,7 @@ | |
| stream_id: StreamId, | ||
| error: AppError, | ||
| ) -> Res<()> { | ||
| qdebug!("[{self}] Send stop sending for stream {stream_id} error={error}"); | ||
Check failureCode scanning / CodeQL Cleartext logging of sensitive information High
This operation writes
session_id Error loading related location Loading This operation writes session_id to a log file. This operation writes stream_info.session_id() to a log file. |
||
| if self.recv_stream_is_critical(stream_id) { | ||
| return Err(Error::InvalidStreamId); | ||
| } | ||
|
|
@@ -1132,7 +1134,7 @@ | |
| error: AppError, | ||
| conn: &mut Connection, | ||
| ) -> Res<()> { | ||
| qinfo!("[{self}] cancel_fetch {stream_id} error={error}"); | ||
Check failureCode scanning / CodeQL Cleartext logging of sensitive information High
This operation writes
session_id Error loading related location Loading This operation writes session_id to a log file. |
||
| let send_stream = self.send_streams.get(&stream_id); | ||
| let recv_stream = self.recv_streams.get(&stream_id); | ||
| match (send_stream, recv_stream) { | ||
|
|
@@ -1659,6 +1661,34 @@ | |
| Ok(()) | ||
| } | ||
|
|
||
| /// Test-only; see [`Self::extended_connect_set_max_buffered_datagrams`]. | ||
| #[cfg(test)] | ||
| pub(crate) fn webtransport_session_set_datagram_max_age( | ||
| &self, | ||
| session_id: StreamId, | ||
| conn: &mut Connection, | ||
| max_age: Option<Duration>, | ||
| now: Instant, | ||
| ) -> Res<()> { | ||
| self.webtransport_session(session_id)? | ||
| .borrow() | ||
| .set_datagram_max_age(conn, max_age, now); | ||
| Ok(()) | ||
| } | ||
|
|
||
| /// Test-only; see [`Self::extended_connect_set_max_buffered_datagrams`]. | ||
| #[cfg(test)] | ||
| pub(crate) fn extended_connect_datagram_queue_capacity( | ||
| &self, | ||
| session_id: StreamId, | ||
| conn: &Connection, | ||
| ) -> Res<DatagramQueueCapacity> { | ||
| Ok(self | ||
| .validate_extended_connect_session(session_id)? | ||
| .borrow() | ||
| .datagram_queue_capacity(conn)) | ||
| } | ||
|
|
||
| /// Expire stale outgoing datagrams on every active extended-CONNECT | ||
| /// session's queue and count them per session. Called once per | ||
| /// `process_http3` tick. The transport counts expiries on the queue | ||
|
|
@@ -1860,6 +1890,8 @@ | |
| wt: &Rc<RefCell<extended_connect::session::Session>>, | ||
| conn: &mut Connection, | ||
| ) { | ||
| wt.borrow().drop_queued_datagrams(conn); | ||
|
|
||
| let (recv, send) = wt.borrow_mut().take_sub_streams(); | ||
|
|
||
| #[expect( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.