File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
ext/node/polyfills/internal_binding Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 3030// TODO(petamoriken): enable prefer-primordials for node polyfills
3131// deno-lint-ignore-file prefer-primordials
3232
33- import { core } from "ext:core/mod.js" ;
33+ import { core , primordials } from "ext:core/mod.js" ;
3434const { internalRidSymbol } = core ;
35+ const {
36+ PromiseResolve,
37+ } = primordials ;
3538import { op_can_write_vectored , op_raw_write_vectored } from "ext:core/ops" ;
3639
3740import { TextEncoder } from "ext:deno_web/08_text_encoding.js" ;
@@ -319,6 +322,12 @@ export class LibuvStreamWrap extends HandleWrap {
319322
320323 /** Internal method for reading from the attached stream. */
321324 async #read( ) {
325+ // Queue the read operation and allow TLS upgrades to complete.
326+ //
327+ // This is done to ensure that the resource is not locked up by
328+ // op_read.
329+ await PromiseResolve ( ) ;
330+
322331 let buf = this . #buf;
323332
324333 let nread : number | null ;
You can’t perform that action at this time.
0 commit comments