[ovs-dev] [PATCH] windows: Allow clients to read from server before disconnect
Sairam Venugopal
vsairam at vmware.com
Fri Jan 27 08:18:57 UTC 2017
Good catch. We should probably do this for nl_sock_destroy too - https://github.com/openvswitch/ovs/blob/75e2077e0c43224bcca92746b28b01a4936fc101/lib/netlink-socket.c#L252
Acked-by: Sairam Venugopal <vsairam at vmware.com>
Thanks,
Sairam
On 1/26/17, 11:12 AM, "ovs-dev-bounces at openvswitch.org on behalf of Alin Serdean" <ovs-dev-bounces at openvswitch.org on behalf of aserdean at cloudbasesolutions.com> wrote:
>Wait for clients to read from the pipe before disconnecting the server.
>
>Found while testing.
>
>Signed-off-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
>---
>Intended for master and branch-2.7
>---
> lib/stream-windows.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/lib/stream-windows.c b/lib/stream-windows.c
>index 637920b..1950014 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);
>--
>2.10.2.windows.1
>_______________________________________________
>dev mailing list
>dev at openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=B91GBdYFjSO8Y5kwBvlStjj3QQ9jkCAtkZoyUCq0AOo&s=62rsfH2_7v8BrFzdR4Q_u2frBjxeHDtqw1_UbqIQvVg&e=
More information about the dev
mailing list