Skip to content

Commit

Permalink
qlog: add stream_type_value for unknown streams (#1718)
Browse files Browse the repository at this point in the history
  • Loading branch information
LPardue authored Feb 2, 2024
1 parent 09ea4b2 commit 2cd74cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 1 addition & 2 deletions qlog/src/events/h3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,8 @@ pub struct H3ParametersRestored {
pub struct H3StreamTypeSet {
pub owner: Option<H3Owner>,
pub stream_id: u64,

pub stream_type: H3StreamType,

pub stream_type_value: Option<u64>,
pub associated_push_id: Option<u64>,
}

Expand Down
14 changes: 13 additions & 1 deletion quiche/src/h3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@ impl Connection {
stream_id,
owner: Some(H3Owner::Local),
stream_type: H3StreamType::QpackEncode,
stream_type_value: None,
associated_push_id: None,
});

Expand All @@ -1779,6 +1780,7 @@ impl Connection {
stream_id,
owner: Some(H3Owner::Local),
stream_type: H3StreamType::QpackDecode,
stream_type_value: None,
associated_push_id: None,
});

Expand Down Expand Up @@ -1883,7 +1885,8 @@ impl Connection {
/// Opens a new unidirectional stream with a GREASE type and sends some
/// unframed payload.
fn open_grease_stream(&mut self, conn: &mut super::Connection) -> Result<()> {
match self.open_uni_stream(conn, grease_value()) {
let ty = grease_value();
match self.open_uni_stream(conn, ty) {
Ok(stream_id) => {
conn.stream_send(stream_id, b"GREASE is the word", true)?;

Expand All @@ -1894,6 +1897,7 @@ impl Connection {
stream_id,
owner: Some(H3Owner::Local),
stream_type: H3StreamType::Unknown,
stream_type_value: Some(ty),
associated_push_id: None,
});

Expand Down Expand Up @@ -1938,6 +1942,7 @@ impl Connection {
stream_id,
owner: Some(H3Owner::Local),
stream_type: H3StreamType::Control,
stream_type_value: None,
associated_push_id: None,
});

Expand Down Expand Up @@ -2061,11 +2066,18 @@ impl Connection {
}

qlog_with_type!(QLOG_STREAM_TYPE_SET, conn.qlog, q, {
let ty_val = if matches!(ty, stream::Type::Unknown) {
Some(varint)
} else {
None
};

let ev_data =
EventData::H3StreamTypeSet(H3StreamTypeSet {
stream_id,
owner: Some(H3Owner::Remote),
stream_type: ty.to_qlog(),
stream_type_value: ty_val,
associated_push_id: None,
});

Expand Down

0 comments on commit 2cd74cf

Please sign in to comment.