Bruno Jesus : ws2_32: Check for OOB data in select() calls when not OOB_INLINED.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 30 10:12:57 CDT 2015


Module: wine
Branch: master
Commit: 10d51ce8554e3eda7cf4a99e4631f6d9b47a8a4a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=10d51ce8554e3eda7cf4a99e4631f6d9b47a8a4a

Author: Bruno Jesus <00cpxxx at gmail.com>
Date:   Sun Mar 29 00:53:58 2015 -0300

ws2_32: Check for OOB data in select() calls when not OOB_INLINED.

---

 dlls/ws2_32/socket.c     | 8 ++++++++
 dlls/ws2_32/tests/sock.c | 2 --
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 717a394..4444011 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -4516,7 +4516,15 @@ static struct pollfd *fd_sets_to_poll( const WS_fd_set *readfds, const WS_fd_set
             fds[j].revents = 0;
             if (is_fd_bound(fds[j].fd, NULL, NULL) == 1)
             {
+                int oob_inlined = 0;
+                socklen_t olen = sizeof(oob_inlined);
+
                 fds[j].events = POLLHUP;
+
+                /* Check if we need to test for urgent data or not */
+                getsockopt(fds[j].fd, SOL_SOCKET, SO_OOBINLINE, (char*) &oob_inlined, &olen);
+                if (!oob_inlined)
+                    fds[j].events |= POLLPRI;
             }
             else
             {
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 1f30fda..b7bc006 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -3626,9 +3626,7 @@ static void test_select(void)
     FD_SET(fdRead, &readfds);
     FD_SET(fdRead, &exceptfds);
     ret = select(0, &readfds, &writefds, &exceptfds, &select_timeout);
-todo_wine
     ok(ret == 1, "expected 1, got %d\n", ret);
-todo_wine
     ok(FD_ISSET(fdRead, &exceptfds), "fdRead socket is not in the set\n");
     tmp_buf[0] = 0xAF;
     ret = recv(fdRead, tmp_buf, sizeof(tmp_buf), MSG_OOB);




More information about the wine-cvs mailing list