[EMAIL PROTECTED] writes:

> rbb         2002/07/10 22:19:45
> 
>   Modified:    .        CHANGES configure.in
>                file_io/unix readwrite.c
>                include  apr_network_io.h
>                include/arch/unix networkio.h
>                network_io/unix Makefile.in sendrecv.c
>                test     sendfile.c server.c testfile.c testpoll.c
>   Added:       include  apr_poll.h apr_support.h
>                poll/unix Makefile.in poll.c
>                support/unix Makefile.in waitio.c
>   Removed:     network_io/unix poll.c
>   Log:
>   Reimplement apr_poll() on Unix.  This improves performance by giving the
>   user back control over the memory in the pollset.

>   Index: poll.c
>   ===================================================================
...
>   #else    /* Use select to mimic poll */
>   
>   apr_status_t apr_poll(apr_pollfd_t *aprset, int num, apr_int32_t *nsds, 
>                   apr_interval_time_t timeout)
>   {
...
>           if (aprset[i].events & APR_POLLIN) {
>               FD_SET(fd, &readset);
>           }
>           if (aprset[i].events & APR_POLLOUT) {
>               FD_SET(fd, &writeset);
>           }
>           if (aprset[i].events & 
>               (APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) {
>               FD_SET(fd, &exceptset);

This doesn't look right.  The only exception condition (ignoring ttys)
is when there is oob data on the socket.

POLLPRI is okay like this, since oob is considered priority band.

It looks to me that POLLERR should map to readability.

I suspect that POLLHUP should map to readability, but some
experimentation may be necessary.

POLLNVAL is for validating a descriptor and is output only.  I don't
see why we even define APR_POLLNVAL.

>           }
...

>           aprset[i].revents = 0;
>           if (FD_ISSET(fd, &readset)) {
>               aprset[i].revents |= APR_POLLIN;

readability from select() means too many different things :)

>           }
>           if (FD_ISSET(fd, &writeset)) {
>               aprset[i].revents |= APR_POLLOUT;
>           }
>           if (FD_ISSET(fd, &exceptset)) {
>               aprset[i].events |= APR_POLLERR;

no, this is POLLPRI


-- 
Jeff Trawick | [EMAIL PROTECTED]
Born in Roswell... married an alien...

Reply via email to