dgaudet 99/06/18 12:20:50
Modified:mpm/src/include buff.h
mpm/src/main buff.c http_protocol.c
Log:
break chunked encoding, ebcdic, ... layering goes here
Revision ChangesPath
1.2 +4 -48 apache-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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- buff.h1999/06/18 18:39:28 1.1
+++ buff.h1999/06/18 19:20:47 1.2
@@ -62,10 +62,6 @@
extern C {
#endif
-#ifdef B_SFIO
-#include sfio.h
-#endif
-
#include stdarg.h
/* Reading is buffered */
@@ -85,16 +81,13 @@
#undef B_ERROR
#endif
#define B_ERROR (48)
-/* Use chunked writing */
-#define B_CHUNK (64)
+/* TODO: implement chunked encoding as a layer */
/* bflush() if a read would block */
#define B_SAFEREAD (128)
/* buffer is a socket */
#define B_SOCKET (256)
-#ifdef CHARSET_EBCDIC
-#define B_ASCII2EBCDIC 0x4000 /* Enable conversion for this buffer */
-#define B_EBCDIC2ASCII 0x8000 /* Enable conversion for this buffer */
-#endif /*CHARSET_EBCDIC*/
+
+/* TODO: implement a ebcdic/ascii conversion layers */
typedef struct buff_struct BUFF;
@@ -103,7 +96,6 @@
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 */
-int outchunk;/* location of chunk header when chunking */
int outcnt; /* number of byte put in output buffer
*/
unsigned char *inbase;
unsigned char *outbase;
@@ -116,29 +108,9 @@
/* could also put pointers to the basic I/O routines here */
int fd; /* the file descriptor */
-#ifdef WIN32
-HANDLE hFH; /* Windows filehandle */
-#endif
time_t timeout; /* timeout for B_SOCKET operations */
-
-/* transport handle, for RPC binding handle or some such */
-void *t_handle;
-
-#ifdef B_SFIO
-Sfio_t *sf_in;
-Sfio_t *sf_out;
-#endif
};
-#ifdef B_SFIO
-typedef struct {
-Sfdisc_t disc;
-BUFF *buff;
-} apache_sfio;
-
-extern Sfdisc_t *bsfio_new(pool *p, BUFF *b);
-#endif
-
/* Options to bset/getopt */
#define BO_BYTECT (1)
#define BO_TIMEOUT (2)
@@ -150,9 +122,6 @@
/* XXX - unused right now - mvsk */
API_EXPORT(BUFF *) ap_bopenf(pool *a, const char *name, int flg, int mode);
-#ifdef WIN32
-API_EXPORT(void) ap_bpushh(BUFF *fb, HANDLE hFH);
-#endif
API_EXPORT(int) ap_bsetopt(BUFF *fb, int optname, const void *optval);
API_EXPORT(int) ap_bgetopt(BUFF *fb, int optname, void *optval);
API_EXPORT(int) ap_bsetflag(BUFF *fb, int flag, int value);
@@ -181,27 +150,14 @@
API_EXPORT(int) ap_bflsbuf(int c, BUFF *fb);
API_EXPORT(int) ap_bfilbuf(BUFF *fb);
-#ifndef CHARSET_EBCDIC
-
#define ap_bgetc(fb) ( ((fb)-incnt == 0) ? ap_bfilbuf(fb) : \
((fb)-incnt--, *((fb)-inptr++)) )
#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))
-
-#else /*CHARSET_EBCDIC*/
-
-#define ap_bgetc(fb) ( ((fb)-incnt == 0) ? ap_bfilbuf(fb) : \
- ((fb)-incnt--, (fb-flags B_ASCII2EBCDIC)\
- ?os_toebcdic[(unsigned
char)*((fb)-inptr++)]:*((fb)-inptr++)) )
-
-#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++] = (fb-flags
B_EBCDIC2ASCII)\
- ?os_toascii[(unsigned char)c]:(c), 0))
-#endif /*CHARSET_EBCDIC*/
+/* XXX: this doesn't belong here... should be part of a generic spawning API
in APR/NSPR */
struct child_info {
#ifdef WIN32
/*
1.2 +11 -417 apache-2.0/mpm/src/main/buff.c
Index: buff.c
===
RCS file: /home/cvs/apache-2.0/mpm/src/main/buff.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- buff.c1999/06/18 18:39:29 1.1
+++ buff.c1999/06/18 19:20:48 1.2
@@ -75,12 +75,6 @@
#ifndef DEFAULT_BUFSIZE
#define DEFAULT_BUFSIZE (4096)
#endif
-/* This must be enough to represent (DEFAULT_BUFSIZE - 3) in hex,
- * plus two extra characters.
- */
-#ifndef CHUNK_HEADER_SIZE
-#define CHUNK_HEADER_SIZE (5)
-#endif
/* bwrite()s of greater than this size can result in a large_write() call,
@@ -219,37 +213,21 @@
else
fb-inbase = NULL;