Skip to content

Commit 96235f5

Browse files
committed
base: Fix a bug where enabling read when an error comes in
If you enable read on a gensio when an error has already come in and the gensio is going through error shutdown, the enable can be missed and the read callback reporting the error won't happen. Expand the states where a read enable will cause a deferred op. Signed-off-by: Corey Minyard <[email protected]>
1 parent 22e8586 commit 96235f5

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

ISSUES

-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ this in test_mdns.py if there are multiple callbacks to mdns_cb.
99
There is not an easy workaround, it is probably better to catch
1010
exceptions in all callbacks.
1111

12-
Windows has some strange behavior that I can't track down dealing with
13-
socket closing. It looks like in some cases that a close won't be
14-
reported in winsock_func() if the source and destination sockets are
15-
both in the same process. That seems to be why
16-
test_ssl_tcp_accept_connect.py fails occassionally, I (think I) have
17-
verified that one side of the connection gets closed but the close is
18-
not reported on the other side.
19-
2012
On Windows, a new pty spews out a bunch of terminal control stuff and
2113
messes things up for testing and for things like rsync. Some way to
2214
disable this is needed. This breaks test_pty_basic.py. See

lib/gensio_base.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,9 @@ basen_set_read_callback_enable(struct basen_data *ndata, bool enabled)
14611461
/* Nothing to do, let the read/open handling wake things up. */
14621462
ndata->deferred_read = true;
14631463
} else if (enabled && (read_pending || ndata->ll_err) &&
1464-
ndata->state == BASEN_OPEN) {
1464+
(ndata->state == BASEN_OPEN ||
1465+
ndata->state == BASEN_IO_ERR_CLOSE ||
1466+
ndata->state == BASEN_IN_LL_IO_ERR_CLOSE)) {
14651467
ndata->deferred_read = true;
14661468
basen_sched_deferred_op(ndata);
14671469
} else {

0 commit comments

Comments
 (0)