ninenines / cowlib

Support library for manipulating Web protocols.
ISC License
279 stars 173 forks source link

Add permessage-deflate approx max option #120

Open devsnek opened 2 years ago

devsnek commented 2 years ago

Adds an approx_max option to control memory usage. This is approx because zlib:safeInflate chunk sizes are not configurable so the size won't match up exactly, and we also don't check the final chunk (again because of the unconfigurable chunk size). This option is about general memory usage safety rather than enforcing specific application logic limits.

I'm not sure if I'm missing something but there don't appear to be any tests in this repo... How should one go about testing and verifying a change works?

essen commented 2 years ago

Tests are in Cowboy's ws_SUITE.

devsnek commented 2 years ago

@essen so should i clone cowboy and update the makefile to point to my branch? i've never really worked with erlang directly before 😅

essen commented 2 years ago

You can clone Cowboy, do mkdir deps; cd deps; ln -s /path/to/your/cowlib; cd .. and then go on from there.