From 2c2dabc127c2bce085d268d06e739aeba6a99411 Mon Sep 17 00:00:00 2001 From: jyelon Date: Fri, 14 Apr 2023 17:01:59 -0400 Subject: [PATCH] Fix a bug in the driver, closing channel too soon --- luprex/cpp/drv/driver-common.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/luprex/cpp/drv/driver-common.cpp b/luprex/cpp/drv/driver-common.cpp index 78d81ef9..816d3073 100644 --- a/luprex/cpp/drv/driver-common.cpp +++ b/luprex/cpp/drv/driver-common.cpp @@ -449,8 +449,10 @@ class Driver { } if (chan.nbytes == 0) { if (engw.get_channel_released(&engw, chan.chid)) { - close_channel(chan, ""); - any_released = true; + if (BIO_pending(chan.send_bio) == 0) { + close_channel(chan, ""); + any_released = true; + } } } }