You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by rb...@rkbloom.net on 2004/03/15 04:04:10 UTC

Timeout status codes are thoroughly messed up

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?

Ryan

Re: Timeout status codes are thoroughly messed up

Posted by Cliff Woolley <jw...@virginia.edu>.
On Sun, 14 Mar 2004 rbb@rkbloom.net wrote:

> 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?

+1 as far as I'm concerned.

--Cliff