summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Serdean <aserdean@cloudbasesolutions.com>2017-01-26 19:12:20 +0000
committerGurucharan Shetty <guru@ovn.org>2017-01-27 14:24:51 -0800
commit67fd906054d592ed4a8d54deb80348224b121aeb (patch)
tree9405ca3e4b3f6a2d0aa2f8c9a200745cd4d50f72
parent13574ee6c094a31f1cc9abf84ba688ff441dac5c (diff)
downloadopenvswitch-67fd906054d592ed4a8d54deb80348224b121aeb.tar.gz
windows: Allow clients to read from server before disconnect
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>
-rw-r--r--lib/stream-windows.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/stream-windows.c b/lib/stream-windows.c
index 637920b10..195001441 100644
--- a/lib/stream-windows.c
+++ b/lib/stream-windows.c
@@ -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);