httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@hyperreal.org
Subject cvs commit: apache-apr/apr/network_io/os2 networkio.h poll.c
Date Mon, 14 Jun 1999 13:52:41 GMT
bjh         99/06/14 06:52:41

  Modified:    apr/network_io/os2 networkio.h poll.c
  Log:
  Update OS/2's poll with Ryans changes.
  
  Revision  Changes    Path
  1.2       +1 -0      apache-apr/apr/network_io/os2/networkio.h
  
  Index: networkio.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/network_io/os2/networkio.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- networkio.h	1999/06/04 16:15:56	1.1
  +++ networkio.h	1999/06/14 13:52:40	1.2
  @@ -72,6 +72,7 @@
       struct socket_t *sock;
       ap_int16_t events;
       ap_int16_t revents;
  +    int curpos;
   };
   
   ap_int16_t get_event(ap_int16_t);
  
  
  
  1.3       +27 -11    apache-apr/apr/network_io/os2/poll.c
  
  Index: poll.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/network_io/os2/poll.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- poll.c	1999/06/11 07:23:01	1.2
  +++ poll.c	1999/06/14 13:52:40	1.3
  @@ -70,22 +70,31 @@
       }
   
       (*new)->cntxt = cont;
  +    (*new)->curpos = 0;
       return APR_SUCCESS;
   }
   
   
   
  -ap_status_t ap_add_poll_socket(struct pollfd_t *aprset,
  -                               struct socket_t *sock, ap_int16_t event, 
  -                               ap_int32_t pos) 
  -{ 
  -    aprset[pos].sock = sock; 
  -    aprset[pos].events = event;
  -    return APR_SUCCESS; 
  -} 
  +ap_status_t ap_add_poll_socket(struct pollfd_t *aprset, 
  +			       struct socket_t *sock, ap_int16_t event)
  +{
  +    int i = 0;
  +    
  +    while (i < aprset->curpos && aprset[i].sock->socketdes != sock->socketdes)
{
  +        i++;
  +    }
  +    if (i >= aprset->curpos) {
  +        aprset->curpos++;
  +    } 
  +    aprset[i].sock = sock;
  +    aprset[i].events = event;
   
  +    return APR_SUCCESS;
  +}
   
   
  +
   ap_status_t ap_poll(struct pollfd_t *pollfdset, ap_int32_t *nsds, ap_int32_t timeout)
   {
       int i;
  @@ -144,9 +153,16 @@
   
   
   
  -ap_status_t ap_get_revents(struct pollfd_t *aprset, ap_int32_t pos, ap_int16_t *event)
  +ap_status_t ap_get_revents(struct pollfd_t *aprset, struct socket_t *sock, ap_int16_t *event)
   {
  -    (*event) = aprset[pos].revents;
  +    int i = 0;
  +    
  +    while (i < aprset->curpos && aprset[i].sock->socketdes != sock->socketdes)
{
  +        i++;
  +    }
  +    if (i >= aprset->curpos) {
  +        return APR_INVALSOCK;
  +    } 
  +    (*event) = aprset[i].revents;
       return APR_SUCCESS;
   }
  -
  
  
  

Mime
View raw message