httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/os/unix iol_socket.c
Date Mon, 29 May 2000 04:22:17 GMT
rbb         00/05/28 21:22:16

  Modified:    src/include ap_iol.h
               src/main buff.c iol_file.c
               src/os/unix iol_socket.c
  Log:
  Fix saferead to not use check_read.  In fact, we get rid of check_read
  completely and just read with a 0 timeout.
  
  Revision  Changes    Path
  1.19      +0 -2      apache-2.0/src/include/ap_iol.h
  
  Index: ap_iol.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/ap_iol.h,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ap_iol.h	2000/05/24 19:19:04	1.18
  +++ ap_iol.h	2000/05/29 04:22:02	1.19
  @@ -118,7 +118,6 @@
                                ap_off_t * offset, ap_size_t * len, 
                                ap_int32_t flags);
       ap_status_t (*shutdown)(ap_iol *fd, int how);
  -    ap_status_t (*check_read)(ap_iol *fd);
       /* TODO: accept, connect, ... */
   };
   
  @@ -137,7 +136,6 @@
   #define iol_getopt(iol, a, b) ((iol)->methods->getopt((iol), (a), (b)))
   #define iol_sendfile(iol, a, b, c, d, e) ((iol)->methods->sendfile((iol), (a), (b),
(c), (d), (e)))
   #define iol_shutdown(iol, a) ((iol)->methods->shutdown((iol), (a)))
  -#define iol_check_read(iol) ((iol)->methods->check_read((iol)))
   
   /* the file iol */
   ap_iol *ap_create_file_iol(ap_file_t *file);
  
  
  
  1.43      +17 -7     apache-2.0/src/main/buff.c
  
  Index: buff.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/buff.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- buff.c	2000/05/24 19:19:19	1.42
  +++ buff.c	2000/05/29 04:22:04	1.43
  @@ -396,9 +396,13 @@
       return value;
   }
   
  -static void ap_bhalfduplex(BUFF *fb)
  +static ap_inline ap_status_t ap_bhalfduplex(BUFF *fb, void *buf, 
  +                                            ap_size_t nbyte,
  +                                            ap_ssize_t *bytes_read)
   {
       int rv;
  +    const int zero = 0;
  +    int timeout = 0;
       /* There is nothing to do if the there is something readable in the 
        * incoming buffer or there is nothing flushable in the output buffer.
        */
  @@ -406,27 +410,33 @@
           return;
       }
       /* test for a block */
  +    iol_getopt(fb->iol, AP_IOL_TIMEOUT, &timeout);
  +    iol_setopt(fb->iol, AP_IOL_TIMEOUT, &zero);
       do {
  -        rv = iol_check_read(fb->iol);
  +        rv = iol_read(fb->iol, buf, nbyte, bytes_read);
       } while (rv == APR_EINTR && !(fb->flags & B_EOUT));
  +    iol_setopt(fb->iol, AP_IOL_TIMEOUT, &timeout);
   
       /* treat any error as if it would block as well */ 
       if (rv != APR_SUCCESS) {
           ap_bflush(fb);
       } 
  +    return APR_SUCCESS;
   }
   
   static ap_inline ap_status_t saferead(BUFF *fb, void *buf, ap_size_t nbyte,
                                         ap_ssize_t *bytes_read)
   {
  -    ap_status_t rv;
  +    ap_status_t rv = APR_EINIT;
    
       if (fb->flags & B_SAFEREAD) {
  -        ap_bhalfduplex(fb);
  +        rv = ap_bhalfduplex(fb, buf, nbyte, bytes_read);
       }
  -    do {
  -        rv = iol_read(fb->iol, buf, nbyte, bytes_read);
  -    } while (rv == EINTR && !(fb->flags &B_EOUT));
  +    if (rv != APR_SUCCESS) {
  +        do {
  +            rv = iol_read(fb->iol, buf, nbyte, bytes_read);
  +        } while (rv == EINTR && !(fb->flags &B_EOUT));
  +    }
       return rv;
   }
   
  
  
  
  1.19      +0 -11     apache-2.0/src/main/iol_file.c
  
  Index: iol_file.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/iol_file.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- iol_file.c	2000/05/27 07:06:27	1.18
  +++ iol_file.c	2000/05/29 04:22:05	1.19
  @@ -123,12 +123,6 @@
       return APR_EINVAL;
   }
   
  -static ap_status_t file_check_read(ap_iol *viol)
  -{
  -    iol_file *iol = (iol_file *)viol;
  -    return ap_file_check_read(iol->file);
  -}
  -
   static const ap_iol_methods file_methods = {
       file_close,
       file_ap_write,
  @@ -138,11 +132,6 @@
       file_getopt,
       NULL,
       NULL,
  -#ifdef WIN32
  -    NULL
  -#else
  -    file_check_read
  -#endif
   };
   
   /*
  
  
  
  1.23      +0 -1      apache-2.0/src/os/unix/iol_socket.c
  
  Index: iol_socket.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/os/unix/iol_socket.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- iol_socket.c	2000/05/24 19:19:23	1.22
  +++ iol_socket.c	2000/05/29 04:22:14	1.23
  @@ -151,7 +151,6 @@
       unix_getopt,
       NULL,
       unix_shutdown,
  -    NULL,
   };
   
   ap_iol *unix_attach_socket(ap_socket_t *sock)
  
  
  

Mime
View raw message