cvs commit: apache/src httpd.h

1997-02-16 Thread Marc Slemko
marc97/02/16 14:59:05

  Modified:src   httpd.h
  Log:
  Add strerror() prototype for those platforms where we supply our
  own.
  
  Reviewed by: Dean Gaudet, Randy Terbush
  
  Revision  ChangesPath
  1.87  +5 -1  apache/src/httpd.h
  
  Index: httpd.h
  ===
  RCS file: /export/home/cvs/apache/src/httpd.h,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -C3 -r1.86 -r1.87
  *** httpd.h   1997/02/16 22:48:26 1.86
  --- httpd.h   1997/02/16 22:59:04 1.87
  ***
  *** 672,678 
int rind (const char *, char); 

int cfg_getline(char *s, int n, FILE *f);
  !  
/* Misc system hackery */
 
uid_t uname2id(const char *name);
  --- 672,682 
int rind (const char *, char); 

int cfg_getline(char *s, int n, FILE *f);
  ! 
  ! #ifdef NEED_STRERROR
  ! char *strerror (int err);
  ! #endif
  ! 
/* Misc system hackery */
 
uid_t uname2id(const char *name);
  
  
  


cvs commit: apache/src CHANGES mod_include.c

1997-02-16 Thread Roy Fielding
fielding97/02/16 21:22:58

  Modified:src   CHANGES mod_include.c
  Log:
  Added double-buffering to mod_include to improve performance on
  server-side includes.
  
  Submitted by: Marc Slemko
  Reviewed by: Roy Fielding, Brian Behlendorf, Dean Gaudet
  
  Revision  ChangesPath
  1.166 +3 -0  apache/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.165
  retrieving revision 1.166
  diff -C3 -r1.165 -r1.166
  *** CHANGES   1997/02/17 04:52:38 1.165
  --- CHANGES   1997/02/17 05:22:56 1.166
  ***
  *** 33,38 
  --- 33,41 
 auto initializers, multiple is_matchexp calls on a static string,
 and excessive merging of response_code_strings. [Dean Gaudet]

  +   *) Added double-buffering to mod_include to improve performance on
  +  server-side includes. [Marc Slemko]
  + 
  *) Several fixes for suexec wrapper. [Randy Terbush]
 - Make wrapper work for files on NFS filesystem.
 - Fix portability problem of MAXPATHLEN.
  
  
  
  1.22  +67 -14apache/src/mod_include.c
  
  Index: mod_include.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_include.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -C3 -r1.21 -r1.22
  *** mod_include.c 1997/01/20 04:28:13 1.21
  --- mod_include.c 1997/02/17 05:22:57 1.22
  ***
  *** 113,156 
}
}

  ! #define GET_CHAR(f,c,r,p) \
 { \
   int i = getc(f); \
  !if(feof(f) || ferror(f) || (i == -1)) { \
  ! pfclose(p,f); \
  ! return r; \
   } \
   c = (char)i; \
 }

  - /* --- Parser functions --- 
*/
  - 
  - /* G... rputc makes this slow as all-get-out.  Elsewhere, it doesn't
  -  * matter much, but this is an inner loop...
  -  */
  - 
int find_string(FILE *in,char *str, request_rec *r, int printing) {
int x,l=strlen(str),p;
char c;

p=0;
while(1) {
  ! GET_CHAR(in,c,1,r-pool);
if(c == str[p]) {
  ! if((++p) == l)
return 0;
}
else {
if (printing) {
for(x=0;xp;x++) {
  ! rputc(str[x],r);
}
  ! rputc(c,r);
}
p=0;
}
}
}

/*
 * decodes a string containing html entities or numeric character 
references.
  --- 113,209 
}
}

  ! 
  ! 
  ! /* --- Parser functions --- 
*/
  ! 
  ! #define OUTBUFSIZE 4096
  ! /* PUT_CHAR and FLUSH_BUF currently only work within the scope of 
  !  * find_string(); they are hacks to avoid calling rputc for each and
  !  * every character output.  A common set of buffering calls for this 
  !  * type of output SHOULD be implemented.
  !  */
  ! #define PUT_CHAR(c,r) \
  !  { \
  !outbuf[outind++] = c; \
  !if (outind == OUTBUFSIZE) { FLUSH_BUF(r) }; \
  !  } 
  ! 
  ! /* there SHOULD be some error checking on the return value of
  !  * rwrite, however it is unclear what the API for rwrite returning
  !  * errors is and little can really be done to help the error in 
  !  * any case.
  !  */
  ! #define FLUSH_BUF(r) \
  !  { \
  !rwrite(outbuf, outind, r); \
  !outind = 0; \
  !  }
  ! 
  ! /*
  !  * f: file handle being read from
  !  * c: character to read into
  !  * ret: return value to use if input fails
  !  * r: current request_rec
  !  *
  !  * This macro is redefined after find_string() for historical reasons
  !  * to avoid too many code changes.  This is one of the many things
  !  * that should be fixed.
  !  */
  ! #define GET_CHAR(f,c,ret,r) \
 { \
   int i = getc(f); \
  !if(i == EOF) { /* either EOF or error -- needs error handling if latter 
*/ \
  !if (ferror(f)) \
  !fprintf(stderr, encountered error in GET_CHAR macro, 
mod_include.\n); \
  !FLUSH_BUF(r); \
  !pfclose(r-pool,f); \
  !return ret; \
   } \
   c = (char)i; \
 }

int find_string(FILE *in,char *str, request_rec *r, int printing) {
int x,l=strlen(str),p;
  + char outbuf[OUTBUFSIZE];
  + int outind = 0;
char c;

p=0;
while(1) {
  ! GET_CHAR(in,c,1,r);
if(c == str[p]) {
  ! if((++p) == l) {
  ! FLUSH_BUF(r);
return 0;
  + }
}
else {
if (printing) {
for(x=0;xp;x++) {
  ! PUT_CHAR(str[x],r);
}
  ! PUT_CHAR(c,r);
}
p=0;
}
}
}
  + 
  + 

cvs commit: apache/src CHANGES http_protocol.c

1997-02-16 Thread Roy Fielding
fielding97/02/16 22:05:02

  Modified:src   CHANGES http_protocol.c
  Log:
  Retain persistence on a 204 (No Content) response.
  Correct send_http_trace() to use r-the_request instead of constructing
  the request-line from its parsed components.
  
  Submitted by: Dean Gaudet
  Reviewed by: Roy Fielding
  
  Revision  ChangesPath
  1.167 +1 -1  apache/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.166
  retrieving revision 1.167
  diff -C3 -r1.166 -r1.167
  *** CHANGES   1997/02/17 05:22:56 1.166
  --- CHANGES   1997/02/17 06:05:00 1.167
  ***
  *** 84,90 
  *) Fixed bug which caused a segmentation fault if only one argument
 given to RLimit* directives. [Ed Korthof]

  !   *) Continue persistent connection after 304 response. [Dean Gaudet]

  *) Improved buffered output to the client by delaying the flush decision
 until the BUFF code is actually about to read the next request.
  --- 84,90 
  *) Fixed bug which caused a segmentation fault if only one argument
 given to RLimit* directives. [Ed Korthof]

  !   *) Continue persistent connection after 204 or 304 response. [Dean Gaudet]

  *) Improved buffered output to the client by delaying the flush decision
 until the BUFF code is actually about to read the next request.
  
  
  
  1.101 +3 -2  apache/src/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /export/home/cvs/apache/src/http_protocol.c,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -C3 -r1.100 -r1.101
  *** http_protocol.c   1997/02/11 17:02:04 1.100
  --- http_protocol.c   1997/02/17 06:05:01 1.101
  ***
  *** 265,271 
else if (r-server-keep_alive  (!r-server-keep_alive_max ||
(r-server-keep_alive_max  r-connection-keepalives)) 
(r-server-keep_alive_timeout  0) 
  ! (r-status == USE_LOCAL_COPY || r-header_only || length || tenc ||
 ((r-proto_num = 1001)  (r-chunked = 1))) 
(!find_token(r-pool, conn, close)) 
((ka_sent = find_token(r-pool, conn, keep-alive)) ||
  --- 265,272 
else if (r-server-keep_alive  (!r-server-keep_alive_max ||
(r-server-keep_alive_max  r-connection-keepalives)) 
(r-server-keep_alive_timeout  0) 
  ! (r-status == HTTP_NOT_MODIFIED || r-status == HTTP_NO_CONTENT
  !  || r-header_only || length || tenc ||
 ((r-proto_num = 1001)  (r-chunked = 1))) 
(!find_token(r-pool, conn, close)) 
((ka_sent = find_token(r-pool, conn, keep-alive)) ||
  ***
  *** 1021,1027 

/* Now we recreate the request, and echo it back */

  ! rvputs(r, r-method,  , r-uri,  , r-protocol, \015\012, NULL);

for (i = 0; i  hdrs_arr-nelts; ++i) {
  if (!hdrs[i].key) continue;
  --- 1022,1028 

/* Now we recreate the request, and echo it back */

  ! rvputs( r, r-the_request, \015\012, NULL );

for (i = 0; i  hdrs_arr-nelts; ++i) {
  if (!hdrs[i].key) continue;