Skip to content

Commit

Permalink
h3i: Expose stream type IDs (#1851)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanrittenhouse authored Sep 26, 2024
1 parent 115d6ee commit 2e2df0e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
20 changes: 20 additions & 0 deletions h3i/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ use quiche::h3::NameValue;

use smallvec::SmallVec;

/// The ID for an HTTP/3 control stream type.
///
/// See https://datatracker.ietf.org/doc/html/rfc9114#name-control-streams.
pub const HTTP3_CONTROL_STREAM_TYPE_ID: u64 = 0x0;

/// The ID for an HTTP/3 push stream type.
///
/// See https://datatracker.ietf.org/doc/html/rfc9114#name-push-streams.
pub const HTTP3_PUSH_STREAM_TYPE_ID: u64 = 0x1;

/// The ID for a QPACK encoder stream type.
///
/// See https://datatracker.ietf.org/doc/html/rfc9204#section-4.2-2.1.
pub const QPACK_ENCODER_STREAM_TYPE_ID: u64 = 0x2;

/// The ID for a QPACK decoder stream type.
///
/// See https://datatracker.ietf.org/doc/html/rfc9204#section-4.2-2.2.
pub const QPACK_DECODER_STREAM_TYPE_ID: u64 = 0x3;

#[derive(Default)]
struct StreamIdAllocator {
id: u64,
Expand Down
9 changes: 4 additions & 5 deletions h3i/src/recordreplay/qlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ use crate::actions::h3::Action;
use crate::actions::h3::WaitType;
use crate::encode_header_block;
use crate::fake_packet_sent;

const HTTP3_CONTROL_STREAM_TYPE_ID: u64 = 0x0;
const HTTP3_PUSH_STREAM_TYPE_ID: u64 = 0x1;
const QPACK_ENCODER_STREAM_TYPE_ID: u64 = 0x2;
const QPACK_DECODER_STREAM_TYPE_ID: u64 = 0x3;
use crate::HTTP3_CONTROL_STREAM_TYPE_ID;
use crate::HTTP3_PUSH_STREAM_TYPE_ID;
use crate::QPACK_DECODER_STREAM_TYPE_ID;
use crate::QPACK_ENCODER_STREAM_TYPE_ID;

/// A qlog event representation using either the official RFC format or the
/// catch-al JSON event.
Expand Down

0 comments on commit 2e2df0e

Please sign in to comment.