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:
Marek Marczykowski 2013-06-07 05:22:13 +02:00 committed by Marek Marczykowski-Górecki
parent dc41fbad79
commit 08f6f18af7

View File

@ -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;
}