diff --git a/.github/actions/nss/action.yml b/.github/actions/nss/action.yml index 1bca72d3d2..69f1737d42 100644 --- a/.github/actions/nss/action.yml +++ b/.github/actions/nss/action.yml @@ -87,14 +87,14 @@ runs: - name: Checkout NSS if: env.USE_SYSTEM_NSS == '0' - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: nss-dev/nss path: nss - name: Checkout NSPR if: env.USE_SYSTEM_NSS == '0' - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: nss-dev/nspr path: nspr @@ -111,7 +111,7 @@ runs: - name: Cache NSS id: cache if: env.USE_SYSTEM_NSS == '0' && runner.environment == 'github-hosted' - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: dist key: nss-${{ runner.os }}-${{ inputs.type }}-${{ env.NSS_HEAD }}-${{ env.NSPR_HEAD }} diff --git a/.github/actions/quic-interop-runner/action.yml b/.github/actions/quic-interop-runner/action.yml index 490ccd152e..c7f31e37a2 100644 --- a/.github/actions/quic-interop-runner/action.yml +++ b/.github/actions/quic-interop-runner/action.yml @@ -24,7 +24,7 @@ runs: using: "composite" steps: - name: Checkout quic-interop/quic-interop-runner repository - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: 'quic-interop/quic-interop-runner' path: 'quic-interop-runner' diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml index f23e252ca5..83d6dfe97e 100644 --- a/.github/workflows/actionlint.yml +++ b/.github/workflows/actionlint.yml @@ -22,7 +22,7 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Download actionlint id: get_actionlint run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index b2e7740cd0..e6173a8475 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -27,10 +27,10 @@ jobs: steps: - name: Checkout neqo - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Checkout msquic - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: microsoft/msquic ref: main @@ -70,7 +70,7 @@ jobs: - name: Download cached main-branch results id: criterion-cache - uses: actions/cache/restore@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 + uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: ./target/criterion key: criterion-${{ runner.name }}-${{ github.sha }} @@ -240,7 +240,7 @@ jobs: - name: Cache main-branch results if: github.ref == 'refs/heads/main' - uses: actions/cache/save@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 + uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: ./target/criterion key: criterion-${{ runner.name }}-${{ github.sha }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d9179bc35e..0d840b3e06 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -35,7 +35,7 @@ jobs: outputs: toolchains: ${{ steps.toolchains.outputs.toolchains }} steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: sparse-checkout: Cargo.toml - id: toolchains @@ -60,7 +60,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/rust with: diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 6bd7e3ccb3..84eaded3f7 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -31,7 +31,7 @@ jobs: shell: bash steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/rust with: components: clippy diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 38bb2dad1e..3b423b2bc2 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -24,8 +24,8 @@ jobs: dependency-review: runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - - uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0 with: base-ref: ${{ github.event.pull_request.base.sha || 'main' }} head-ref: ${{ github.event.pull_request.head.sha || github.ref }} diff --git a/.github/workflows/firefox.yml b/.github/workflows/firefox.yml index 90cc485b93..658d9d638a 100644 --- a/.github/workflows/firefox.yml +++ b/.github/workflows/firefox.yml @@ -35,7 +35,7 @@ jobs: steps: - name: Check out Neqo - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Maximize build space if: runner.os == 'Linux' @@ -54,7 +54,7 @@ jobs: df -h - name: Check out Firefox - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: mozilla/gecko-dev path: mozilla-unified @@ -144,7 +144,7 @@ jobs: needs: firefox runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: diff --git a/.github/workflows/fuzz-bench.yml b/.github/workflows/fuzz-bench.yml index 0749035b0f..8ef9323207 100644 --- a/.github/workflows/fuzz-bench.yml +++ b/.github/workflows/fuzz-bench.yml @@ -20,7 +20,7 @@ jobs: fuzz-bench: runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/rust with: version: nightly diff --git a/.github/workflows/machete.yml b/.github/workflows/machete.yml index f72d9215e6..b1f5c82333 100644 --- a/.github/workflows/machete.yml +++ b/.github/workflows/machete.yml @@ -20,7 +20,7 @@ jobs: machete: runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install Rust uses: ./.github/actions/rust diff --git a/.github/workflows/mutants.yml b/.github/workflows/mutants.yml index bd318c1b75..fcd52f8b9e 100644 --- a/.github/workflows/mutants.yml +++ b/.github/workflows/mutants.yml @@ -20,7 +20,7 @@ jobs: if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index 0ce5da9dc4..e0ae87e9a8 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -24,7 +24,7 @@ jobs: github.event.workflow_run.event == 'pull_request' && (github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure') steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/pr-comment with: name: ${{ github.event.workflow_run.name }} diff --git a/.github/workflows/qns.yml b/.github/workflows/qns.yml index 294382bea8..ee928cc12f 100644 --- a/.github/workflows/qns.yml +++ b/.github/workflows/qns.yml @@ -142,7 +142,7 @@ jobs: echo "client=$(echo "$PAIR" | cut -d% -f1)" >> "$GITHUB_OUTPUT" echo "server=$(echo "$PAIR" | cut -d% -f2)" >> "$GITHUB_OUTPUT" - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # TODO: Replace once https://github.com/quic-interop/quic-interop-runner/pull/356 is merged. - uses: ./.github/actions/quic-interop-runner @@ -158,7 +158,7 @@ jobs: runs-on: ubuntu-latest if: always() steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: pattern: '*results' diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index fd7710fea6..9c2147d54c 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -23,7 +23,7 @@ jobs: format: runs-on: ubuntu-latest steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/rust with: version: nightly diff --git a/.github/workflows/sanitize.yml b/.github/workflows/sanitize.yml index 2862a221e5..b49ec3ac7d 100644 --- a/.github/workflows/sanitize.yml +++ b/.github/workflows/sanitize.yml @@ -40,7 +40,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ./.github/actions/rust with: version: nightly diff --git a/Cargo.toml b/Cargo.toml index 1c9de115fa..8d3c8726d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ rust-version = "1.76.0" [workspace.dependencies] log = { version = "0.4", default-features = false } qlog = { version = "0.13", default-features = false } -quinn-udp = { version = "0.5.4", default-features = false, features = ["direct-log"] } +quinn-udp = { version = "0.5.6", default-features = false, features = ["direct-log"] } [workspace.lints.clippy] cargo = { level = "warn", priority = -1 } diff --git a/neqo-bin/src/client/http3.rs b/neqo-bin/src/client/http3.rs index 6ce41bef7c..b847f9a5f4 100644 --- a/neqo-bin/src/client/http3.rs +++ b/neqo-bin/src/client/http3.rs @@ -28,7 +28,7 @@ use neqo_transport::{ use url::Url; use super::{get_output_file, qlog_new, Args, CloseState, Res}; -use crate::STREAM_IO_BUFFER_SIZE; +use crate::{send_data::SendData, STREAM_IO_BUFFER_SIZE}; pub struct Handler<'a> { #[allow(clippy::struct_field_names)] @@ -312,9 +312,7 @@ impl StreamHandler for DownloadStreamHandler { } struct UploadStreamHandler { - data: Vec, - offset: usize, - chunk_size: usize, + data: SendData, start: Instant, } @@ -344,21 +342,11 @@ impl StreamHandler for UploadStreamHandler { } fn process_data_writable(&mut self, client: &mut Http3Client, stream_id: StreamId) { - while self.offset < self.data.len() { - let end = self.offset + self.chunk_size.min(self.data.len() - self.offset); - let chunk = &self.data[self.offset..end]; - match client.send_data(stream_id, chunk) { - Ok(amount) => { - if amount == 0 { - break; - } - self.offset += amount; - if self.offset == self.data.len() { - client.stream_close_send(stream_id).unwrap(); - } - } - Err(_) => break, - }; + let done = self + .data + .send(|chunk| client.send_data(stream_id, chunk).unwrap()); + if done { + client.stream_close_send(stream_id).unwrap(); } } } @@ -416,9 +404,7 @@ impl UrlHandler<'_> { Box::new(DownloadStreamHandler { out_file }) } "POST" => Box::new(UploadStreamHandler { - data: vec![42; self.args.upload_size], - offset: 0, - chunk_size: STREAM_IO_BUFFER_SIZE, + data: SendData::zeroes(self.args.upload_size), start: Instant::now(), }), _ => unimplemented!(), diff --git a/neqo-bin/src/lib.rs b/neqo-bin/src/lib.rs index a439183a74..f151f2642e 100644 --- a/neqo-bin/src/lib.rs +++ b/neqo-bin/src/lib.rs @@ -21,6 +21,7 @@ use neqo_transport::{ }; pub mod client; +mod send_data; pub mod server; pub mod udp; diff --git a/neqo-bin/src/send_data.rs b/neqo-bin/src/send_data.rs new file mode 100644 index 0000000000..5634d4c5c8 --- /dev/null +++ b/neqo-bin/src/send_data.rs @@ -0,0 +1,78 @@ +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::{borrow::Cow, cmp::min}; + +use crate::STREAM_IO_BUFFER_SIZE; + +#[derive(Debug)] +pub struct SendData { + data: Cow<'static, [u8]>, + offset: usize, + remaining: usize, + total: usize, +} + +impl From<&[u8]> for SendData { + fn from(data: &[u8]) -> Self { + Self::from(data.to_vec()) + } +} + +impl From> for SendData { + fn from(data: Vec) -> Self { + let remaining = data.len(); + Self { + total: data.len(), + data: Cow::Owned(data), + offset: 0, + remaining, + } + } +} + +impl From<&str> for SendData { + fn from(data: &str) -> Self { + Self::from(data.as_bytes()) + } +} + +impl SendData { + pub const fn zeroes(total: usize) -> Self { + const MESSAGE: &[u8] = &[0; STREAM_IO_BUFFER_SIZE]; + Self { + data: Cow::Borrowed(MESSAGE), + offset: 0, + remaining: total, + total, + } + } + + fn slice(&self) -> &[u8] { + let end = min(self.data.len(), self.offset + self.remaining); + &self.data[self.offset..end] + } + + pub fn send(&mut self, mut f: impl FnMut(&[u8]) -> usize) -> bool { + while self.remaining > 0 { + match f(self.slice()) { + 0 => { + return false; + } + sent => { + self.remaining -= sent; + self.offset = (self.offset + sent) % self.data.len(); + } + } + } + + self.remaining == 0 + } + + pub const fn len(&self) -> usize { + self.total + } +} diff --git a/neqo-bin/src/server/http09.rs b/neqo-bin/src/server/http09.rs index 1815140b01..1887e3ac6f 100644 --- a/neqo-bin/src/server/http09.rs +++ b/neqo-bin/src/server/http09.rs @@ -15,13 +15,13 @@ use neqo_transport::{ }; use regex::Regex; -use super::{qns_read_response, Args, ResponseData}; -use crate::STREAM_IO_BUFFER_SIZE; +use super::{qns_read_response, Args}; +use crate::{send_data::SendData, STREAM_IO_BUFFER_SIZE}; #[derive(Default)] struct HttpStreamState { writable: bool, - data_to_send: Option, + data_to_send: Option, } pub struct HttpServer { @@ -127,7 +127,7 @@ impl HttpServer { return; }; - let resp: ResponseData = { + let resp: SendData = { let path = path.as_str(); qdebug!("Path = '{path}'"); if self.is_qns_test { @@ -140,7 +140,7 @@ impl HttpServer { } } else { let count = path.parse().unwrap(); - ResponseData::zeroes(count) + SendData::zeroes(count) } }; @@ -173,8 +173,8 @@ impl HttpServer { stream_state.writable = true; if let Some(resp) = &mut stream_state.data_to_send { - resp.send_h09(stream_id, conn); - if resp.done() { + let done = resp.send(|chunk| conn.borrow_mut().stream_send(stream_id, chunk).unwrap()); + if done { conn.borrow_mut().stream_close_send(stream_id).unwrap(); self.write_state.remove(&stream_id); } else { diff --git a/neqo-bin/src/server/http3.rs b/neqo-bin/src/server/http3.rs index 3506387a62..dfef3f1be4 100644 --- a/neqo-bin/src/server/http3.rs +++ b/neqo-bin/src/server/http3.rs @@ -19,12 +19,13 @@ use neqo_http3::{ }; use neqo_transport::{server::ValidateAddress, ConnectionIdGenerator}; -use super::{qns_read_response, Args, ResponseData}; +use super::{qns_read_response, Args}; +use crate::send_data::SendData; pub struct HttpServer { server: Http3Server, /// Progress writing to each stream. - remaining_data: HashMap, + remaining_data: HashMap, posts: HashMap, is_qns_test: bool, } @@ -110,7 +111,7 @@ impl super::HttpServer for HttpServer { let mut response = if self.is_qns_test { match qns_read_response(path.value()) { - Ok(data) => ResponseData::from(data), + Ok(data) => SendData::from(data), Err(e) => { qerror!("Failed to read {}: {e}", path.value()); stream @@ -123,19 +124,19 @@ impl super::HttpServer for HttpServer { } else if let Ok(count) = path.value().trim_matches(|p| p == '/').parse::() { - ResponseData::zeroes(count) + SendData::zeroes(count) } else { - ResponseData::from(path.value()) + SendData::from(path.value()) }; stream .send_headers(&[ Header::new(":status", "200"), - Header::new("content-length", response.remaining.to_string()), + Header::new("content-length", response.len().to_string()), ]) .unwrap(); - response.send_h3(&stream); - if response.done() { + let done = response.send(|chunk| stream.send_data(chunk).unwrap()); + if done { stream.stream_close_send().unwrap(); } else { self.remaining_data.insert(stream.stream_id(), response); @@ -144,8 +145,8 @@ impl super::HttpServer for HttpServer { Http3ServerEvent::DataWritable { stream } => { if self.posts.get_mut(&stream).is_none() { if let Some(remaining) = self.remaining_data.get_mut(&stream.stream_id()) { - remaining.send_h3(&stream); - if remaining.done() { + let done = remaining.send(|chunk| stream.send_data(chunk).unwrap()); + if done { self.remaining_data.remove(&stream.stream_id()); stream.stream_close_send().unwrap(); } diff --git a/neqo-bin/src/server/mod.rs b/neqo-bin/src/server/mod.rs index 27e7ab3d95..8927890e8e 100644 --- a/neqo-bin/src/server/mod.rs +++ b/neqo-bin/src/server/mod.rs @@ -7,9 +7,7 @@ #![allow(clippy::future_not_send)] use std::{ - borrow::Cow, cell::RefCell, - cmp::min, fmt::{self, Display}, fs, io, net::{SocketAddr, ToSocketAddrs}, @@ -30,11 +28,10 @@ use neqo_crypto::{ constants::{TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256}, init_db, AntiReplay, Cipher, }; -use neqo_http3::{Http3OrWebTransportStream, StreamId}; -use neqo_transport::{server::ConnectionRef, Output, RandomConnectionIdGenerator, Version}; +use neqo_transport::{Output, RandomConnectionIdGenerator, Version}; use tokio::time::Sleep; -use crate::{SharedArgs, STREAM_IO_BUFFER_SIZE}; +use crate::SharedArgs; const ANTI_REPLAY_WINDOW: Duration = Duration::from_secs(10); @@ -409,89 +406,3 @@ pub async fn server(mut args: Args) -> Res<()> { .run() .await } - -#[derive(Debug)] -struct ResponseData { - data: Cow<'static, [u8]>, - offset: usize, - remaining: usize, -} - -impl From<&[u8]> for ResponseData { - fn from(data: &[u8]) -> Self { - Self::from(data.to_vec()) - } -} - -impl From> for ResponseData { - fn from(data: Vec) -> Self { - let remaining = data.len(); - Self { - data: Cow::Owned(data), - offset: 0, - remaining, - } - } -} - -impl From<&str> for ResponseData { - fn from(data: &str) -> Self { - Self::from(data.as_bytes()) - } -} - -impl ResponseData { - const fn zeroes(total: usize) -> Self { - const MESSAGE: &[u8] = &[0; STREAM_IO_BUFFER_SIZE]; - Self { - data: Cow::Borrowed(MESSAGE), - offset: 0, - remaining: total, - } - } - - fn slice(&self) -> &[u8] { - let end = min(self.data.len(), self.offset + self.remaining); - &self.data[self.offset..end] - } - - fn send_h3(&mut self, stream: &Http3OrWebTransportStream) { - while self.remaining > 0 { - match stream.send_data(self.slice()) { - Ok(0) => { - return; - } - Ok(sent) => { - self.remaining -= sent; - self.offset = (self.offset + sent) % self.data.len(); - } - Err(e) => { - qwarn!("Error writing to stream {}: {:?}", stream, e); - return; - } - } - } - } - - fn send_h09(&mut self, stream_id: StreamId, conn: &ConnectionRef) { - while self.remaining > 0 { - match conn - .borrow_mut() - .stream_send(stream_id, self.slice()) - .unwrap() - { - 0 => { - return; - } - sent => { - self.remaining -= sent; - self.offset = (self.offset + sent) % self.data.len(); - } - } - } - } - - const fn done(&self) -> bool { - self.remaining == 0 - } -} diff --git a/qns/Dockerfile b/qns/Dockerfile index e13ac76027..c93406890f 100644 --- a/qns/Dockerfile +++ b/qns/Dockerfile @@ -1,4 +1,4 @@ -FROM lukemathwalker/cargo-chef@sha256:3bf32e02df18ed868a19bcf6e937f99ca155cce42e45140737113526efd33c5f AS chef +FROM lukemathwalker/cargo-chef@sha256:49338f8970645f531cbef198e3929910f1dbf17491d73289ab838d5ac7ae3511 AS chef WORKDIR /app