feat(wasm, native, h3): make wasm, native and h3 use unified interface
Some checks failed
CI / checks (push) Failing after 2s

This commit is contained in:
Alois 2026-08-27 15:31:55 +02:00
commit e83cd132a2
Signed by: alois
SSH key fingerprint: SHA256:GBzT2DXvAuGV9XIV5W3WrzVpjU54FThmxHXdbz95J24
13 changed files with 738 additions and 399 deletions

View file

@ -57,14 +57,14 @@ impl TransportSendStream for H3TransportSender {
self.stream
.write_all(buf)
.await
.map_err(|_| CommunicationError::StreamError)?;
.map_err(|_| CommunicationError::DeliveryUnknown)?;
// Control/authentication frames use a persistent stream. h3 keeps
// those writes buffered until flushed; without this the peer can wait
// for the challenge while the server waits for its proof.
self.stream
.flush()
.await
.map_err(|_| CommunicationError::StreamError)
.map_err(|_| CommunicationError::DeliveryUnknown)
}
async fn finish(&mut self) -> Result<(), CommunicationError> {
@ -73,6 +73,11 @@ impl TransportSendStream for H3TransportSender {
.await
.map_err(|_| CommunicationError::StreamError)
}
fn reset(&mut self, code: u32) -> Result<(), CommunicationError> {
h3::quic::SendStream::reset(&mut self.stream, code as u64);
Ok(())
}
}
#[async_trait::async_trait]
@ -140,6 +145,11 @@ impl TransportRecvStream for H3TransportReceiver {
}
}
}
fn stop(mut self, code: u32) -> Result<(), CommunicationError> {
h3::quic::RecvStream::stop_sending(&mut self.stream, code as u64);
Ok(())
}
}
impl tokio::io::AsyncWrite for H3TransportSender {