aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/nifs/common/zlib_nif.c
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2017-11-09 16:15:41 +0100
committerErlang/OTP <[email protected]>2017-11-09 16:15:41 +0100
commit8ceee73b703976cdc09687b4c0efcf2c490c3954 (patch)
treea463ea75d7f8c2f4756d9f5860b2c6b5955b05f9 /erts/emulator/nifs/common/zlib_nif.c
parent0a3d5ad6f2dec30f450e1a29f1150a139cd4777f (diff)
parent9b1f2439845e5627a00fb816244af06d77c2d70a (diff)
downloadotp-8ceee73b703976cdc09687b4c0efcf2c490c3954.tar.gz
otp-8ceee73b703976cdc09687b4c0efcf2c490c3954.tar.bz2
otp-8ceee73b703976cdc09687b4c0efcf2c490c3954.zip
Merge branch 'john/erts/fix-gunzip-eos/OTP-14730/ERL-507' into maint-20
* john/erts/fix-gunzip-eos/OTP-14730/ERL-507: Only apply EOS behaviors if there's pending data
Diffstat (limited to 'erts/emulator/nifs/common/zlib_nif.c')
-rw-r--r--erts/emulator/nifs/common/zlib_nif.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/erts/emulator/nifs/common/zlib_nif.c b/erts/emulator/nifs/common/zlib_nif.c
index 9565a5a059..b709ed5a6f 100644
--- a/erts/emulator/nifs/common/zlib_nif.c
+++ b/erts/emulator/nifs/common/zlib_nif.c
@@ -946,7 +946,7 @@ static ERL_NIF_TERM zlib_inflate(ErlNifEnv *env, int argc, const ERL_NIF_TERM ar
return enif_raise_exception(env, am_not_initialized);
}
- if(d->eos_seen) {
+ if(d->eos_seen && enif_ioq_size(d->input_queue) > 0) {
int res;
switch(d->eos_behavior) {
@@ -960,11 +960,10 @@ static ERL_NIF_TERM zlib_inflate(ErlNifEnv *env, int argc, const ERL_NIF_TERM ar
}
d->eos_seen = 0;
+
break;
case EOS_BEHAVIOR_CUT:
zlib_reset_input(d);
-
- return enif_make_tuple2(env, am_finished, enif_make_list(env, 0));
}
}