Skip to content
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

add send datagram support in h3 client #255

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
support retrieve id from client
  • Loading branch information
needon1997 committed Jul 15, 2024
commit ec839ef0973a375bcc81dfeadae0351e458254f3
17 changes: 11 additions & 6 deletions h3/src/client/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ use pin_project_lite::pin_project;
use tracing::instrument;

use crate::{
connection::{self, ConnectionState, SharedStateRef},
error::{Code, Error, ErrorLevel},
proto::{frame::Frame, headers::Header},
qpack,
ext::Datagram,
quic::{self, RecvDatagramExt},
connection::{self, ConnectionState, SharedStateRef}, error::{Code, Error, ErrorLevel}, ext::Datagram, proto::{frame::Frame, headers::Header}, qpack, quic::{self, RecvDatagramExt, SendStream as _, StreamId}
};
use super::connection::Connection;
use std::{convert::TryFrom, marker::PhantomData, task::{Context, Poll},};
Expand Down Expand Up @@ -171,6 +166,11 @@ where
// rename `cancel()` ?
self.inner.stream.stop_sending(error_code)
}

/// Returns the underlying stream id
pub fn id(&self) -> StreamId {
self.inner.stream.id()
}
}

impl<S, B> RequestStream<S, B>
Expand Down Expand Up @@ -211,6 +211,11 @@ where
//# implementation resets the sending parts of streams and aborts reading
//# on the receiving parts of streams; see Section 2.4 of
//# [QUIC-TRANSPORT].

/// Returns the underlying stream id
pub fn send_id(&self) -> StreamId {
self.inner.stream.send_id()
}
}

impl<S, B> RequestStream<S, B>
Expand Down