]> git.proxmox.com Git - ovs.git/commitdiff
windows: Allow clients to read from server before disconnect
authorAlin Serdean <aserdean@cloudbasesolutions.com>
Thu, 26 Jan 2017 19:12:20 +0000 (19:12 +0000)
committerGurucharan Shetty <guru@ovn.org>
Fri, 27 Jan 2017 22:24:51 +0000 (14:24 -0800)
Wait for clients to read from the pipe before disconnecting the server.

Found while testing.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
lib/stream-windows.c

index 637920b1087aef80891962ca5edbecbecd1f3155..19500144138950f02c3d02f208d6dcc214241582 100644 (file)
@@ -183,6 +183,9 @@ windows_close(struct stream *stream)
     /* Disconnect the named pipe in case it was created from a passive stream.
      */
     if (s->server) {
+        /* Flush the pipe to allow the client to read the pipe's contents
+         * before disconnecting. */
+        FlushFileBuffers(s->fd);
         DisconnectNamedPipe(s->fd);
     }
     CloseHandle(s->fd);