qrexec-lib: prevent deadlock on vchan
It can happen that we already cleared libvchan_fd pending state via libvchan_wait, but data arrived later. This is especially true just after connection, when client send unsolicited notification to server, which can confuse it with some requested notification.
This commit is contained in:
parent
dc41fbad79
commit
08f6f18af7
@ -60,6 +60,8 @@ int wait_for_vchan_or_argfd_once(libvchan_t *ctrl, int max, fd_set * rdset, fd_s
|
||||
// the following will never block; we need to do this to
|
||||
// clear libvchan_fd pending state
|
||||
libvchan_wait(ctrl);
|
||||
if (libvchan_data_ready(ctrl))
|
||||
return 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user