]> xenbits.xensource.com Git - libvirt.git/commitdiff
rpc: Fix handling of non-blocking calls that could not be sent
authorJiri Denemark <jdenemar@redhat.com>
Tue, 22 Nov 2011 13:11:02 +0000 (14:11 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 24 Nov 2011 10:44:07 +0000 (11:44 +0100)
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.

src/rpc/virnetclient.c

index 0effceb77d116bda5b99b7b4f59cc96e024ecd0d..c99e87c90c1695d3c702850db095f457b419135a 100644 (file)
@@ -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)) {