fielding 99/08/27 15:18:59
Modified: src/include util_date.h
src/main http_protocol.c util_date.c util_script.c
src/modules/proxy proxy_cache.c
Log:
Reverse the unnecessary change to the interface of ap_parseHTTPdate()
that was discovered while rebuilding the repository.
Revision Changes Path
1.3 +1 -1 apache-2.0/src/include/util_date.h
Index: util_date.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/util_date.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- util_date.h 1999/08/26 14:53:20 1.2
+++ util_date.h 1999/08/27 22:18:45 1.3
@@ -76,7 +76,7 @@
API_EXPORT(int) ap_checkmask(const char *data, const char *mask);
API_EXPORT(time_t) ap_tm2sec(const struct tm *t);
-API_EXPORT(time_t) ap_parseHTTPdate(const char *date, time_t * retval);
+API_EXPORT(time_t) ap_parseHTTPdate(const char *date);
#ifdef __cplusplus
}
1.11 +7 -12 apache-2.0/src/main/http_protocol.c
Index: http_protocol.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- http_protocol.c 1999/08/27 22:03:06 1.10
+++ http_protocol.c 1999/08/27 22:18:48 1.11
@@ -428,12 +428,10 @@
*/
if_unmodified = ap_table_get(r->headers_in, "If-Unmodified-Since");
if (if_unmodified != NULL) {
- /* ZZZ we are changing time funcs to AP time thread funcs.
- and we need to check return values of ap_parseHTTPdate. */
- time_t ius ;
- if (ap_parseHTTPdate(if_unmodified, &ius) == 1
- && (mtime > ius)) {
- return HTTP_PRECONDITION_FAILED;
+ time_t ius = ap_parseHTTPdate(if_unmodified);
+
+ if ((ius != BAD_DATE) && (mtime > ius)) {
+ return HTTP_PRECONDITION_FAILED;
}
}
}
@@ -483,12 +481,9 @@
else if ((r->method_number == M_GET)
&& ((if_modified_since =
ap_table_get(r->headers_in, "If-Modified-Since")) !=
NULL)) {
- time_t ims;
- if (ap_parseHTTPdate(if_modified_since, &ims) != 1) {
- ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
- r->server, "bogus if-modified-since-header");
- }
- else if ((ims >= mtime) && (ims <= r->request_time)) {
+ time_t ims = ap_parseHTTPdate(if_modified_since);
+
+ if ((ims >= mtime) && (ims <= r->request_time)) {
return HTTP_NOT_MODIFIED;
}
}
1.3 +3 -5 apache-2.0/src/main/util_date.c
Index: util_date.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/util_date.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- util_date.c 1999/08/26 14:53:23 1.2
+++ util_date.c 1999/08/27 22:18:49 1.3
@@ -214,7 +214,7 @@
* but many changes since then.
*
*/
-API_EXPORT(time_t) ap_parseHTTPdate(const char *date, time_t * retval)
+API_EXPORT(time_t) ap_parseHTTPdate(const char *date)
{
struct tm ds;
int mint, mon;
@@ -228,7 +228,7 @@
('S' << 16) | ('e' << 8) | 'p', ('O' << 16) | ('c' << 8) | 't',
('N' << 16) | ('o' << 8) | 'v', ('D' << 16) | ('e' << 8) | 'c'};
- if (!date) /* ZZZ return AP_FAILURE on all errors. */
+ if (!date)
return BAD_DATE;
while (*date && ap_isspace(*date)) /* Find first non-whitespace
char */
@@ -317,7 +317,5 @@
ds.tm_mon = mon;
- /* ZZZ return AP_SUCCESS. use AP Implode time func for this. */
- *retval = ap_tm2sec(&ds);
- return 1;
+ return ap_tm2sec(&ds);
}
1.6 +4 -5 apache-2.0/src/main/util_script.c
Index: util_script.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/util_script.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- util_script.c 1999/08/26 14:53:24 1.5
+++ util_script.c 1999/08/27 22:18:49 1.6
@@ -588,11 +588,10 @@
* pass it on blindly because of restrictions on future values.
*/
else if (!strcasecmp(w, "Last-Modified")) {
- time_t mtime;
- if (ap_parseHTTPdate(l, &mtime) == 1) {
- ap_update_mtime(r, mtime);
- ap_set_last_modified(r);
- }
+ time_t mtime = ap_parseHTTPdate(l);
+
+ ap_update_mtime(r, mtime);
+ ap_set_last_modified(r);
}
else if (!strcasecmp(w, "Set-Cookie")) {
ap_table_add(cookie_table, w, l);
1.3 +5 -5 apache-2.0/src/modules/proxy/proxy_cache.c
Index: proxy_cache.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_cache.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- proxy_cache.c 1999/08/26 14:15:07 1.2
+++ proxy_cache.c 1999/08/27 22:18:54 1.3
@@ -668,7 +668,7 @@
if (imstr != NULL) {
/* this may modify the value in the original table */
imstr = ap_proxy_date_canon(r->pool, imstr);
- c->ims = ap_parseHTTPdate(imstr, &(c->ims));
+ c->ims = ap_parseHTTPdate(imstr);
if (c->ims == BAD_DATE) /* bad or out of range date; remove it */
ap_table_unset(r->headers_in, "If-Modified-Since");
}
@@ -823,7 +823,7 @@
*/
expire = ap_table_get(resp_hdrs, "Expires");
if (expire != NULL)
- expc = ap_parseHTTPdate(expire, &expc);
+ expc = ap_parseHTTPdate(expire);
else
expc = BAD_DATE;
@@ -832,7 +832,7 @@
*/
lmods = ap_table_get(resp_hdrs, "Last-Modified");
if (lmods != NULL) {
- lmod = ap_parseHTTPdate(lmods, &lmod);
+ lmod = ap_parseHTTPdate(lmods);
if (lmod == BAD_DATE) {
/* kill last modified date */
lmods = NULL;
@@ -877,7 +877,7 @@
*/
dates = ap_table_get(resp_hdrs, "Date");
if (dates != NULL)
- date = ap_parseHTTPdate(dates, &date);
+ date = ap_parseHTTPdate(dates);
else
date = BAD_DATE;
@@ -911,7 +911,7 @@
if (expire == NULL && c->fp != NULL) { /* no expiry data sent in
response */
expire = ap_table_get(c->hdrs, "Expires");
if (expire != NULL)
- expc = ap_parseHTTPdate(expire, &expc);
+ expc = ap_parseHTTPdate(expire);
}
/* so we now have the expiry date */
/* if no expiry date then