Author: cgutman
Date: Thu Aug 12 04:22:52 2010
New Revision: 48520

URL: http://svn.reactos.org/svn/reactos?rev=48520&view=rev
Log:
[MSWSOCK]
- Check for STATUS_SUCCESS explicitly instead of using the NT_SUCCESS macro 
because somebody at MS thought it was a great idea to make STATUS_TIMEOUT a 
success status thus causing endless hours of bug hunting for the poor 
developers that make this same mistake
- STATUS_TIMEOUT isn't an error status so checking for it with NT_ERROR won't 
work either instead just add a special case in the if for STATUS_TIMEOUT

Modified:
    branches/aicom-network-branch/dll/win32/mswsock/msafd/async.c

Modified: branches/aicom-network-branch/dll/win32/mswsock/msafd/async.c
URL: 
http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/dll/win32/mswsock/msafd/async.c?rev=48520&r1=48519&r2=48520&view=diff
==============================================================================
--- branches/aicom-network-branch/dll/win32/mswsock/msafd/async.c [iso-8859-1] 
(original)
+++ branches/aicom-network-branch/dll/win32/mswsock/msafd/async.c [iso-8859-1] 
Thu Aug 12 04:22:52 2010
@@ -163,7 +163,7 @@
                                       &IoStatusBlock,
                                       &Timeout);
         /* Check for success */
-        if (NT_SUCCESS(Status))
+        if (Status == STATUS_SUCCESS)
         {
             /* Check if this isn't the termination command */
             if (AsyncCompletionRoutine != (PVOID)-1)
@@ -180,7 +180,7 @@
                 InterlockedDecrement(&SockAsyncThreadReferenceCount);
             }
         }
-        else if ((SockAsyncThreadReferenceCount > 1) && (NT_ERROR(Status)))
+        else if ((SockAsyncThreadReferenceCount > 1) && (NT_ERROR(Status) || 
Status == STATUS_TIMEOUT))
         {
             /* It Failed, sleep for a second */
             Sleep(1000);


Reply via email to