Bug 40966 - Socket descriptor checks on windows are incorrect
Socket descriptor checks on windows are incorrect
Status: CLOSED FIXED
Product: Tomcat Connectors
Classification: Unclassified
Component: Common
unspecified
Other other
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2006-11-13 16:44 UTC by Tim Whittington
Modified: 2008-10-05 03:09 UTC (History)
0 users



Attachments
Patch to correct socket descriptor checks and add debug logging for AJP responses (2.51 KB, patch)
2006-11-13 16:45 UTC, Tim Whittington
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Whittington 2006-11-13 16:44:29 UTC
There are socket descriptor validity checks in ajp_reset_endpoint and ajp_done
(ajp_common.c) that don't use the IS_VALID_SOCKET macro, but rather do a sd > 0
check for validity.

On XP/Visual Studio 2005 (at least), SOCKET is an unsigned, which means sd > 0
always succeeds.
This doesn't break anything at the moment, since the subsequent code executed
correctly checks for invalid sockets before attempting to close them.

Patch is attached to correct this, as well as add a bit more debug logging
around the AJP responses.
Comment 1 Tim Whittington 2006-11-13 16:45:16 UTC
Created attachment 19121 [details]
Patch to correct socket descriptor checks and add debug logging for AJP responses
Comment 2 Mladen Turk 2006-11-14 08:09:45 UTC
Committed. Thanks!
Comment 3 Rainer Jung 2008-01-01 16:51:29 UTC
Move a couple of fixed JK issues from resolved to closed.