cvs commit: apache-2.0/mpm/src/main iol_unix.c Makefile.tmpl buff.c http_connection.c http_protocol.c http_request.c

1999-06-19 Thread dgaudet
dgaudet 99/06/18 16:35:01

  Modified:mpm/src  CHANGES
   mpm/src/include buff.h
   mpm/src/main Makefile.tmpl buff.c http_connection.c
http_protocol.c http_request.c
  Added:   mpm/src/docs buff.txt
   mpm/src/include ap_iol.h
   mpm/src/main iol_unix.c
  Log:
  I'm sure this is wrong... but it's my start.  i/o layering.  Lots of stuff
  disabled/still to be implemented.  This served up a few static requests.
  
  Revision  ChangesPath
  1.3   +7 -0  apache-2.0/mpm/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-2.0/mpm/src/CHANGES,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CHANGES   1999/06/18 18:58:45 1.2
  +++ CHANGES   1999/06/18 23:34:56 1.3
  @@ -0,0 +1,7 @@
  +Changes with MPM
  +
  +* I/O layering and BUFF revamp.  See docs/buff.txt. [Dean Gaudet]
  +
  +* Basic restructuring to introduce the MPM concept; includes various
  +  changes to the module API... better described by
  +  docs/initial_blurb.txt.  [Dean Gaudet]
  
  
  
  1.1  apache-2.0/mpm/src/docs/buff.txt
  
  Index: buff.txt
  ===
  - ap_bungetc added
  - ap_blookc changed to return the character, rather than take a char *buff
  - in theory, errno is always useful on return from a BUFF routine
  - ap_bhalfduplex, B_SAFEREAD will be re-implemented using a layer I think
  - chunking gone for now, will return as a layer
  - ebcdic gone for now... it should be a layer
  
  
  
  1.3   +15 -15apache-2.0/mpm/src/include/buff.h
  
  Index: buff.h
  ===
  RCS file: /home/cvs/apache-2.0/mpm/src/include/buff.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- buff.h1999/06/18 19:20:47 1.2
  +++ buff.h1999/06/18 23:34:58 1.3
  @@ -63,6 +63,7 @@
   #endif
   
   #include stdarg.h
  +#include ap_iol.h
   
   /* Reading is buffered */
   #define B_RD (1)
  @@ -83,16 +84,22 @@
   #define B_ERROR (48)
   /* TODO: implement chunked encoding as a layer */
   /* bflush() if a read would block */
  -#define B_SAFEREAD (128)
  +/* TODO: #define B_SAFEREAD (128) */
   /* buffer is a socket */
   #define B_SOCKET (256)
   
  +/* caller expects non-blocking behaviour */
  +#define B_NONBLOCK (512)
  +/* non-blocking bit set on fd */
  +#define B_NONBLOCK_SET (1024)
  +
   /* TODO: implement a ebcdic/ascii conversion layers */
   
   typedef struct buff_struct BUFF;
   
   struct buff_struct {
   int flags;   /* flags */
  +int saved_errno; /* saved errno */
   unsigned char *inptr;/* pointer to next location to read */
   int incnt;   /* number of bytes left to read from 
input buffer;
 * always 0 if had a read error  */
  @@ -106,14 +113,13 @@
   
   ap_pool *pool;
   
  -/* could also put pointers to the basic I/O routines here */
  -int fd;  /* the file descriptor */
  -time_t timeout;  /* timeout for B_SOCKET operations */
  +ap_iol iol;
   };
   
   /* Options to bset/getopt */
   #define BO_BYTECT (1)
   #define BO_TIMEOUT (2)
  +#define BO_ERROR (3)
   
   /* Stream creation and modification */
   API_EXPORT(BUFF *) ap_bcreate(pool *p, int flags);
  @@ -136,8 +142,7 @@
   /* I/O */
   API_EXPORT(int) ap_bread(BUFF *fb, void *buf, int nbyte);
   API_EXPORT(int) ap_bgets(char *s, int n, BUFF *fb);
  -API_EXPORT(int) ap_blookc(char *buff, BUFF *fb);
  -API_EXPORT(int) ap_bskiplf(BUFF *fb);
  +API_EXPORT(int) ap_blookc(BUFF *fb);
   API_EXPORT(int) ap_bwrite(BUFF *fb, const void *buf, int nbyte);
   API_EXPORT(int) ap_bflush(BUFF *fb);
   API_EXPORT(int) ap_bputs(const char *x, BUFF *fb);
  @@ -153,6 +158,10 @@
   #define ap_bgetc(fb)   ( ((fb)-incnt == 0) ? ap_bfilbuf(fb) : \
((fb)-incnt--, *((fb)-inptr++)) )
   
  +/* can only unput a single character that was read by ap_bgetc */
  +#define ap_bungetc(c, fb)  ((fb)-incnt++, *(--(fb)-inptr) = (c))
  + 
  +
   #define ap_bputc(c, fb) fb)-flags  (B_EOUT|B_WRERR|B_WR)) != B_WR || \
 (fb)-outcnt == (fb)-bufsiz) ? ap_bflsbuf(c, (fb)) : \
 ((fb)-outbase[(fb)-outcnt++] = (c), 0))
  @@ -181,15 +190,6 @@
   API_EXPORT(int) ap_bspawn_child(pool *, int (*)(void *, child_info *), void 
*,
enum kill_conditions, BUFF **pipe_in, 
BUFF **pipe_out,
BUFF **pipe_err);
  -
  -/* enable non-blocking operations */
  -API_EXPORT(int) ap_bnonblock(int fd);
  -API_EXPORT(int) ap_bblock(int fd);
  -/* and get an fd to select() on */
  -API_EXPORT(int) ap_bfileno(BUFF *fb, int direction);
  -
  

Re: cvs commit: apache-2.0/mpm/src/main iol_unix.c Makefile.tmpl buff.c http_connection.c http_protocol.c http_request.c

1999-06-19 Thread Ben Laurie
[EMAIL PROTECTED] wrote:
 
 dgaudet 99/06/18 16:35:01
 
   Modified:mpm/src  CHANGES
mpm/src/include buff.h
mpm/src/main Makefile.tmpl buff.c http_connection.c
 http_protocol.c http_request.c
   Added:   mpm/src/docs buff.txt
mpm/src/include ap_iol.h
mpm/src/main iol_unix.c
   Log:
   I'm sure this is wrong... but it's my start.  i/o layering. 

Hoorah! Doupleplusone.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there.
 - Indira Gandhi


cvs commit: apache-2.0/mpm/src/main iol_unix.c

1999-06-19 Thread dgaudet
dgaudet 99/06/19 10:59:58

  Modified:mpm/src/main iol_unix.c
  Log:
  cleanup
  
  Revision  ChangesPath
  1.2   +0 -2  apache-2.0/mpm/src/main/iol_unix.c
  
  Index: iol_unix.c
  ===
  RCS file: /home/cvs/apache-2.0/mpm/src/main/iol_unix.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- iol_unix.c1999/06/18 23:35:00 1.1
  +++ iol_unix.c1999/06/19 17:59:57 1.2
  @@ -57,8 +57,6 @@
   
   
   #include httpd.h
  -#include http_main.h
  -#include http_log.h
   #include ap_iol.h
   
   #include errno.h
  
  
  


cvs commit: apache-2.0/mpm/src/main iol_unix.c

1999-06-19 Thread dgaudet
dgaudet 99/06/19 13:40:18

  Modified:mpm/src/include ap_iol.h
   mpm/src/main iol_unix.c
  Log:
  use ETIMEDOUT instead of ETIME
  
  Revision  ChangesPath
  1.2   +1 -1  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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ap_iol.h  1999/06/18 23:34:57 1.1
  +++ ap_iol.h  1999/06/19 20:40:16 1.2
  @@ -80,7 +80,7 @@
   
   If the timeout is positive, they will block up to the specified number
   of seconds.  If the read/write can't be completed in that time,
  -a -1 will be returned and errno will be set to ETIME.
  +a -1 will be returned and errno will be set to ETIMEDOUT.
   
   TODO: we've all agreed errno is somewhat evil, and it must be replaced
   by a status result code.  I'll leave that to someone else.
  
  
  
  1.4   +1 -5  apache-2.0/mpm/src/main/iol_unix.c
  
  Index: iol_unix.c
  ===
  RCS file: /home/cvs/apache-2.0/mpm/src/main/iol_unix.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- iol_unix.c1999/06/19 20:23:37 1.3
  +++ iol_unix.c1999/06/19 20:40:17 1.4
  @@ -63,10 +63,6 @@
   #include sys/types.h
   #include sys/uio.h
   
  -#ifndef ETIME
  -# define ETIME -1
  -#endif
  -
   #define FD_NONBLOCKING_SET   (1)
   
   typedef struct {
  @@ -146,7 +142,7 @@
rv = select(fd-fd + 1, selread, selwrite, NULL, fd-timeout  0 ? 
NULL : tv); \
} while (rv == -1  errno == EINTR); \
if (!FD_ISSET(fd-fd, fdset)) { \
  - errno = ETIME; \
  + errno = ETIMEDOUT; \
return -1; \
} \
do { \