]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Don't sleep in poll() if there is existing SASL decoded data
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 1 Feb 2011 16:00:32 +0000 (16:00 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 2 Feb 2011 10:59:55 +0000 (10:59 +0000)
commit68d2c3482fa16801f8e6ca5c42698319bb87f385
tree6d6d2e6e3acf7a116115b188505f1d659a3cbf09
parentae057283805a897cbc3ed44b054e7f1ad8049ea7
Don't sleep in poll() if there is existing SASL decoded data

In the SASL codepath we typically read far more data off the
wire than we immediately need. When using a connection from a
single thread this isn't a problem, since only our reply will
be pending (or an event we can handle directly). When using a
connection from multiple threads though, we may read the data
from replies from other threads. If those replies occur after
our own reply, they'll not be processed. The other thread will
then go into poll() and wait for its reply which has already
been received and decoded. The solution is to set poll() timeout
to 0 if there is pending SASL data.

* src/remote/remote_driver.c: Don't sleep in poll() if SASL
  data exists
src/remote/remote_driver.c