From 51d3fb78ad2453e649d01bcc833ecfec1a05d685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 3 Apr 2023 19:01:02 +0200 Subject: refactor: remove "ext/flash" (#18578) With https://github.com/denoland/deno/pull/18568 landed we no longer need "ext/flash". This commit removes "deno_flash" extension completely. This should have some impact on the binary and snapshot size. Closes https://github.com/denoland/deno/issues/17356 --- ext/flash/request.rs | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 ext/flash/request.rs (limited to 'ext/flash/request.rs') diff --git a/ext/flash/request.rs b/ext/flash/request.rs deleted file mode 100644 index 32ab46ca2..000000000 --- a/ext/flash/request.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -use crate::Stream; -use std::pin::Pin; - -#[derive(Debug)] -pub struct InnerRequest { - /// Backing buffer for the request. - pub buffer: Pin>, - /// Owned headers, we have to keep it around since its referenced in `req`. - pub _headers: Vec>, - /// Fully parsed request. - pub req: httparse::Request<'static, 'static>, - pub body_offset: usize, - pub body_len: usize, -} - -#[derive(Debug)] -pub struct Request { - pub inner: InnerRequest, - // Pointer to stream owned by the server loop thread. - // - // Dereferencing is safe until server thread finishes and - // op_flash_serve resolves or websocket upgrade is performed. - pub socket: *mut Stream, - pub keep_alive: bool, - pub content_read: usize, - pub content_length: Option, - pub remaining_chunk_size: Option, - pub te_chunked: bool, - pub expect_continue: bool, -} - -// SAFETY: Sent from server thread to JS thread. -// See comment above for `socket`. -unsafe impl Send for Request {} - -impl Request { - #[inline(always)] - pub fn socket<'a>(&self) -> &'a mut Stream { - // SAFETY: Dereferencing is safe until server thread detaches socket or finishes. - unsafe { &mut *self.socket } - } - - #[inline(always)] - pub fn method(&self) -> &str { - self.inner.req.method.unwrap() - } -} -- cgit v1.2.3