httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgau...@hyperreal.org
Subject cvs commit: apache-2.0/mpm/src/os/unix iol_socket.c
Date Mon, 28 Jun 1999 19:00:50 GMT
dgaudet     99/06/28 12:00:50

  Modified:    mpm/src/include ap_iol.h
               mpm/src/main iol_file.c
               mpm/src/os/unix iol_socket.c
  Log:
  - eliminate readv -- it's mostly useful with a full zero-copy setup
  - document the simple writev possible when system has no writev
  
  Revision  Changes    Path
  1.4       +8 -4      apache-2.0/mpm/src/include/ap_iol.h
  
  Index: ap_iol.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/mpm/src/include/ap_iol.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ap_iol.h	1999/06/24 08:57:58	1.3
  +++ ap_iol.h	1999/06/28 19:00:48	1.4
  @@ -68,7 +68,7 @@
   } ap_iol_option;
   
   /*
  -    write, writev, read, readv guarantee they won't return EINTR.
  +    write, writev, read guarantee they won't return EINTR.
   
       If no error occurs, they return the number of bytes read/written.
   
  @@ -88,12 +88,18 @@
       Just to drive the point home again -- none of these functions guarantee
       they will read/write the entire length specified.
   
  -    Note:  timeout == 0 is non-blocking operation... which requires a lot
  +    Note: timeout == 0 is non-blocking operation... which requires a lot
       of care if you're implementing filters.  It may mean you have to keep
       state from one call to the next.  The chunking filter will have an
       example of this.  If you're not sure how to handle the state sitatuation
       you will want to return EINVAL when the timeout is set to 0.  This may
       break various things... hopefully we'll be able to recover gracefully.
  +
  +    Note: implementation tip: if your system doesn't have writev(), you
  +    still have to implement a writev() method.  However, since the
  +    iol writev() is allowed to return a partial write, you can essentially
  +    treat all writev()s as write(fd, vec[0].iov_base, vec[0].iov_len),
  +    and the layers above will loop over the entire vector for you.
   */
   
   struct ap_iol_methods {
  @@ -101,7 +107,6 @@
       int (*write)(ap_iol *fd, const char *buf, int len);
       int (*writev)(ap_iol *fd, const struct iovec *vec, int nvec);
       int (*read)(ap_iol *fd, char *buf, int len);
  -    int (*readv)(ap_iol *fd, struct iovec *vec, int nvec);
       int (*setopt)(ap_iol *fd, ap_iol_option opt, const void *value);
       int (*getopt)(ap_iol *fd, ap_iol_option opt, void *value);
       /* TODO: accept, connect, ... */
  @@ -118,7 +123,6 @@
   #define iol_write(iol, a, b) ((iol)->methods->write((iol), (a), (b)))
   #define iol_writev(iol, a, b) ((iol)->methods->writev((iol), (a), (b)))
   #define iol_read(iol, a, b) ((iol)->methods->read((iol), (a), (b)))
  -#define iol_readv(iol, a, b) ((iol)->methods->readv((iol), (a), (b)))
   #define iol_setopt(iol, a, b) ((iol)->methods->setopt((iol), (a), (b)))
   #define iol_getopt(iol, a, b) ((iol)->methods->getopt((iol), (a), (b)))
   
  
  
  
  1.2       +0 -2      apache-2.0/mpm/src/main/iol_file.c
  
  Index: iol_file.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/mpm/src/main/iol_file.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- iol_file.c	1999/06/24 08:58:00	1.1
  +++ iol_file.c	1999/06/28 19:00:49	1.2
  @@ -81,7 +81,6 @@
   method(write, (ap_iol *viol, const char *arg1, int arg2))
   method(writev, (ap_iol *viol, const struct iovec *arg1, int arg2))
   method(read, (ap_iol *viol, char *arg1, int arg2))
  -method(readv, (ap_iol *viol, struct iovec *arg1, int arg2))
   
   static int file_close(ap_iol *viol)
   {
  @@ -113,7 +112,6 @@
       file_write,
       file_writev,
       file_read,
  -    file_readv,
       file_setopt,
       file_getopt
   };
  
  
  
  1.2       +0 -2      apache-2.0/mpm/src/os/unix/iol_socket.c
  
  Index: iol_socket.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/mpm/src/os/unix/iol_socket.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- iol_socket.c	1999/06/24 08:58:04	1.1
  +++ iol_socket.c	1999/06/28 19:00:50	1.2
  @@ -185,7 +185,6 @@
   method(write, (ap_iol *viol, const char *arg1, int arg2), write, NULL, &fdset)
   method(writev, (ap_iol *viol, const struct iovec *arg1, int arg2), writev, NULL, &fdset)
   method(read, (ap_iol *viol, char *arg1, int arg2), read, &fdset, NULL)
  -method(readv, (ap_iol *viol, struct iovec *arg1, int arg2), readv, &fdset, NULL)
   
   static int unix_close(ap_iol *viol)
   {
  @@ -205,7 +204,6 @@
       unix_write,
       unix_writev,
       unix_read,
  -    unix_readv,
       unix_setopt,
       unix_getopt
   };
  
  
  

Mime
View raw message