apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Nairn" <steven.na...@googlemail.com>
Subject Re: Am I hitting the list?
Date Fri, 31 Aug 2007 10:08:50 GMT
Mladen Turk wrote:
> OK. The mail doesn't hit the httpd dev list as well.
> Looks like I really found something that no one wishes to hear :)
>
> However here is the link to the body that ASF is rejecting:
>
> http://jbecome.net/dload/aprtest.txt

The "testfile" failure on win32 is in test_gets_buffered() because
read_with_timeout() (in file_io/win32/readwrite.c) does not correctly
report end of file when the file is opened with the APR_FOPEN_XTHREAD
flag.

On Windows the APR_FOPEN_XTHREAD flag means that the file is opened
with FILE_FLAG_OVERLAPPED and is read by ReadFile() with an OVERLAPPED
structure. In this case when end of file is reached ReadFile() returns
false and GetLastError() returns ERROR_HANDLE_EOF (error 38, which APR
reports as 720038). See MSDN docs on ReadFile:
http://msdn2.microsoft.com/EN-US/library/aa365467.aspx

Without the "overlapped" stuff when the end of file is reached
ReadFile() returns true but sets the number of bytes read to zero.

The fix is to check for ERROR_HANDLE_EOF in read_with_timeout()
(attached patch).

The test_gets_buffered() test in testfile.c is new in 1.2.9 so the
problem probably existed in 1.2.8 but wasn't tested.

Cheers,
Steve.

Mime
View raw message