[PATCH] fix Bug 875

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PATCH: shutdown.diff

Modified files:
dlls/winsock:   socket.c

This fixes BUG 875, and possibly 949, too.

Log message:

WS2_register_async_shutdown(): Try immediate completion, in case an App
        never waits for anything.
WS_accept(): Avoid crash if addr parameter is NULL.


Index: dlls/winsock/socket.c
===================================================================
RCS file: /home/wine/wine/dlls/winsock/socket.c,v
retrieving revision 1.102
diff -u -r1.102 socket.c
--- dlls/winsock/socket.c	29 Aug 2002 01:48:55 -0000	1.102
+++ dlls/winsock/socket.c	5 Sep 2002 15:38:47 -0000
@@ -1371,7 +1376,12 @@
         ws2_async_cleanup ( &wsa->async );
         goto out;
     }
-    return 0;
+    /* Try immediate completion */
+    if ( WSAGetOverlappedResult ( (HANDLE) s, ovl, NULL, FALSE, NULL ) )
+        return 0;
+    if ( (err = WSAGetLastError ()) == WSA_IO_INCOMPLETE )
+        return 0;
+    return WSAEINVAL;
 
 out_close:
     WSACloseEvent ( ovl->hEvent );
@@ -1414,7 +1424,8 @@
         SERVER_END_REQ;
 	if (as)
 	{
-	    WS_getpeername(as, addr, addrlen32);
+	    if (addr) 
+                WS_getpeername(as, addr, addrlen32);
 	    return as;
 	}
     }
-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1	    mailto:Martin.Wilck@Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy







[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux