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

1999-07-01 Thread dgaudet
dgaudet 99/06/30 21:07:22

  Modified:mpm/src/main buff.c
  Log:
  uh that was an easy one to fix... I should know better than to post saying
  I'll look at it later ;)
  
  Revision  ChangesPath
  1.7   +1 -1  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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- buff.c1999/06/24 08:58:00 1.6
  +++ buff.c1999/07/01 04:07:19 1.7
  @@ -554,7 +554,7 @@
   i = 0;
   total = 0;
   while (i  nvec) {
  - rv = writev_with_errors(fb, vec, 2);
  + rv = writev_with_errors(fb, vec + i, nvec - i);
if (rv  0) {
return total ? -1 : total;
}
  
  
  


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

1999-06-20 Thread ben
ben 99/06/20 05:25:55

  Modified:mpm/src/main buff.c http_request.c
  Log:
  Handle partial large writes.
  
  Revision  ChangesPath
  1.4   +5 -1  apache-2.0/mpm/src/main/buff.c
  
  Index: buff.c
  ===
  RCS file: /export/home/cvs/apache-2.0/mpm/src/main/buff.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- buff.c1999/06/18 23:34:59 1.3
  +++ buff.c1999/06/20 12:25:54 1.4
  @@ -551,7 +551,11 @@
*/
   if (fb-outcnt  0  nbyte  LARGE_WRITE_THRESHOLD
 nbyte + fb-outcnt = fb-bufsiz) {
  - return large_write(fb, buf, nbyte);
  + int n=large_write(fb, buf, nbyte);
  + if (n == nbyte)
  + return nbyte;
  + buf+=n;
  + nbyte-=n;
   }
   
   /*
  
  
  
  1.3   +7 -1  apache-2.0/mpm/src/main/http_request.c
  
  Index: http_request.c
  ===
  RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- http_request.c1999/06/18 23:35:00 1.2
  +++ http_request.c1999/06/20 12:25:54 1.3
  @@ -1241,7 +1241,13 @@
* it's the application that's stalled.
*/
   /* TODO: re-implement ap_bhalfduplex... not sure how yet */
  -//ap_bhalfduplex(r-connection-client);
  +#if 0
  +ap_bhalfduplex(r-connection-client);
  +#else
  +//in the meantime, flush!
  +ap_bflush(r-connection-client);
  +#endif
  +
   ap_log_transaction(r);
   }
   
  
  
  


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

1999-06-18 Thread dgaudet
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;