Skip to content

Commit

Permalink
[ruby/zlib] Resume zstream if available [Bug #10961]
Browse files Browse the repository at this point in the history
  • Loading branch information
wanabe committed Mar 9, 2021
1 parent e85bffc commit 0c5f8c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/zlib/zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,12 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
RB_NOGVL_UBF_ASYNC_SAFE);
#endif

/* retry if no exception is thrown */
if (err == Z_OK && args.interrupt) {
args.interrupt = 0;
goto loop;
}

if (flush != Z_FINISH && err == Z_BUF_ERROR
&& z->stream.avail_out > 0) {
z->flags |= ZSTREAM_FLAG_IN_STREAM;
Expand Down

0 comments on commit 0c5f8c6

Please sign in to comment.