]> granicus.if.org Git - apache/commitdiff
A few more tweaks to finish the modules work. Now, all of the modules
authorRyan Bloom <rbb@apache.org>
Fri, 31 Dec 1999 20:32:36 +0000 (20:32 +0000)
committerRyan Bloom <rbb@apache.org>
Fri, 31 Dec 1999 20:32:36 +0000 (20:32 +0000)
compile correctly with Apache 2.0. This does run, but it hasn't been tested
any more than simply compiling and running the server.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84386 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_status.c
modules/metadata/mod_cern_meta.c
modules/metadata/mod_expires.c
modules/metadata/mod_usertrack.c
server/mpm/prefork/prefork.c

index 1901816fab114fdd63be4f0ac921b354296f58b7..1752c049c9ead371917bc5da06da006cb6bff613 100644 (file)
@@ -85,7 +85,7 @@ static int status_handler(request_rec *r)
     ap_time_t *nowtime = NULL;
 
     ap_make_time(&nowtime, r->pool);
-    ap_curtime(nowtime);
+    ap_current_time(nowtime);
 
     r->allowed = (1 << M_GET);
     if (r->method_number != M_GET)
index 4ac6963db85a746553712ebb76df53dec24688fb..23f93ecdfa2b1f3c8c05ec22da789ab4db2b57d3 100644 (file)
@@ -229,7 +229,7 @@ static const command_rec cern_meta_cmds[] =
 /* XXX: this is very similar to ap_scan_script_header_err_core...
  * are the differences deliberate, or just a result of bit rot?
  */
-static int scan_meta_file(request_rec *r, FILE *f)
+static int scan_meta_file(request_rec *r, ap_file_t *f)
 {
     char w[MAX_STRING_LEN];
     char *l;
@@ -237,7 +237,7 @@ static int scan_meta_file(request_rec *r, FILE *f)
     ap_table_t *tmp_headers;
 
     tmp_headers = ap_make_table(r->pool, 5);
-    while (fgets(w, MAX_STRING_LEN - 1, f) != NULL) {
+    while (ap_fgets(w, MAX_STRING_LEN - 1, f) != APR_SUCCESS) {
 
        /* Delete terminal (CR?)LF */
 
@@ -295,7 +295,8 @@ static int add_cern_meta_data(request_rec *r)
     char *last_slash;
     char *real_file;
     char *scrap_book;
-    FILE *f;
+    ap_file_t *f = NULL;
+    ap_status_t retcode;
     cern_meta_dir_config *dconf;
     int rv;
     request_rec *rr;
@@ -354,8 +355,8 @@ static int add_cern_meta_data(request_rec *r)
     }
     ap_destroy_sub_req(rr);
 
-    f = ap_pfopen(r->pool, metafilename, "r");
-    if (f == NULL) {
+    retcode = ap_open(&f, metafilename, APR_READ | APR_CREATE, APR_OS_DEFAULT, r->pool);
+    if (retcode != APR_SUCCESS) {
        if (errno == ENOENT) {
            return DECLINED;
        }
@@ -366,7 +367,7 @@ static int add_cern_meta_data(request_rec *r)
 
     /* read the headers in */
     rv = scan_meta_file(r, f);
-    ap_pfclose(r->pool, f);
+    ap_close(f);
 
     return rv;
 }
index 77ee0059cb02a64f19104b578b879f3f40206e9c..a92c237e354fb7d6fc912dbdc37595157be6fc12 100644 (file)
@@ -402,9 +402,11 @@ static int add_expires(request_rec *r)
 {
     expires_dir_config *conf;
     char *code;
-    time_t base;
+    char *timestr = NULL;
+    ap_int64_t base;
     time_t additional;
     time_t expires;
+    ap_time_t *finaltime = NULL;
     char age[20];
 
     if (ap_is_HTTP_ERROR(r->status))       /* Don't add Expires headers to errors */
@@ -464,7 +466,7 @@ static int add_expires(request_rec *r)
         /* there's been some discussion and it's possible that 
          * 'access time' will be stored in request structure
          */
-        base = r->request_time;
+        ap_get_curtime(r->request_time, &base);
         additional = atoi(&code[1]);
         break;
     default:
@@ -482,13 +484,18 @@ static int add_expires(request_rec *r)
     tzset();                    /* redundant? called implicitly by localtime, at least 
                                  * under FreeBSD
                                  */
-    ap_table_setn(r->headers_out, "Expires", ap_gm_timestr_822(r->pool, expires));
+    ap_make_time(&finaltime, r->pool);
+    ap_set_curtime(finaltime, expires);
+    ap_timestr(&timestr, finaltime, APR_UTCTIME, r->pool); 
+    ap_table_setn(r->headers_out, "Expires", timestr);
     return OK;
 }
+
 static void register_hooks(void)
 {
     ap_hook_fixups(add_expires,NULL,NULL,HOOK_MIDDLE);
 }
+
 module MODULE_VAR_EXPORT expires_module =
 {
     STANDARD20_MODULE_STUFF,
index 736af5535451105b89b55197cfaade8d539d1ff2..01fd4528db55f09ecc6a71aa51c6f316231b5965 100644 (file)
@@ -184,11 +184,11 @@ static void make_cookie(request_rec *r)
         struct tm *tms;
         ap_time_t *when = NULL;
         ap_int64_t req_time;
+        char *temp_cookie = NULL;
+        ap_size_t retsize;
         
         ap_make_time(&when, r->pool);
         ap_get_curtime(when, &req_time);
-        ap_set_curtime(when,  req_time + cls->expires);
-
 #ifndef MILLENIAL_COOKIES
         /*
          * Only two-digit date string, so we can't trust "00" or more.
@@ -196,18 +196,17 @@ static void make_cookie(request_rec *r)
          * 1/1/2000 (which is 946684799)
          */
 
-        if (when > 946684799)
-            when = 946684799;
+        if (req_time + cls->expires > 946684799) {
+            ap_set_curtime(when, 946684799);
+        }
+        else
 #endif
-        tms = gmtime(&when);
+            ap_set_curtime(when,  req_time + cls->expires);
 
         /* Cookie with date; as strftime '%a, %d-%h-%y %H:%M:%S GMT' */
-        new_cookie = ap_psprintf(r->pool,
-                "%s=%s; path=/; expires=%s, %.2d-%s-%.2d %.2d:%.2d:%.2d GMT",
-                    dcfg->cookie_name, cookiebuf, ap_day_snames[tms->tm_wday],
-                    tms->tm_mday, ap_month_snames[tms->tm_mon],
-                   tms->tm_year % 100,
-                    tms->tm_hour, tms->tm_min, tms->tm_sec);
+        ap_strftime(temp_cookie, &retsize, MAX_STRING_LEN, "%a, %d-%h-%y %H:%M:%S GMT", when); 
+        new_cookie = ap_psprintf(r->pool, "%s=%s; path=/; expires=%s", 
+                                 dcfg->cookie_name, cookiebuf, temp_cookie);
     }
     else {
        new_cookie = ap_psprintf(r->pool, "%s=%s; path=/",
index 7226a0e232d67a2d8f33b9f92c32679c82f6113a..f4129a00f3bd5992f98febad999d920ec8a5d94f 100644 (file)
@@ -2985,6 +2985,12 @@ API_EXPORT(void) ap_update_connection_status(long conn_id, const char *key, \
     /* NOP */
 }
 
+ap_array_header_t *ap_get_status_table(ap_context_t *p)
+{
+    /* NOP */
+    return NULL;
+}
+
 API_EXPORT(void) ap_reset_connection_status(long conn_id)
 {
     /* NOP */