Kai Blin : ws2_32: Fix the SO_REUSEADDR tests to work on Win2k3 and newer.
Alexandre Julliard
julliard at winehq.org
Wed Sep 10 06:01:46 CDT 2008
Module: wine
Branch: master
Commit: 6f8d1aa8c27d4cd644c5bd256ea30c022c27f93b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6f8d1aa8c27d4cd644c5bd256ea30c022c27f93b
Author: Kai Blin <kai.blin at gmail.com>
Date: Wed Sep 10 10:57:47 2008 +0200
ws2_32: Fix the SO_REUSEADDR tests to work on Win2k3 and newer.
It seems that with Win2k3, the meaning of SO_REUSEADDR got closer to
BSD semantics. This is nice, as it allows us to finally work like some
version of Windows here.
---
dlls/ws2_32/tests/sock.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 680c75a..0643d00 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -1013,13 +1013,14 @@ static void test_so_reuseaddr(void)
rc = setsockopt(s2, SOL_SOCKET, SO_REUSEADDR, (char*)&reuse, sizeof(reuse));
ok(rc==0, "setsockopt() failed error: %d\n", WSAGetLastError());
- todo_wine {
+ /* On Win2k3 and above, all SO_REUSEADDR seems to do is to allow binding to
+ * a port immediately after closing another socket on that port, so
+ * basically following the BSD socket semantics here. */
+ closesocket(s1);
rc = bind(s2, (struct sockaddr*)&saddr, sizeof(saddr));
ok(rc==0, "bind() failed error: %d\n", WSAGetLastError());
- }
closesocket(s2);
- closesocket(s1);
}
/************* Array containing the tests to run **********/
More information about the wine-cvs
mailing list