forked from spdy-http2/spdy-transport
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Attempt to work around Deno zlib regression"
This reverts commit e1885e0. Deno merged a fix: * denoland/deno#19540 (comment) Should land in v1.36.2.
- Loading branch information
Showing
2 changed files
with
9 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
import { Buffer } from 'node:buffer'; | ||
import { createDeflate,constants,createInflate, Deflate } from 'node:zlib'; | ||
import { Inflate } from "https://deno.land/x/[email protected]/zlib/mod.ts"; | ||
import { createDeflate,constants,createInflate, Deflate, Inflate } from 'node:zlib'; | ||
import { dictionary } from "./dictionary.ts"; | ||
|
||
export { type Deflate, Inflate, constants }; | ||
|
||
// TODO(indutny): think about it, why has it always been Z_SYNC_FLUSH here. | ||
// It should be possible to manually flush stuff after the write instead | ||
function _createDeflate (version: 2|3|3.1, compression: boolean) { | ||
const deflate = createDeflate({ | ||
// dictionary: Buffer.from(dictionary[version]), | ||
dictionary: Buffer.from(dictionary[version]), | ||
flush: constants.Z_SYNC_FLUSH, | ||
windowBits: 11, | ||
level: compression ? constants.Z_DEFAULT_COMPRESSION : constants.Z_NO_COMPRESSION | ||
|
@@ -19,9 +16,9 @@ function _createDeflate (version: 2|3|3.1, compression: boolean) { | |
} | ||
|
||
function _createInflate (version: 2|3|3.1) { | ||
const inflate = new Inflate({ | ||
dictionary: dictionary[version], | ||
// flush: constants.Z_SYNC_FLUSH | ||
const inflate = createInflate({ | ||
dictionary: Buffer.from(dictionary[version]), | ||
flush: constants.Z_SYNC_FLUSH | ||
}) | ||
|
||
return inflate | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters