apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@rkbloom.net
Subject Timeout status codes are thoroughly messed up
Date Mon, 15 Mar 2004 03:04:10 GMT

I have spent the last half hour or so trying to make the socket timeout tests
pass on Windows.  I couldn't make it happen, so I finally started reading
through the code.  It turns out that we have a number of error codes that mean
that a timeout has expired.

On any platform that uses wait_for_io_or_timeout, we return APR_TIMEUP to mean
that the timeout popped.

On Windows (and possibly others), we use APR_ETIMEDOUT.

This leaves us needing to check two different macros (APR_STATUS_IS_TIMEUP and
APR_STATUS_IS_ETIMEDOUT) to determine what is going on.

I have currently left the test failing on Windows, rather than add the second
check to the test.  I specifically left it using APR_TIMEUP, because when I
initially wrote the socket timeout code (lo those many years ago), I added that
error code, so I know for a fact that APR_TIMEOUT predates APR_ETIMEDOUT.  Also,
a timeout popping isn't necessarily an error condition (hence the missing 'E' in
APR_TIMEOUT), it just means that something you were expecting to happen hasn't
happened yet.

This needs to get resolved.  I believe the fix is to simply add the correct
checks to APR_STATUS_IS_TIMEUP, but I also would like to know if we really need
to keep APR_STATUS_IS_ETIMEDOUT at all.  Can we mark it deprecated?


View raw message