[PATCH 1/5] server: Clear the connection error after a successful connection.

Zebediah Figura zfigura at codeweavers.com
Tue Jul 6 23:48:41 CDT 2021


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/ws2_32/tests/sock.c | 2 +-
 server/sock.c            | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 9e7cd3a1d39..75e83927007 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -3344,7 +3344,7 @@ static void test_select(void)
         id = 0xdeadbeef;
         ret = getsockopt(fdWrite, SOL_SOCKET, SO_ERROR, (char *)&id, &len);
         ok(!ret, "getsockopt failed with %d\n", WSAGetLastError());
-        todo_wine ok(!id, "got error %u\n", id);
+        ok(!id, "got error %u\n", id);
 
         closesocket(fdWrite);
 
diff --git a/server/sock.c b/server/sock.c
index 58e9cf4302a..5fdbf0bd9ba 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -983,7 +983,10 @@ static void sock_dispatch_events( struct sock *sock, enum connection_state prevs
 
     case SOCK_CONNECTING:
         if (event & POLLOUT)
+        {
             post_socket_event( sock, AFD_POLL_BIT_CONNECT, 0 );
+            sock->errors[AFD_POLL_BIT_CONNECT_ERR] = 0;
+        }
         if (event & (POLLERR | POLLHUP))
             post_socket_event( sock, AFD_POLL_BIT_CONNECT_ERR, error );
         break;
-- 
2.30.2




More information about the wine-devel mailing list