Thanks for the patch. Acked-by: Sairam Venugopal <vsai...@vmware.com>
On 12/15/16, 6:50 PM, "ovs-dev-boun...@openvswitch.org on behalf of Alin Serdean" <ovs-dev-boun...@openvswitch.org on behalf of aserd...@cloudbasesolutions.com> wrote: >Unfortunately, WSAPoll misbehaves on Windows please view detailed behavior >on: >https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_117&d=DgICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=M43Vy7g0K7OsweCVJxZrS570qaugZa0GWkVFTSLSXAM&s=-KOiNyQRqMrRwOB0MrQCaAU8oOFKuhhd8-4lqDonogc&e= > > >We replace the WSAPoll with select looking only for errors and write events. > >Signed-off-by: Alin Gabriel Serdean <aserd...@cloudbasesolutions.com> >Reported-at: >https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openvswitch_ovs-2Dissues_issues_117&d=DgICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=M43Vy7g0K7OsweCVJxZrS570qaugZa0GWkVFTSLSXAM&s=-KOiNyQRqMrRwOB0MrQCaAU8oOFKuhhd8-4lqDonogc&e= > >Reported-by: Yin Lin <li...@vmware.com> >--- > lib/socket-util.c | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/lib/socket-util.c b/lib/socket-util.c >index 5a36f3b..2c0f1e6 100644 >--- a/lib/socket-util.c >+++ b/lib/socket-util.c >@@ -253,7 +253,23 @@ check_connection_completion(int fd) > retval = poll(&pfd, 1, 0); > } while (retval < 0 && errno == EINTR); > #else >- retval = WSAPoll(&pfd, 1, 0); >+ fd_set wrset, exset; >+ FD_ZERO(&wrset); >+ FD_ZERO(&exset); >+ FD_SET(fd, &exset); >+ FD_SET(fd, &wrset); >+ pfd.revents = 0; >+ struct timeval tv = { 0, 0 }; >+ /* WSAPoll is broken on Windows, instead do a select */ >+ retval = select(0, NULL, &wrset, &exset, &tv); >+ if (retval == 1) { >+ if (FD_ISSET(fd, &wrset)) { >+ pfd.revents |= pfd.events; >+ } >+ if (FD_ISSET(fd, &exset)) { >+ pfd.revents |= POLLERR; >+ } >+ } > #endif > if (retval == 1) { > if (pfd.revents & POLLERR) { >-- >2.10.2.windows.1 >_______________________________________________ >dev mailing list >d...@openvswitch.org >https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DgICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Z6vowHUOjP5ysP_g372c49Nqc1vEKqHKNBkR5Q5Z7uo&m=M43Vy7g0K7OsweCVJxZrS570qaugZa0GWkVFTSLSXAM&s=5XlxuBop2dQonerVSbsYe1sIMx7-oxWaNNJmxP4aMrc&e= > _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev