diff options
author | Jiri Denemark <jdenemar@redhat.com> | 2011-11-22 14:11:02 +0100 |
---|---|---|
committer | Jiri Denemark <jdenemar@redhat.com> | 2011-11-24 11:44:07 +0100 |
commit | 78965a33e8a5666cee06b038c22990454a0ed546 (patch) | |
tree | 856e73eaa8b110a63bdf899ac60d7beff5b651e8 | |
parent | rpc: Fix a typo in virNetClientSendNonBlock documentation (diff) | |
download | libvirt-78965a33e8a5666cee06b038c22990454a0ed546.tar.gz libvirt-78965a33e8a5666cee06b038c22990454a0ed546.tar.bz2 libvirt-78965a33e8a5666cee06b038c22990454a0ed546.zip |
rpc: Fix handling of non-blocking calls that could not be sent
When virNetClientIOEventLoop is called for a non-blocking call and not
even a single byte can be sent from this call without blocking, we
properly reported that to the caller which properly frees the call. But
we never removed the call from a call queue.
-rw-r--r-- | src/rpc/virnetclient.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 0effceb77..c99e87c90 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -1256,7 +1256,12 @@ static int virNetClientIOEventLoop(virNetClientPtr client, /* We're not done, but we're non-blocking */ if (thiscall->nonBlock) { virNetClientIOEventLoopPassTheBuck(client, thiscall); - return thiscall->sentSomeData ? 1 : 0; + if (thiscall->sentSomeData) { + return 1; + } else { + virNetClientCallRemove(&client->waitDispatch, thiscall); + return 0; + } } if (fds[0].revents & (POLLHUP | POLLERR)) { |