=?UTF-8?Q?Ri=C4=8Dardas=20Barkauskas=20?=: ws2_32: Don' t post completion packet if sending fails with error immediately.

Alexandre Julliard julliard at winehq.org
Wed Dec 28 13:44:35 CST 2011


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

Author: Ričardas Barkauskas <rbarkauskas at codeweavers.com>
Date:   Wed Dec 28 01:25:20 2011 +0200

ws2_32: Don't post completion packet if sending fails with error immediately.

---

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

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 0e9524e..d3a4590 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -3885,9 +3885,7 @@ static int WS2_sendto( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
     }
     if (n == -1 && errno != EAGAIN)
     {
-        int loc_errno = errno;
         err = wsaErrno();
-        if (cvalue) WS_AddCompletion( s, cvalue, sock_get_ntstatus(loc_errno), 0 );
         goto error;
     }
 
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 7016dfb..5677a2c 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -5321,10 +5321,10 @@ static void test_completion_port(void)
 
     bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 );
     ok(bret == FALSE, "GetQueuedCompletionStatus returned %u\n", bret );
-    todo_wine ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError());
-    todo_wine ok(key == 0xdeadbeef, "Key is %lu\n", key);
-    todo_wine ok(num_bytes == 0xdeadbeef, "Number of bytes transfered is %u\n", num_bytes);
-    todo_wine ok(!olp, "Overlaped structure is at %p\n", olp);
+    ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError());
+    ok(key == 0xdeadbeef, "Key is %lu\n", key);
+    ok(num_bytes == 0xdeadbeef, "Number of bytes transfered is %u\n", num_bytes);
+    ok(!olp, "Overlaped structure is at %p\n", olp);
 
     if (dest != INVALID_SOCKET)
         closesocket(dest);




More information about the wine-cvs mailing list