Skip to content

Conversation

Fefer-Ivan
Copy link
Contributor

@Fefer-Ivan Fefer-Ivan commented Sep 8, 2020

While working on a previous pull request, I noticed following note in zlib documentation https://zlib.net/zlib_how.html:

CHUNK is simply the buffer size for feeding data to and pulling data from the zlib routines.
Larger buffer sizes would be more efficient, especially for inflate().
If the memory is available, buffers sizes on the order of 128K or 256K bytes should be used.

So I decided to add CPPHTTPLIB_COMPRESSION_BUFSIZ macro in line with CPPHTTPLIB_RECV_BUFSIZ macro to allow for buffer size customization on different systems.

Also, I found that brotli decomressor code is written using C-array instead of std::array (as in other [de]compressors), so I refactored it slightly.

Hope it is useful.

Thank you.

@yhirose
Copy link
Owner

yhirose commented Sep 8, 2020

@Fefer-Ivan, looks very good to me. Thanks for your great contribution!

@yhirose yhirose merged commit 3da4a0a into yhirose:master Sep 8, 2020
ExclusiveOrange pushed a commit to ExclusiveOrange/cpp-httplib-exor that referenced this pull request May 2, 2023
* add compression buffer size customization and small brotli refactor

* allocat brotli buffer once

* add init to brotli decoder buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants