diff options
author | John Högberg <[email protected]> | 2017-11-01 16:53:51 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2017-11-02 08:35:51 +0100 |
commit | 9b1f2439845e5627a00fb816244af06d77c2d70a (patch) | |
tree | 7086d88ecfb6602a9a5ac88a491f64014d35c910 /erts/emulator/nifs/common | |
parent | a98379d0519c28f9bc9b673ed2c09fb1ad52456e (diff) | |
download | otp-9b1f2439845e5627a00fb816244af06d77c2d70a.tar.gz otp-9b1f2439845e5627a00fb816244af06d77c2d70a.tar.bz2 otp-9b1f2439845e5627a00fb816244af06d77c2d70a.zip |
Only apply EOS behaviors if there's pending data
Diffstat (limited to 'erts/emulator/nifs/common')
-rw-r--r-- | erts/emulator/nifs/common/zlib_nif.c | 5 |
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 fa29b4fb71..104e52754a 100644 --- a/erts/emulator/nifs/common/zlib_nif.c +++ b/erts/emulator/nifs/common/zlib_nif.c @@ -929,7 +929,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) { @@ -943,11 +943,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)); } } |