Increase lost packet count when transmit failed or receive failed for whatever reason

svn path=/trunk/; revision=35392
This commit is contained in:
Hervé Poussineau 2008-08-16 14:30:20 +00:00
parent e96d8d91ad
commit 1b11b8d6ce

View file

@ -541,6 +541,7 @@ static BOOL Ping(VOID)
} }
if (Status == SOCKET_ERROR) if (Status == SOCKET_ERROR)
{ {
LostCount++;
if (WSAGetLastError() == WSAEHOSTUNREACH) if (WSAGetLastError() == WSAEHOSTUNREACH)
printf("Destination host unreachable.\n"); printf("Destination host unreachable.\n");
else else
@ -567,6 +568,8 @@ static BOOL Ping(VOID)
printf("\n"); printf("\n");
#endif /* !NDEBUG */ #endif /* !NDEBUG */
} }
else
LostCount++;
if (Status == SOCKET_ERROR) if (Status == SOCKET_ERROR)
{ {
if (WSAGetLastError() != WSAETIMEDOUT) if (WSAGetLastError() != WSAETIMEDOUT)
@ -581,7 +584,6 @@ static BOOL Ping(VOID)
if (Status == 0) if (Status == 0)
{ {
printf("Request timed out.\n"); printf("Request timed out.\n");
LostCount++;
GlobalFree(Buffer); GlobalFree(Buffer);
return TRUE; return TRUE;
} }