apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: Incorrect if check in sockopt.c?
Date Wed, 22 May 2002 11:10:34 GMT
Justin Erenkrantz <jerenkrantz@apache.org> writes:

> 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...
> }

I would think that it should be

  if (on <= 0) { /* if we don't have a timeout on the socket */
    ...disable incomplete reads
  }

Also, we don't turn on the incomplete read flag until we get certain
feedback on I/O.  It isn't enabled just because a certain option has
been set.

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Mime
View raw message