1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

Cleanup the ZZZ comments. Basically these used to mark places where APR

is needed.  It is much easier to do this conversion by hand than by
searching for old comments, so they are going away now.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84128 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan Bloom
1999-11-16 18:32:05 +00:00
parent cb7f5c2805
commit 370fc31b00
18 changed files with 28 additions and 80 deletions

4
STATUS
View File

@@ -1,5 +1,5 @@
Apache 2.0 STATUS: Apache 2.0 STATUS:
Last modified at [$Date: 1999/11/16 15:11:51 $] Last modified at [$Date: 1999/11/16 18:30:18 $]
Release: Release:
@@ -118,8 +118,6 @@ Other features that need writing:
* TODO in source -- just do an egrep on "TODO" and see what's there * TODO in source -- just do an egrep on "TODO" and see what's there
* Odd comments in source (egrep for "ZZZ") need to be cleaned-up
* Work on other MPMs. Possible MPMs discussed or in progress include: * Work on other MPMs. Possible MPMs discussed or in progress include:
- Dean Gaudet's async MPM - Dean Gaudet's async MPM

View File

@@ -518,8 +518,6 @@ char *ap_response_code_string(request_rec *r, int error_index)
/* Code from Harald Hanche-Olsen <hanche@imf.unit.no> */ /* Code from Harald Hanche-Olsen <hanche@imf.unit.no> */
/* ZZZ let's pass the buffer and the host entry so we don't have to allocate
another stack frame. */
static ap_inline void do_double_reverse (conn_rec *conn) static ap_inline void do_double_reverse (conn_rec *conn)
{ {
struct hostent *hptr; struct hostent *hptr;
@@ -533,8 +531,8 @@ static ap_inline void do_double_reverse (conn_rec *conn)
conn->double_reverse = -1; conn->double_reverse = -1;
return; return;
} }
hptr = gethostbyname(conn->remote_host); /*ZZZ change to AP func */ hptr = gethostbyname(conn->remote_host);
if (hptr) { /*ZZZ enumerate through host entries */ if (hptr) {
char **haddr; char **haddr;
for (haddr = hptr->h_addr_list; *haddr; haddr++) { for (haddr = hptr->h_addr_list; *haddr; haddr++) {
@@ -573,7 +571,6 @@ API_EXPORT(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config,
&& conn->remote_host == NULL && conn->remote_host == NULL
&& (type == REMOTE_DOUBLE_REV && (type == REMOTE_DOUBLE_REV
|| hostname_lookups != HOSTNAME_LOOKUP_OFF)) { || hostname_lookups != HOSTNAME_LOOKUP_OFF)) {
/* ZZZ change to AP functions. */
iaddr = &(conn->remote_addr.sin_addr); iaddr = &(conn->remote_addr.sin_addr);
hptr = gethostbyaddr((char *)iaddr, sizeof(struct in_addr), AF_INET); hptr = gethostbyaddr((char *)iaddr, sizeof(struct in_addr), AF_INET);
if (hptr != NULL) { if (hptr != NULL) {
@@ -2511,7 +2508,6 @@ static int default_handler(request_rec *r)
if (r->method_number == M_PUT) { if (r->method_number == M_PUT) {
return METHOD_NOT_ALLOWED; return METHOD_NOT_ALLOWED;
} }
/* ZZZ can we store if the file exists or not? */
if (r->finfo.st_mode == 0 || (r->path_info && *r->path_info)) { if (r->finfo.st_mode == 0 || (r->path_info && *r->path_info)) {
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
"File does not exist: %s",r->path_info ? "File does not exist: %s",r->path_info ?

View File

@@ -313,7 +313,6 @@ API_EXPORT(int) ap_set_keepalive(request_rec *r)
((r->proto_num >= HTTP_VERSION(1,1)) && ((r->proto_num >= HTTP_VERSION(1,1)) &&
(r->chunked = 1))) && /* THIS CODE IS CORRECT, see comment above. */ (r->chunked = 1))) && /* THIS CODE IS CORRECT, see comment above. */
r->server->keep_alive && r->server->keep_alive &&
/* ZZZ change to APR keepalive timeout defined value */
(r->server->keep_alive_timeout > 0) && (r->server->keep_alive_timeout > 0) &&
((r->server->keep_alive_max == 0) || ((r->server->keep_alive_max == 0) ||
(r->server->keep_alive_max > r->connection->keepalives)) && (r->server->keep_alive_max > r->connection->keepalives)) &&
@@ -382,7 +381,6 @@ API_EXPORT(time_t) ap_rationalize_mtime(request_rec *r, time_t mtime)
* were given a time in the future, we return the current time - the * were given a time in the future, we return the current time - the
* Last-Modified can't be in the future. * Last-Modified can't be in the future.
*/ */
/* ZZZ Change time call to use time AP time thread functions. */
now = (mtime < r->request_time) ? r->request_time : time(NULL); now = (mtime < r->request_time) ? r->request_time : time(NULL);
return (mtime > now) ? now : mtime; return (mtime > now) ? now : mtime;
} }
@@ -408,7 +406,6 @@ API_EXPORT(int) ap_meets_conditions(request_rec *r)
return OK; return OK;
} }
/* ZZZ We are changing time(NULL) to AP time thread functions. */
mtime = (r->mtime != 0) ? r->mtime : time(NULL); mtime = (r->mtime != 0) ? r->mtime : time(NULL);
/* If an If-Match request-header field was given /* If an If-Match request-header field was given

View File

@@ -116,7 +116,6 @@ IMPLEMENT_HOOK_RUN_FIRST(int,auth_checker,(request_rec *r),(r),DECLINED)
static int check_safe_file(request_rec *r) static int check_safe_file(request_rec *r)
{ {
/* ZZZ change to AP defines */
if (r->finfo.st_mode == 0 /* doesn't exist */ if (r->finfo.st_mode == 0 /* doesn't exist */
|| S_ISDIR(r->finfo.st_mode) || S_ISDIR(r->finfo.st_mode)
|| S_ISREG(r->finfo.st_mode) || S_ISREG(r->finfo.st_mode)
@@ -261,21 +260,18 @@ static int get_path_info(request_rec *r)
} }
else { else {
errno = 0; errno = 0;
/* ZZZ change to AP func for File Info */
rv = stat(path, &r->finfo); rv = stat(path, &r->finfo);
} }
if (cp != end) if (cp != end)
*cp = '/'; *cp = '/';
if (!rv) { /* ZZZ AP Status check here */ if (!rv) {
/* /*
* Aha! Found something. If it was a directory, we will search * Aha! Found something. If it was a directory, we will search
* contents of that directory for a multi_match, so the PATH_INFO * contents of that directory for a multi_match, so the PATH_INFO
* argument starts with the component after that. * argument starts with the component after that.
*/ */
/* ZZZ use AP file type checking defines */
if (S_ISDIR(r->finfo.st_mode) && last_cp) { if (S_ISDIR(r->finfo.st_mode) && last_cp) {
r->finfo.st_mode = 0; /* No such file... */ r->finfo.st_mode = 0; /* No such file... */
cp = last_cp; cp = last_cp;
@@ -290,8 +286,6 @@ static int get_path_info(request_rec *r)
*/ */
r->finfo.st_mode = 0; r->finfo.st_mode = 0;
/* ZZZ Let's throw some AP Errno checking in here and get rid of the
#defines. */
#if defined(ENOENT) && defined(ENOTDIR) #if defined(ENOENT) && defined(ENOTDIR)
if (errno == ENOENT || errno == ENOTDIR) { if (errno == ENOENT || errno == ENOTDIR) {
last_cp = cp; last_cp = cp;
@@ -303,7 +297,7 @@ static int get_path_info(request_rec *r)
--cp; --cp;
} }
else { else {
#if defined(EACCES) /* ZZZ again, AP error checking. */ #if defined(EACCES)
if (errno != EACCES) if (errno != EACCES)
#endif #endif
ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r, ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r,
@@ -442,8 +436,7 @@ static int directory_walk(request_rec *r)
if (test_filename[test_filename_len - 1] == '/') if (test_filename[test_filename_len - 1] == '/')
--num_dirs; --num_dirs;
if (S_ISDIR(r->finfo.st_mode)) /* zzz use AP funcs and defines to make if (S_ISDIR(r->finfo.st_mode))
this quicker */
++num_dirs; ++num_dirs;
/* /*
@@ -578,7 +571,7 @@ static int directory_walk(request_rec *r)
* S_ISDIR test. But if you accessed /symlink/index.html, for example, * S_ISDIR test. But if you accessed /symlink/index.html, for example,
* you would *not* get the 403. * you would *not* get the 403.
*/ */
if (!S_ISDIR(r->finfo.st_mode) /* ZZZ use AP funcs and defines */ if (!S_ISDIR(r->finfo.st_mode)
&& (res = check_symlinks(r->filename, ap_allow_options(r)))) { && (res = check_symlinks(r->filename, ap_allow_options(r)))) {
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
"Symbolic link not allowed: %s", r->filename); "Symbolic link not allowed: %s", r->filename);
@@ -867,7 +860,6 @@ API_EXPORT(request_rec *) ap_sub_req_lookup_file(const char *new_file,
rnew->filename = ap_make_full_path(rnew->pool, fdir, new_file); rnew->filename = ap_make_full_path(rnew->pool, fdir, new_file);
ap_parse_uri(rnew, rnew->uri); /* fill in parsed_uri values */ ap_parse_uri(rnew, rnew->uri); /* fill in parsed_uri values */
/* ZZZ use AP funcs to get File Info */
if (stat(rnew->filename, &rnew->finfo) < 0) { if (stat(rnew->filename, &rnew->finfo) < 0) {
rnew->finfo.st_mode = 0; rnew->finfo.st_mode = 0;
} }
@@ -883,7 +875,6 @@ API_EXPORT(request_rec *) ap_sub_req_lookup_file(const char *new_file,
* no matter what, if it's a subdirectory, we need to re-run * no matter what, if it's a subdirectory, we need to re-run
* directory_walk * directory_walk
*/ */
/* ZZZ use AP funcs and defines for this. */
if (S_ISDIR(rnew->finfo.st_mode)) { if (S_ISDIR(rnew->finfo.st_mode)) {
res = directory_walk(rnew); res = directory_walk(rnew);
if (!res) { if (!res) {

View File

@@ -70,7 +70,7 @@ void beosd_detach(void)
chdir("/"); chdir("/");
/* ZZZ /*
* fork() is evil if we're also doing spawn_thread...so we don't use it. * fork() is evil if we're also doing spawn_thread...so we don't use it.
* This means that it won't detach properly, so we'll have to find a way * This means that it won't detach properly, so we'll have to find a way
* round this. * round this.

View File

@@ -1021,14 +1021,14 @@ void ap_process_resource_config(server_rec *s, const char *fname, ap_context_t *
if (!(strcmp(fname, ap_server_root_relative(p, RESOURCE_CONFIG_FILE))) || if (!(strcmp(fname, ap_server_root_relative(p, RESOURCE_CONFIG_FILE))) ||
!(strcmp(fname, ap_server_root_relative(p, ACCESS_CONFIG_FILE)))) { !(strcmp(fname, ap_server_root_relative(p, ACCESS_CONFIG_FILE)))) {
if (stat(fname, &finfo) == -1) /* ZZZ can we read the file? ACCESS better here. */ if (stat(fname, &finfo) == -1)
return; return;
} }
/* don't require conf/httpd.conf if we have a -C or -c switch */ /* don't require conf/httpd.conf if we have a -C or -c switch */
if((ap_server_pre_read_config->nelts || ap_server_post_read_config->nelts) && if((ap_server_pre_read_config->nelts || ap_server_post_read_config->nelts) &&
!(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE)))) { !(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE)))) {
if (stat(fname, &finfo) == -1) /* ZZZ can we read the file? ACCESS better here. */ if (stat(fname, &finfo) == -1)
return; return;
} }
@@ -1041,7 +1041,6 @@ void ap_process_resource_config(server_rec *s, const char *fname, ap_context_t *
parms.override = (RSRC_CONF | OR_ALL) & ~(OR_AUTHCFG | OR_LIMIT); parms.override = (RSRC_CONF | OR_ALL) & ~(OR_AUTHCFG | OR_LIMIT);
if (ap_pcfg_openfile(&parms.config_file, p, fname) != APR_SUCCESS) { if (ap_pcfg_openfile(&parms.config_file, p, fname) != APR_SUCCESS) {
/* ZZZ use ap_strerror() once it exists to print an error message */
fprintf(stderr, "%s: could not open document config file %s\n", fprintf(stderr, "%s: could not open document config file %s\n",
ap_server_argv0, fname); ap_server_argv0, fname);
exit(1); exit(1);
@@ -1262,14 +1261,13 @@ static server_rec *init_server_config(process_rec *process, ap_context_t *p)
s->limit_req_line = DEFAULT_LIMIT_REQUEST_LINE; s->limit_req_line = DEFAULT_LIMIT_REQUEST_LINE;
s->limit_req_fieldsize = DEFAULT_LIMIT_REQUEST_FIELDSIZE; s->limit_req_fieldsize = DEFAULT_LIMIT_REQUEST_FIELDSIZE;
s->limit_req_fields = DEFAULT_LIMIT_REQUEST_FIELDS; s->limit_req_fields = DEFAULT_LIMIT_REQUEST_FIELDS;
s->timeout = DEFAULT_TIMEOUT; /*ZZZ use AP default timeouts here*/ s->timeout = DEFAULT_TIMEOUT;
s->keep_alive_timeout = DEFAULT_KEEPALIVE_TIMEOUT; s->keep_alive_timeout = DEFAULT_KEEPALIVE_TIMEOUT;
s->keep_alive_max = DEFAULT_KEEPALIVE; s->keep_alive_max = DEFAULT_KEEPALIVE;
s->keep_alive = 1; s->keep_alive = 1;
s->next = NULL; s->next = NULL;
s->addrs = ap_pcalloc(p, sizeof(server_addr_rec)); s->addrs = ap_pcalloc(p, sizeof(server_addr_rec));
/* NOT virtual host; don't match any real network interface */ /* NOT virtual host; don't match any real network interface */
/* ZZZ Initialize the Network Address here. */
s->addrs->host_addr.s_addr = htonl(INADDR_ANY); s->addrs->host_addr.s_addr = htonl(INADDR_ANY);
s->addrs->host_port = 0; /* matches any port */ s->addrs->host_port = 0; /* matches any port */
s->addrs->virthost = ""; /* must be non-NULL */ s->addrs->virthost = ""; /* must be non-NULL */

View File

@@ -103,14 +103,14 @@ IMPLEMENT_HOOK_RUN_FIRST(int,process_connection,(conn_rec *c),(c),DECLINED)
#ifdef USE_SO_LINGER #ifdef USE_SO_LINGER
#define NO_LINGCLOSE /* The two lingering options are exclusive */ #define NO_LINGCLOSE /* The two lingering options are exclusive */
static void sock_enable_linger(int s) /* // ZZZZZ abstract the socket, s */ static void sock_enable_linger(int s)
{ {
struct linger li; /* // ZZZZZ SocketOptions... */ struct linger li;
li.l_onoff = 1; li.l_onoff = 1;
li.l_linger = MAX_SECS_TO_LINGER; li.l_linger = MAX_SECS_TO_LINGER;
if (setsockopt(s, SOL_SOCKET, SO_LINGER, /* // ZZZZZ abstract, return SUCCESS or not */ if (setsockopt(s, SOL_SOCKET, SO_LINGER,
(char *) &li, sizeof(struct linger)) < 0) { (char *) &li, sizeof(struct linger)) < 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf,
"setsockopt: (SO_LINGER)"); "setsockopt: (SO_LINGER)");
@@ -130,10 +130,9 @@ static void sock_enable_linger(int s) /* // ZZZZZ abstract the socket, s */
* distinguish between a dropped connection and something that might be * distinguish between a dropped connection and something that might be
* worth logging. * worth logging.
*/ */
/*ZZZ this routine needs to be adapted for use with poll()*/
static void lingering_close(request_rec *r) static void lingering_close(request_rec *r)
{ {
/*ZZZ remove the hardwired 512. This is an IO Buffer Size */ /*TODO remove the hardwired 512. This is an IO Buffer Size */
char dummybuf[512]; char dummybuf[512];
struct pollfd pd; struct pollfd pd;
int lsd; int lsd;
@@ -156,7 +155,7 @@ static void lingering_close(request_rec *r)
lsd = r->connection->client->fd; lsd = r->connection->client->fd;
if ((shutdown(lsd, 1) != 0) /* ZZZ abstract shutdown */ if ((shutdown(lsd, 1) != 0)
|| ap_is_aborted(r->connection)) { || ap_is_aborted(r->connection)) {
ap_bclose(r->connection->client); ap_bclose(r->connection->client);
return; return;
@@ -184,7 +183,7 @@ static void lingering_close(request_rec *r)
pd.revents = 0; pd.revents = 0;
} while ((poll(&pd, 1, 2) == 1) } while ((poll(&pd, 1, 2) == 1)
&& read(lsd, dummybuf, sizeof(dummybuf))); && read(lsd, dummybuf, sizeof(dummybuf)));
/* && (time() = epoch) < max_wait); */ /* ZZZZ time function is not good... */ /* && (time() = epoch) < max_wait); */
/* Should now have seen final ack. Safe to finally kill socket */ /* Should now have seen final ack. Safe to finally kill socket */
ap_bclose(r->connection->client); ap_bclose(r->connection->client);

View File

@@ -704,7 +704,7 @@ static int setup_listeners(server_rec *s)
*/ */
#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF) #if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF)
static void sock_disable_nagle(int s) /* ZZZ abstract */ static void sock_disable_nagle(int s)
{ {
/* The Nagle algorithm says that we should delay sending partial /* The Nagle algorithm says that we should delay sending partial
* packets in hopes of getting more data. We don't want to do * packets in hopes of getting more data. We don't want to do
@@ -1086,7 +1086,7 @@ static void child_main(int child_num_arg)
} }
} }
static int make_child(server_rec *s, int slot, time_t now) /* ZZZ */ static int make_child(server_rec *s, int slot, time_t now)
{ {
int pid; int pid;
@@ -1254,7 +1254,6 @@ static void server_main_loop(int remaining_children_to_start)
/* we're still doing a 1-for-1 replacement of dead /* we're still doing a 1-for-1 replacement of dead
* children with new children * children with new children
*/ */
/* ZZZ abstract out for AP funcs. */
make_child(server_conf, child_slot, time(NULL)); make_child(server_conf, child_slot, time(NULL));
--remaining_children_to_start; --remaining_children_to_start;
} }
@@ -1658,7 +1657,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
} }
fname = ap_server_root_relative(cmd->pool, arg); fname = ap_server_root_relative(cmd->pool, arg);
/* ZZZ change this to the AP func FileInfo*/
if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) { if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) {
return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
" does not exist or is not a directory", NULL); " does not exist or is not a directory", NULL);

View File

@@ -872,7 +872,7 @@ static int32 child_main(void * data)
return (0); return (0);
} }
static int make_child(server_rec *s, int slot, time_t now) /* ZZZ */ static int make_child(server_rec *s, int slot, time_t now)
{ {
thread_id tid; thread_id tid;
@@ -1017,7 +1017,6 @@ static void server_main_loop(int remaining_children_to_start)
/* we're still doing a 1-for-1 replacement of dead /* we're still doing a 1-for-1 replacement of dead
* children with new children * children with new children
*/ */
/* ZZZ abstract out for AP funcs. */
make_child(server_conf, child_slot, time(NULL)); make_child(server_conf, child_slot, time(NULL));
--remaining_children_to_start; --remaining_children_to_start;
} }
@@ -1185,7 +1184,7 @@ int ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s)
"SIGHUP received. Attempting to restart"); "SIGHUP received. Attempting to restart");
} }
if (!is_graceful) { if (!is_graceful) {
ap_restart_time = time(NULL); /* ZZZZZ */ ap_restart_time = time(NULL);
} }
delete_port(port_of_death); delete_port(port_of_death);
return 0; return 0;
@@ -1376,7 +1375,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
} }
fname = ap_server_root_relative(cmd->pool, arg); fname = ap_server_root_relative(cmd->pool, arg);
/* ZZZ change this to the AP func FileInfo*/
if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) { if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) {
return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
" does not exist or is not a directory", NULL); " does not exist or is not a directory", NULL);

View File

@@ -696,7 +696,7 @@ static int setup_listeners(server_rec *s)
*/ */
#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF) #if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF)
static void sock_disable_nagle(int s) /* ZZZ abstract */ static void sock_disable_nagle(int s)
{ {
/* The Nagle algorithm says that we should delay sending partial /* The Nagle algorithm says that we should delay sending partial
* packets in hopes of getting more data. We don't want to do * packets in hopes of getting more data. We don't want to do
@@ -1046,7 +1046,7 @@ static void child_main(int child_num_arg)
} }
} }
static int make_child(server_rec *s, int slot, time_t now) /* ZZZ */ static int make_child(server_rec *s, int slot, time_t now)
{ {
int pid; int pid;
@@ -1220,7 +1220,6 @@ static void perform_idle_server_maintenance(void)
idle_spawn_rate = 1; idle_spawn_rate = 1;
} }
else { else {
/* ZZZZ */
if (idle_spawn_rate >= 8) { if (idle_spawn_rate >= 8) {
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, server_conf, ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, server_conf,
@@ -1273,7 +1272,6 @@ static void server_main_loop(int remaining_children_to_start)
/* we're still doing a 1-for-1 replacement of dead /* we're still doing a 1-for-1 replacement of dead
* children with new children * children with new children
*/ */
/* ZZZ abstract out for AP funcs. */
make_child(server_conf, child_slot, time(NULL)); make_child(server_conf, child_slot, time(NULL));
--remaining_children_to_start; --remaining_children_to_start;
} }
@@ -1487,7 +1485,7 @@ int ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s)
"SIGHUP received. Attempting to restart"); "SIGHUP received. Attempting to restart");
} }
if (!is_graceful) { if (!is_graceful) {
ap_restart_time = time(NULL); /* ZZZZZ */ ap_restart_time = time(NULL);
} }
return 0; return 0;
} }
@@ -1677,7 +1675,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
} }
fname = ap_server_root_relative(cmd->pool, arg); fname = ap_server_root_relative(cmd->pool, arg);
/* ZZZ change this to the AP func FileInfo*/
if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) { if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) {
return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
" does not exist or is not a directory", NULL); " does not exist or is not a directory", NULL);

View File

@@ -642,7 +642,7 @@ void ap_time_process_request(int child_num, int thread_num, int status)
ss = &ap_scoreboard_image->servers[child_num][thread_num]; ss = &ap_scoreboard_image->servers[child_num][thread_num];
if (status == START_PREQUEST) { if (status == START_PREQUEST) {
/*ss->start_time = GetCurrentTime(); ZZZ return time in uS since the /*ss->start_time = GetCurrentTime(); return time in uS since the
epoch. Some platforms do not support gettimeofday. Create a routine epoch. Some platforms do not support gettimeofday. Create a routine
to get the current time is some useful units. */ to get the current time is some useful units. */
if (gettimeofday(&ss->start_time, (struct timezone *) 0) < 0) { if (gettimeofday(&ss->start_time, (struct timezone *) 0) < 0) {
@@ -651,7 +651,7 @@ void ap_time_process_request(int child_num, int thread_num, int status)
} }
else if (status == STOP_PREQUEST) { else if (status == STOP_PREQUEST) {
/*ss->stop_time = GetCurrentTime(); /*ss->stop_time = GetCurrentTime();
ZZZ return time in uS since the epoch */ return time in uS since the epoch */
if (gettimeofday(&ss->stop_time, (struct timezone *) 0) < 0) { if (gettimeofday(&ss->stop_time, (struct timezone *) 0) < 0) {
ss->start_time.tv_sec = ss->start_time.tv_usec = 0L; ss->start_time.tv_sec = ss->start_time.tv_usec = 0L;

View File

@@ -2933,7 +2933,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
} }
fname = ap_server_root_relative(cmd->pool, arg); fname = ap_server_root_relative(cmd->pool, arg);
/* ZZZ change this to the AP func FileInfo*/
if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) { if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) {
return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
" does not exist or is not a directory", NULL); " does not exist or is not a directory", NULL);

View File

@@ -1737,7 +1737,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
} }
fname = ap_server_root_relative(cmd->pool, arg); fname = ap_server_root_relative(cmd->pool, arg);
/* ZZZ change this to the AP func FileInfo*/
if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) { if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) {
return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
" does not exist or is not a directory", NULL); " does not exist or is not a directory", NULL);

View File

@@ -361,7 +361,7 @@ static void AMCSocketCleanup(void)
return; return;
} }
static void sock_disable_nagle(int s) /* ZZZ abstract */ static void sock_disable_nagle(int s)
{ {
/* The Nagle algorithm says that we should delay sending partial /* The Nagle algorithm says that we should delay sending partial
* packets in hopes of getting more data. We don't want to do * packets in hopes of getting more data. We don't want to do
@@ -1792,7 +1792,6 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
} }
fname = ap_server_root_relative(cmd->pool, arg); fname = ap_server_root_relative(cmd->pool, arg);
/* ZZZ change this to the AP func FileInfo*/
if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) { if ((stat(fname, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) {
return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
" does not exist or is not a directory", NULL); " does not exist or is not a directory", NULL);

View File

@@ -103,8 +103,6 @@ API_VAR_EXPORT const char ap_day_snames[7][4] =
API_EXPORT(char *) ap_get_time() API_EXPORT(char *) ap_get_time()
{ {
/* ZZZ When we abstract out time, this whole function should change to use
AP funcs. */
time_t t; time_t t;
char *time_string; char *time_string;
@@ -136,8 +134,6 @@ API_EXPORT(char *) ap_field_noparam(ap_context_t *p, const char *intype)
API_EXPORT(char *) ap_ht_time(ap_context_t *p, time_t t, const char *fmt, int gmt) API_EXPORT(char *) ap_ht_time(ap_context_t *p, time_t t, const char *fmt, int gmt)
{ {
/* ZZZ this function can be replaced by calls to time formatting routines
in APR. */
char ts[MAX_STRING_LEN]; char ts[MAX_STRING_LEN];
char tf[MAX_STRING_LEN]; char tf[MAX_STRING_LEN];
struct tm *tms; struct tm *tms;
@@ -190,7 +186,7 @@ API_EXPORT(char *) ap_gm_timestr_822(ap_context_t *p, time_t sec)
char *date_str_ptr = date_str; char *date_str_ptr = date_str;
int real_year; int real_year;
tms = gmtime(&sec); /* ZZZ replace with AP time routine */ tms = gmtime(&sec);
/* Assumption: this is always 3 */ /* Assumption: this is always 3 */
/* i = strlen(ap_day_snames[tms->tm_wday]); */ /* i = strlen(ap_day_snames[tms->tm_wday]); */
@@ -1665,7 +1661,6 @@ API_EXPORT(int) ap_is_directory(const char *path)
{ {
struct stat finfo; struct stat finfo;
/* ZZZ replace with AP File Info func. */
if (stat(path, &finfo) == -1) if (stat(path, &finfo) == -1)
return 0; /* in error condition, just return no */ return 0; /* in error condition, just return no */
@@ -1914,7 +1909,6 @@ API_EXPORT(gid_t) ap_gname2id(const char *name)
*/ */
unsigned long ap_get_virthost_addr(char *w, unsigned short *ports) unsigned long ap_get_virthost_addr(char *w, unsigned short *ports)
{ {
/* ZZZ Redesign for AP func changes */
struct hostent *hep; struct hostent *hep;
unsigned long my_addr; unsigned long my_addr;
char *p; char *p;
@@ -1986,7 +1980,6 @@ char *ap_get_local_host(ap_context_t *a)
char *server_hostname; char *server_hostname;
struct hostent *p; struct hostent *p;
/* ZZZ change to use AP funcs. */
#ifdef BEOS #ifdef BEOS
if (gethostname(str, sizeof(str) - 1) == 0) if (gethostname(str, sizeof(str) - 1) == 0)
#else #else

View File

@@ -198,7 +198,6 @@ API_EXPORT(char *) ap_md5digest(ap_context_t *p, int infile, int convert)
int nbytes; int nbytes;
ap_MD5Init(&context); ap_MD5Init(&context);
/* ZZZ use AP func instead of fread. */
while ((nbytes = read(infile, buf, sizeof(buf)))) { while ((nbytes = read(infile, buf, sizeof(buf)))) {
length += nbytes; length += nbytes;
if (!convert) { if (!convert) {
@@ -206,7 +205,6 @@ API_EXPORT(char *) ap_md5digest(ap_context_t *p, int infile, int convert)
} }
ap_MD5Update(&context, buf, nbytes); ap_MD5Update(&context, buf, nbytes);
} }
/* ZZZ use AP seek func instead of REWIND. */
lseek(infile, 0L, SEEK_SET); lseek(infile, 0L, SEEK_SET);
return ap_md5contextTo64(p, &context); return ap_md5contextTo64(p, &context);
} }
@@ -221,12 +219,10 @@ API_EXPORT(char *) ap_md5digest(ap_context_t *p, int infile)
int nbytes; int nbytes;
ap_MD5Init(&context); ap_MD5Init(&context);
/* ZZZ use AP func instead of fread. */
while ((nbytes = read(infile, buf, sizeof(buf)))) { while ((nbytes = read(infile, buf, sizeof(buf)))) {
length += nbytes; length += nbytes;
ap_MD5Update(&context, buf, nbytes); ap_MD5Update(&context, buf, nbytes);
} }
/* ZZZ use AP seek func instead of REWIND. */
lseek(infile, 0L, SEEK_SET); lseek(infile, 0L, SEEK_SET);
return ap_md5contextTo64(p, &context); return ap_md5contextTo64(p, &context);
} }

View File

@@ -682,9 +682,6 @@ static char **create_argv_cmd(ap_context_t *p, char *av0, const char *args, char
} }
#endif #endif
/* ZZZ need to look at this in more depth and convert to an AP func so we
can get rid of OS specific code.
*/
#if 0 #if 0
API_EXPORT(int) ap_call_exec(request_rec *r, ap_child_info_t *pinfo, char *argv0, API_EXPORT(int) ap_call_exec(request_rec *r, ap_child_info_t *pinfo, char *argv0,
char **env, int shellcmd) char **env, int shellcmd)

View File

@@ -167,9 +167,6 @@ void ap_init_vhost_config(ap_context_t *p)
static const char *get_addresses(ap_context_t *p, char *w, server_addr_rec ***paddr, static const char *get_addresses(ap_context_t *p, char *w, server_addr_rec ***paddr,
unsigned port) unsigned port)
{ {
/* ZZZ redesign to use AP funcs and types. Will see what I can do to make it
similar using posix std's. */
struct hostent *hep; struct hostent *hep;
unsigned long my_addr; unsigned long my_addr;
server_addr_rec *sar; server_addr_rec *sar;
@@ -424,7 +421,6 @@ static void dump_vhost_config(APRFile fd)
fprintf(f, "VirtualHost configuration:\n"); fprintf(f, "VirtualHost configuration:\n");
for (i = 0; i < IPHASH_TABLE_SIZE; ++i) { for (i = 0; i < IPHASH_TABLE_SIZE; ++i) {
for (ic = iphash_table[i]; ic; ic = ic->next) { for (ic = iphash_table[i]; ic; ic = ic->next) {
/* ZZZ should we change the Net addr to a string for this? */
if (ic->sar->host_port == 0) { if (ic->sar->host_port == 0) {
ap_snprintf(buf, sizeof(buf), "%pA:*", &ic->sar->host_addr); ap_snprintf(buf, sizeof(buf), "%pA:*", &ic->sar->host_addr);
} }
@@ -475,8 +471,6 @@ static void dump_vhost_config(APRFile fd)
/* compile the tables and such we need to do the run-time vhost lookups */ /* compile the tables and such we need to do the run-time vhost lookups */
void ap_fini_vhost_config(ap_context_t *p, server_rec *main_s) void ap_fini_vhost_config(ap_context_t *p, server_rec *main_s)
{ {
/* ZZZ need to redesign for use with AP funcs. will look into this later.
*/
server_addr_rec *sar; server_addr_rec *sar;
int has_default_vhost_addr; int has_default_vhost_addr;
server_rec *s; server_rec *s;
@@ -781,7 +775,6 @@ static void check_hostalias(request_rec *r)
* names we'll match have ports associated with them * names we'll match have ports associated with them
*/ */
const char *host = r->hostname; const char *host = r->hostname;
/* ZZZ use AP func here. */
unsigned port = ntohs(r->connection->local_addr.sin_port); unsigned port = ntohs(r->connection->local_addr.sin_port);
server_rec *s; server_rec *s;
server_rec *last_s; server_rec *last_s;