Bug 40966

Summary: Socket descriptor checks on windows are incorrect
Product: Tomcat Connectors Reporter: Tim Whittington <Tim.Whittington>
Component: CommonAssignee: Tomcat Developers Mailing List <dev>
Status: CLOSED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: Patch to correct socket descriptor checks and add debug logging for AJP responses

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.