You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2003/10/21 21:55:13 UTC

DO NOT REPLY [Bug 23982] New: - Apache 2.xx is incompatible with Winsock 2.0

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23982>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23982

Apache 2.xx is incompatible with Winsock 2.0

           Summary: Apache 2.xx is incompatible with Winsock 2.0
           Product: Apache httpd-2.0
           Version: 2.0.47
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: jbilek@email.cz


There is a bug (or incompatibility) in function apr_socket_sendfile defined in 
sendrecv.c which is part of APR project.
After you call function TransmitFile than you try to wait for the completion 
using WaitForSingleObject, where the socket handle is used as a wait_object. 
This is wrong. There can be installed Winsock LSP (Layered Service Provider) on 
the system, which intercepts communication between application (Apache) and 
winsock driver. Socket handles returned from the LSP are not compatible 
with "normal" system handles. To be fully compatible with Winsock 2.0 you have 
to create new wait_handle and use it with WaitForSingleObject. You have already 
did this job - define WAIT_FOR_EVENT somewhere in the sendrecv.c.
But there is another incompatibility in the apr_socket_sendfile. When the 
WaitForSingleObject released then you try to read operation status using 
function GetOverlappedResult. But Winsock 2.0 compatible application must use 
WinSock 2.0 library function WSAGetOverlappedResult. Note that first argument 
must be the socket not the wait_handle (as it is in current source code 
version).
This problem was discovered when i tested program called NetLimiter 
(www.netlimiter.com), which uses Winsock 2.0 LSP. TransmitFile is available 
only on Win2k and newer Windows system so this problem apears only on these 
systems.
The result of this incompatibility causes that Apache does not work properly - 
www pages showed are without pictures etc.. After i recompiled the APR project 
with the changes i've mentioned, the problems disapeared.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org