Skip to content

Commit

Permalink
Reproducer for quinn-rs/quinn#2041
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Nov 23, 2024
1 parent c6b92cb commit df25612
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ members = [
"examples",
]
resolver = "2"

[patch.crates-io]
quinn = { git = "https://github.com/mxinden/quinn.git", branch = "reproduce-2041" }
9 changes: 4 additions & 5 deletions examples/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::{path::PathBuf, sync::Arc};
use futures::future;
use rustls::pki_types::CertificateDer;
use structopt::StructOpt;
use tokio::io::AsyncWriteExt;
use tracing::{error, info};

use h3_quinn::quinn;
Expand Down Expand Up @@ -147,10 +146,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

// `recv_data()` must be called after `recv_response()` for
// receiving potential response body
while let Some(mut chunk) = stream.recv_data().await? {
let mut out = tokio::io::stdout();
out.write_all_buf(&mut chunk).await?;
out.flush().await?;
while let Some(_) = stream.recv_data().await? {
// let mut out = tokio::io::stdout();
// out.write_all_buf(&mut chunk).await?;
// out.flush().await?;
}

Ok::<_, Box<dyn std::error::Error>>(())
Expand Down

0 comments on commit df25612

Please sign in to comment.