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