cvs commit: apache-1.3/src/main http_protocol.c http_request.c

1998-10-06 Thread fielding
fielding98/10/06 12:06:11

  Modified:src  CHANGES
   src/include httpd.h
   src/main http_protocol.c http_request.c
  Log:
  Added a complete implementation of the Expect header field as
  specified in rev-05 of HTTP/1.1.  Used that implementation as a means
  of disabling the 100 Continue response when we already know the final
  status, which is mighty useful for PUT responses that result in 302 or 401.
  
  Moved two ugly protocol condition checks that were in http_request.c
  over to where they belong in http_protocol.c.  They were put there
  originally because ap_read_request formerly could not return an
  error response, but I added that capability in 1.3.2.
  
  Added removal of extra trailing whitespace from the getline results as part
  of the protocol processing, which is extra nice because it works
  between continuation lines, is almost no cost in the normal case
  of no extra whitespace, and saves memory.
  
  Revision  ChangesPath
  1.1103+10 -0 apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1102
  retrieving revision 1.1103
  diff -u -r1.1102 -r1.1103
  --- CHANGES   1998/10/05 22:11:14 1.1102
  +++ CHANGES   1998/10/06 19:06:06 1.1103
  @@ -1,5 +1,15 @@
   Changes with Apache 1.3.3
   
  +  *) Added a complete implementation of the Expect header field as
  + specified in rev-05 of HTTP/1.1.  Disabled the 100 Continue
  + response when we already know the final status, which is mighty
  + useful for PUT responses that result in 302 or 401. [Roy Fielding]
  +
  +  *) Remove extra trailing whitespace from the getline results as part
  + of the protocol processing, which is extra nice because it works
  + between continuation lines, is almost no cost in the normal case
  + of no extra whitespace, and saves memory. [Roy Fielding]
  +
 *) Added new HTTP status codes and default response bodies from the
revised HTTP/1.1 (307, 416, 417), WebDAV (102, 207, 422, 423), and 
HTTP Extension Framework (510) specifications.  Did not add the
  
  
  
  1.246 +7 -0  apache-1.3/src/include/httpd.h
  
  Index: httpd.h
  ===
  RCS file: /home/cvs/apache-1.3/src/include/httpd.h,v
  retrieving revision 1.245
  retrieving revision 1.246
  diff -u -r1.245 -r1.246
  --- httpd.h   1998/10/05 22:11:16 1.245
  +++ httpd.h   1998/10/06 19:06:08 1.246
  @@ -752,6 +752,13 @@
* that way, a sub request's list can (temporarily) point to a parent's list
*/
   const struct htaccess_result *htaccess;
  +
  +/* Things placed at the end of the record to avoid breaking binary
  + * compatibility.  It would be nice to remember to reorder the entire
  + * record to improve 64bit alignment the next time we need to break
  + * binary compatibility for some other reason.
  + */
  +unsigned expecting_100; /* is client waiting for a 100 response? */
   };
   
   
  
  
  
  1.243 +93 -13apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.242
  retrieving revision 1.243
  diff -u -r1.242 -r1.243
  --- http_protocol.c   1998/10/05 22:11:16 1.242
  +++ http_protocol.c   1998/10/06 19:06:09 1.243
  @@ -551,6 +551,17 @@
   total += retval;/* and how long s has become   */
   
   if (*pos == '\n') { /* Did we get a full line of input?*/
  +/*
  + * Trim any extra trailing spaces or tabs except for the first
  + * space or tab at the beginning of a blank string.  This makes
  + * it much easier to check field values for exact matches, and
  + * saves memory as well.  Terminate string at end of line.
  + */
  +while (pos  (s + 1)  (*(pos - 1) == ' ' || *(pos - 1) == 
'\t')) {
  +--pos;  /* trim extra trailing spaces or tabs  */
  +--total;/* but not one at the beginning of line*/
  +++n;
  +}
   *pos = '\0';
   --total;
   ++n;
  @@ -767,8 +778,6 @@
   while (*value == ' ' || *value == '\t')
   ++value;/* Skip to start of value   */
   
  -/* XXX: should strip trailing whitespace as well */
  -
ap_table_addn(tmp_headers, copy, value);
   }
   
  @@ -778,8 +787,9 @@
   request_rec *ap_read_request(conn_rec *conn)
   {
   request_rec *r;
  -int access_status;
   pool *p;
  +const char *expect;
  +int access_status;
   
   p = ap_make_sub_pool(conn-pool);
   r = ap_pcalloc(p, sizeof(request_rec));
  @@ -846,6 

cvs commit: apache-1.3/src/main http_protocol.c http_request.c

1998-01-31 Thread dgaudet
dgaudet 98/01/30 16:15:45

  Modified:src/main http_protocol.c http_request.c
  Log:
  (Recall: whenever a table's nelts == nalloc and a push is attempted
  the table size will be doubled, and the old table copied to the new
  table.  It's nice to avoid this if it's easy.)
  
  Our default server outputs 8 headers, with the expires module it will
  do 10 headers.  Increase the default r-headers_out table to size 12
  to accomodate that (plus a cookie and one other thing).
  
  rename_original_environment should use nalloc instead of nelts when
  selecting a table size.
  
  Revision  ChangesPath
  1.183 +1 -1  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.182
  retrieving revision 1.183
  diff -u -r1.182 -r1.183
  --- http_protocol.c   1998/01/28 11:33:21 1.182
  +++ http_protocol.c   1998/01/31 00:15:43 1.183
  @@ -786,7 +786,7 @@
   
   r-headers_in  = make_table(r-pool, 50);
   r-subprocess_env  = make_table(r-pool, 50);
  -r-headers_out = make_table(r-pool, 5);
  +r-headers_out = make_table(r-pool, 12);
   r-err_headers_out = make_table(r-pool, 5);
   r-notes   = make_table(r-pool, 5);
   
  
  
  
  1.104 +2 -2  apache-1.3/src/main/http_request.c
  
  Index: http_request.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_request.c,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- http_request.c1998/01/27 02:41:11 1.103
  +++ http_request.c1998/01/31 00:15:44 1.104
  @@ -1162,7 +1162,7 @@
   {
   array_header *env_arr = table_elts(t);
   table_entry *elts = (table_entry *) env_arr-elts;
  -table *new = make_table(p, env_arr-nelts);
  +table *new = make_table(p, env_arr-nalloc);
   int i;
   
   for (i = 0; i  env_arr-nelts; ++i) {
  @@ -1217,7 +1217,7 @@
   new-main= r-main;
   
   new-headers_in  = r-headers_in;
  -new-headers_out = make_table(r-pool, 5);
  +new-headers_out = make_table(r-pool, 12);
   new-err_headers_out = r-err_headers_out;
   new-subprocess_env  = rename_original_env(r-pool, r-subprocess_env);
   new-notes   = make_table(r-pool, 5);