From 898445cfd19904c83e9621dbf61f5bffb286fc37 Mon Sep 17 00:00:00 2001 From: wanabe Date: Sun, 7 Mar 2021 21:22:47 +0900 Subject: [PATCH] Resume zstream if available [Bug #10961] --- ext/zlib/zlib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 90fa5a6..1db5bdb 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -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;