From: Ryan Bloom Date: Fri, 31 Dec 1999 20:32:36 +0000 (+0000) Subject: A few more tweaks to finish the modules work. Now, all of the modules X-Git-Tag: 1.3.10~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7cb6de58a7258518dcc0c95f47aab361be75ff91;p=apache A few more tweaks to finish the modules work. Now, all of the modules 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 --- diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 1901816fab..1752c049c9 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -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) diff --git a/modules/metadata/mod_cern_meta.c b/modules/metadata/mod_cern_meta.c index 4ac6963db8..23f93ecdfa 100644 --- a/modules/metadata/mod_cern_meta.c +++ b/modules/metadata/mod_cern_meta.c @@ -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; } diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c index 77ee0059cb..a92c237e35 100644 --- a/modules/metadata/mod_expires.c +++ b/modules/metadata/mod_expires.c @@ -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(×tr, 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, diff --git a/modules/metadata/mod_usertrack.c b/modules/metadata/mod_usertrack.c index 736af55354..01fd4528db 100644 --- a/modules/metadata/mod_usertrack.c +++ b/modules/metadata/mod_usertrack.c @@ -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=/", diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 7226a0e232..f4129a00f3 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -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 */