Author: cgutman
Date: Thu Aug 12 21:26:28 2010
New Revision: 48524
URL:
http://svn.reactos.org/svn/reactos?rev=48524&view=rev
Log:
[MSWSOCK]
- Fix IsSockaddrEqualToZero
- Comment out the broken async connect code (as it is in our current msafd)
- Fix a deadlock bug and socket descriptor leak when disconnecting a datagram socket
- Fix bug in the SO_BROADCAST check
Modified:
branches/aicom-network-branch/dll/win32/mswsock/msafd/connect.c
Modified: branches/aicom-network-branch/dll/win32/mswsock/msafd/connect.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/dll/win32/…
==============================================================================
--- branches/aicom-network-branch/dll/win32/mswsock/msafd/connect.c [iso-8859-1]
(original)
+++ branches/aicom-network-branch/dll/win32/mswsock/msafd/connect.c [iso-8859-1] Thu Aug
12 21:26:28 2010
@@ -22,7 +22,7 @@
for (i = 0; i < SocketAddressLength; i++)
{
/* Make sure it's 0 */
- if (*(PULONG)SocketAddress + i)return FALSE;
+ if (*(PULONG)(SocketAddress + i)) return FALSE;
}
/* All zeroes, succees! */
@@ -171,6 +171,7 @@
/* Set the SAN State */
ConnectInfo->UseSAN = SockSanEnabled;
+#if 0
/* Check if this is a non-blocking streaming socket */
if ((Socket->SharedData.NonBlocking) && !(MSAFD_IS_DGRAM_SOCK(Socket)))
{
@@ -185,6 +186,7 @@
Status = 0;
}
else
+#endif
{
/* Start the connect loop */
do
@@ -386,8 +388,11 @@
(MSAFD_IS_DGRAM_SOCK(Socket)) &&
(IsSockaddrEqualToZero(SocketAddress, SocketAddressLength)))
{
- /* Disconnect the socket and return */
- return UnconnectDatagramSocket(Socket);
+ /* Disconnect the socket */
+ ErrorCode = UnconnectDatagramSocket(Socket);
+
+ /* Cleanup and return */
+ goto error;
}
/* Make sure the Address Family is valid */
@@ -412,6 +417,7 @@
{
/* Fail: SO_BROADCAST must be set first in WinSock 2.0+ */
ErrorCode = WSAEACCES;
+ goto error;
}
}