google / ngx_brotli

NGINX module for Brotli compression
BSD 2-Clause "Simplified" License
2.1k stars 216 forks source link

Prevent spinning when progress is not being made. #100

Closed awused closed 4 years ago

awused commented 4 years ago

Fixes #80 at least for my examples.

eustas commented 4 years ago

Hello. Thanks for the PR.

So, it will resolve the tight loop (when brotli waits for output buffer to be consumed, but the filter below does not make any progress).

But the question is - will nginx react as expected. IIRC, we already got problem with returning NGX_AGAIN... Will try to find what was it and update this comment soon.

eustas commented 4 years ago

Is was about NGX_OK vs NGX_DONE.

LGTM. Will land the PR, but reopen the issue, to gather the feedback from other users.

Thanks again.

HansVanEijsden commented 4 years ago

Thanks for the progress! I'm pushing this to production now, and will let you know if the problem comes back. 👍🏻