Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zlip decompressing for some cases. #179

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

horu
Copy link
Contributor

@horu horu commented Mar 28, 2023

Hi.
zlib doc says inflate returns Z_STREAM_END if the end of the compressed data has
been reached and all uncompressed output has been produced (https://github.com/madler/zlib/blob/master/zlib.h#L503). It means we can finish decompressing and break the loop even we still have input data ( avail_in is not zero ). In other case we get infinite loop when decompressing is finished but input buffer is not empty.

Thank you.

@eao197
Copy link
Member

eao197 commented Mar 29, 2023

Hi! Thanks, I'll take a look at it a bit later today.

@eao197
Copy link
Member

eao197 commented Mar 29, 2023

@horu, may I ask, have you encountered a case of infinite loop during decompression in the wild?

@eao197 eao197 changed the base branch from master to 0.6-dev-pr-179 March 30, 2023 11:53
@eao197 eao197 merged commit 2af1467 into Stiffstream:0.6-dev-pr-179 Mar 30, 2023
@horu
Copy link
Contributor Author

horu commented Mar 30, 2023

We have got infinite loop for our high load service when it receives invalid post requests. We have no examples now but we had some.

@eao197
Copy link
Member

eao197 commented Mar 30, 2023

Thanks for your PR. I'm working on the update for RESTinio and hope to release a version with the fix in a couple of days.

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