Skip to content

Commit ffedb05

Browse files
committed
[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 svn path=/branches/aicom-network-branch/; revision=48520
1 parent 48d08ea commit ffedb05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dll/win32/mswsock/msafd/async.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ SockAsyncThread(PVOID Context)
163163
&IoStatusBlock,
164164
&Timeout);
165165
/* Check for success */
166-
if (NT_SUCCESS(Status))
166+
if (Status == STATUS_SUCCESS)
167167
{
168168
/* Check if this isn't the termination command */
169169
if (AsyncCompletionRoutine != (PVOID)-1)
@@ -180,7 +180,7 @@ SockAsyncThread(PVOID Context)
180180
InterlockedDecrement(&SockAsyncThreadReferenceCount);
181181
}
182182
}
183-
else if ((SockAsyncThreadReferenceCount > 1) && (NT_ERROR(Status)))
183+
else if ((SockAsyncThreadReferenceCount > 1) && (NT_ERROR(Status) || Status == STATUS_TIMEOUT))
184184
{
185185
/* It Failed, sleep for a second */
186186
Sleep(1000);

0 commit comments

Comments
 (0)