spdy-http2 / node-spdy

SPDY server on Node.js
2.81k stars 196 forks source link

zlib inflation should auto-determine its window size. #187

Closed rnapier closed 9 years ago

rnapier commented 9 years ago

Setting windowBits to 15 allocates 32k of memory for the inflation buffer (the largest legal zlib window). The sender may be using a smaller window (and with SPDY, likely is), so this can be a significant waste of memory if there are many connections.

From inflateInit2():

windowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream.

indutny commented 9 years ago

Makes sense. LGTM. Thank you!

indutny commented 9 years ago

Landed and released!