summaryrefslogtreecommitdiffstats
path: root/crypto/comp/c_zlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/comp/c_zlib.c')
-rw-r--r--crypto/comp/c_zlib.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c
index 78219f202d..1dd7d67998 100644
--- a/crypto/comp/c_zlib.c
+++ b/crypto/comp/c_zlib.c
@@ -598,6 +598,28 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr)
BIO_copy_next_retry(b);
break;
+ case BIO_CTRL_WPENDING:
+ if (ctx->obuf == NULL)
+ return 0;
+
+ if (ctx->odone) {
+ ret = ctx->ocount;
+ } else {
+ ret = ctx->ocount;
+ if (ret == 0)
+ /* Unknown amount pending but we are not finished */
+ ret = 1;
+ }
+ if (ret == 0)
+ ret = BIO_ctrl(next, cmd, num, ptr);
+ break;
+
+ case BIO_CTRL_PENDING:
+ ret = ctx->zin.avail_in;
+ if (ret == 0)
+ ret = BIO_ctrl(next, cmd, num, ptr);
+ break;
+
default:
ret = BIO_ctrl(next, cmd, num, ptr);
break;