mirror of
https://github.com/denoland/deno.git
synced 2025-01-07 14:48:14 -05:00
perf(ext/http): remove accept_encoding interior mutability (#15070)
This commit is contained in:
parent
d9d86078b0
commit
f62ce06263
1 changed files with 3 additions and 3 deletions
|
@ -307,7 +307,7 @@ pub struct HttpStreamResource {
|
||||||
conn: Rc<HttpConnResource>,
|
conn: Rc<HttpConnResource>,
|
||||||
pub rd: AsyncRefCell<HttpRequestReader>,
|
pub rd: AsyncRefCell<HttpRequestReader>,
|
||||||
wr: AsyncRefCell<HttpResponseWriter>,
|
wr: AsyncRefCell<HttpResponseWriter>,
|
||||||
accept_encoding: RefCell<Encoding>,
|
accept_encoding: Encoding,
|
||||||
cancel_handle: CancelHandle,
|
cancel_handle: CancelHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ impl HttpStreamResource {
|
||||||
conn: conn.clone(),
|
conn: conn.clone(),
|
||||||
rd: HttpRequestReader::Headers(request).into(),
|
rd: HttpRequestReader::Headers(request).into(),
|
||||||
wr: HttpResponseWriter::Headers(response_tx).into(),
|
wr: HttpResponseWriter::Headers(response_tx).into(),
|
||||||
accept_encoding: RefCell::new(accept_encoding),
|
accept_encoding,
|
||||||
cancel_handle: CancelHandle::new(),
|
cancel_handle: CancelHandle::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -491,7 +491,7 @@ async fn op_http_write_headers(
|
||||||
.get::<HttpStreamResource>(rid)?;
|
.get::<HttpStreamResource>(rid)?;
|
||||||
|
|
||||||
// Track supported encoding
|
// Track supported encoding
|
||||||
let encoding = *stream.accept_encoding.borrow();
|
let encoding = stream.accept_encoding;
|
||||||
|
|
||||||
let mut builder = Response::builder();
|
let mut builder = Response::builder();
|
||||||
// SAFETY: can not fail, since a fresh Builder is non-errored
|
// SAFETY: can not fail, since a fresh Builder is non-errored
|
||||||
|
|
Loading…
Reference in a new issue