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
+#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);