Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

zlib documentation & wish for zlib.*Sync calls #3128

Closed
axkibe opened this issue Apr 18, 2012 · 4 comments
Closed

zlib documentation & wish for zlib.*Sync calls #3128

axkibe opened this issue Apr 18, 2012 · 4 comments
Labels

Comments

@axkibe
Copy link

axkibe commented Apr 18, 2012

a) The links at:
Returns a new Gzip object with an options.to

http://nodejs.org/docs/latest/api/zlib.html#zlib.Gzip

do not resolve, because it is

http://nodejs.org/docs/latest/api/zlib.html#zlib_class_zlib_gzip

b) The documentation of the Gzip project is practically non existent.
Class: zlib.Gzip# Compress data using gzip. <-- what methods does it have? what steams, events, etc?

c) Wishing for a zlib.gzipSync since I want to zip and cache one big client side javascript file at startup and not clutter startup sequence with additional callbacks.

@bnoordhuis
Copy link
Member

The links have been fixed in 540a441.

If you feel that the documentation is lacking, please submit a pull request. Ping me on IRC if you want pointers.

As to adding synchronous functions, making the API fully asynchronous was a conscious decision. Compression/decompression is computationally expensive. Doing it synchronously has the potential to stall the event loop for prolonged periods of time.

There is a legitimate use case for doing one-time compression/decompression at start-up but the potential for misuse is too great, hence it won't be added.

@isaacs
Copy link

isaacs commented Apr 18, 2012

making the API fully asynchronous was a conscious decision.

Well, it was as much a matter of priorities and time as anything else. We'd accept a patch for zlib.*Sync helper methods, if it was done cleanly and there was a lot of people asking for it. It's not significantly more hazardous than synchronous fs functions.

Class: zlib.Gzip# Compress data using gzip. <-- what methods does it have? what steams, events, etc?

The zlib classes are all filter streams. That's explained at the top of the page. Doc patches are always welcome.

@bnoordhuis
Copy link
Member

We'd accept a patch for zlib.*Sync helper methods, if it was done cleanly and there was a lot of people asking for it. It's not significantly more hazardous than synchronous fs functions.

I don't want that. There are already enough people who think that that the fs.*Sync() methods are instantaneous enough that it doesn't hurt to slip one in.

@isaacs
Copy link

isaacs commented Apr 18, 2012

@bnoordhuis It's good that we'll have some opposing voices, then :) In practice, this isn't asked for very often, and would be tricky to do in a clean way that doesn't muddy up the streaming logic, so my guess is that it'll never actually happen.

richardlau pushed a commit to ibmruntimes/node that referenced this issue Oct 6, 2015
Notable changes

* http:
  - Fix out-of-order 'finish' event bug in pipelining that can abort
    execution, fixes DoS vulnerability CVE-2015-7384
    (Fedor Indutny) nodejs#3128
  - Account for pending response data instead of just the data on the
    current request to decide whether pause the socket or not
    (Fedor Indutny) nodejs#3128
* libuv: Upgraded from v1.7.4 to v1.7.5, see release notes for details
  (Saúl Ibarra Corretgé) nodejs#3010
  - A better rwlock implementation for all Windows versions
  - Improved AIX support
* v8:
  - Upgraded from v4.5.103.33 to v4.5.103.35 (Ali Ijaz Sheikh) nodejs#3117
  - Backported f782159 from v8's upstream to help speed up Promise
    introspection (Ben Noordhuis) nodejs#3130
  - Backported c281c15 from v8's upstream to add JSTypedArray length
    in post-mortem metadata (Julien Gilli) nodejs#3031

PR-URL: nodejs/node#3128
richardlau pushed a commit to ibmruntimes/node that referenced this issue Oct 6, 2015
Notable changes

* http:
  - Fix out-of-order 'finish' event bug in pipelining that can abort
    execution, fixes DoS vulnerability CVE-2015-7384
    (Fedor Indutny) nodejs#3128
  - Account for pending response data instead of just the data on the
    current request to decide whether pause the socket or not
    (Fedor Indutny) nodejs#3128
* libuv: Upgraded from v1.7.4 to v1.7.5, see release notes for details
  (Saúl Ibarra Corretgé) nodejs#3010
  - A better rwlock implementation for all Windows versions
  - Improved AIX support
* v8:
  - Upgraded from v4.5.103.33 to v4.5.103.35 (Ali Ijaz Sheikh) nodejs#3117
  - Backported f782159 from v8's upstream to help speed up Promise
    introspection (Ben Noordhuis) nodejs#3130
  - Backported c281c15 from v8's upstream to add JSTypedArray length
    in post-mortem metadata (Julien Gilli) nodejs#3031

PR-URL: nodejs/node#3128
richardlau pushed a commit to ibmruntimes/node that referenced this issue Nov 5, 2015
Notable changes

* http:
  - Fix out-of-order 'finish' event bug in pipelining that can abort
    execution, fixes DoS vulnerability CVE-2015-7384
    (Fedor Indutny) nodejs#3128
  - Account for pending response data instead of just the data on the
    current request to decide whether pause the socket or not
    (Fedor Indutny) nodejs#3128
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants