apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@apache.org>
Subject Incorrect if check in sockopt.c?
Date Fri, 17 May 2002 18:19:11 GMT
Please see apr/network_io/unix/sockopt.c line 214.

The comment above that check says:

/* must disable the incomplete read support if we change to a
 * blocking socket.
 */
if (on == 0) {
   ...disable incomplete reads...
}

But, if on == 0, we're a non-blocking socket (timeout value of 0
implies we're non-blocking).  So, I think we have a mismatch. 

Shouldn't that be:

if (on < 0) {
   ...disable incomplete reads...
}
else {
   ...enable incomplete reads...
}

Or, am I missing something?  And, indeed, we could move this to
the if checks a few lines above whenever the state changes, but this
is an O(1) op, so it isn't a big deal.  -- justin

Mime
View raw message