return NULL;
}
- ap_create_context(p, &sp);
+ ap_create_context(&sp, p);
while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) {
if ((l[0] == '#') || (!l[0]))
return NOT_FOUND;
}
- if (ap_open(r->pool, r->filename, APR_READ | APR_BUFFERED,
- APR_OS_DEFAULT, &f) != APR_SUCCESS) {
+ if (ap_open(&f, r->pool, r->filename, APR_READ | APR_BUFFERED,
+ APR_OS_DEFAULT) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
"file permissions deny server access: %s", r->filename);
return FORBIDDEN;
* the file's contents, any HTML header it had won't end up
* where it belongs.
*/
- if (ap_open(r->pool, rr->filename, APR_READ | APR_BUFFERED,
- APR_OS_DEFAULT, &f) == APR_SUCCESS) {
+ if (ap_open(&f, r->pool, rr->filename, APR_READ | APR_BUFFERED,
+ APR_OS_DEFAULT) == APR_SUCCESS) {
emit_preamble(r, title);
emit_amble = 0;
do_emit_plain(r, f);
/*
* If we can open the file, suppress the signature.
*/
- if (ap_open(r->pool, rr->filename, APR_READ | APR_BUFFERED,
- APR_OS_DEFAULT, &f) == APR_SUCCESS) {
+ if (ap_open(&f, r->pool, rr->filename, APR_READ | APR_BUFFERED,
+ APR_OS_DEFAULT) == APR_SUCCESS) {
do_emit_plain(r, f);
ap_close(f);
suppress_sig = 1;
"text/html")
|| !strcmp(r->content_type, INCLUDES_MAGIC_TYPE))
&& !r->content_encoding) {
- if (ap_open(r->pool, r->filename, APR_READ | APR_BUFFERED,
- APR_OS_DEFAULT, &thefile) != APR_SUCCESS) {
+ if (ap_open(&thefile, r->pool, r->filename, APR_READ | APR_BUFFERED,
+ APR_OS_DEFAULT) != APR_SUCCESS) {
return NULL;
}
n = sizeof(char) * (MAX_STRING_LEN - 1);
char *name_scratch;
char *pad_scratch;
- ap_create_context(r->pool, &scratch);
+ ap_create_context(&scratch, r->pool);
if (name[0] == '\0') {
name = "/";
}
char keyid;
char direction;
- if (ap_opendir(r->pool, name, &d) != APR_SUCCESS) {
+ if (ap_opendir(&d, r->pool, name) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
"Can't open directory for index: %s", r->filename);
return HTTP_FORBIDDEN;
head = NULL;
while (ap_readdir(d)) {
char *d_name;
- ap_get_dir_filename(d, &d_name);
+ ap_get_dir_filename(&d_name, d);
p = make_autoindex_entry(d_name, autoindex_opts,
autoindex_conf, r, keyid, direction);
if (p != NULL) {
elts = (void **)sec->elts;
/* we have to allocate tmp space to do a stable sort */
- ap_create_context(p, &tmp);
+ ap_create_context(&tmp, p);
sortbin = ap_palloc(tmp, sec->nelts * sizeof(*sortbin));
for (i = 0; i < nelts; ++i) {
sortbin[i].orig_index = i;
return METHOD_NOT_ALLOWED;
}
- if (ap_open (r->pool, r->filename, APR_READ | APR_BINARY, 0, &fd) != APR_SUCCESS) {
+ if (ap_open (&fd, r->pool, r->filename, APR_READ | APR_BINARY, 0) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
"file permissions deny server access: %s", r->filename);
return FORBIDDEN;
const char *expect;
int access_status;
- ap_create_context(conn->pool, &p);
+ ap_create_context(&p, conn->pool);
r = ap_pcalloc(p, sizeof(request_rec));
r->pool = p;
r->connection = conn;
ap_context_t *rrp;
request_rec *rr;
- ap_create_context(r->pool, &rrp);
+ ap_create_context(&rrp, r->pool);
rr = ap_pcalloc(rrp, sizeof(request_rec));
rr->pool = rrp;
return rr;
}
else {
const char *fname = ap_server_root_relative(p, cls->fname);
- if (ap_open(p, fname, xfer_flags, xfer_mode, &cls->log_fd) != APR_SUCCESS) {
+ if (ap_open(&cls->log_fd, p, fname, xfer_flags, xfer_mode) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, s,
"could not open transfer log file %s.", fname);
exit(1);
/* We are not using multiviews */
neg->count_multiviews_variants = 0;
- if (ap_open(neg->pool, rr->filename, APR_READ | APR_BUFFERED,
- APR_OS_DEFAULT, &map) != APR_SUCCESS) {
+ if (ap_open(&map, neg->pool, rr->filename, APR_READ | APR_BUFFERED,
+ APR_OS_DEFAULT) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
"cannot access type map file: %s", rr->filename);
return HTTP_FORBIDDEN;
++filp;
prefix_len = strlen(filp);
- if (ap_opendir(neg->pool, neg->dir_name, &dirp) != APR_SUCCESS) {
+ if (ap_opendir(&dirp, neg->pool, neg->dir_name) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
"cannot read directory for multi: %s", neg->dir_name);
return HTTP_FORBIDDEN;
request_rec *sub_req;
char *d_name;
- ap_get_dir_filename(dirp, &d_name);
+ ap_get_dir_filename(&d_name, dirp);
/* Do we have a match? */
if (strncmp(d_name, filp, prefix_len)) {
s->server_admin = DEFAULT_ADMIN;
s->server_hostname = NULL;
s->error_fname = DEFAULT_ERRORLOG;
- ap_put_os_file(p, &s->error_log, &errfile);
+ ap_put_os_file(&s->error_log, &errfile, p);
s->loglevel = DEFAULT_LOGLEVEL;
s->srm_confname = RESOURCE_CONFIG_FILE;
s->access_confname = ACCESS_CONFIG_FILE;
/* XXX - We need to deal with freeing this structure properly. */
new = malloc(sizeof(ap_listen_rec));
new->active = 0;
- if (ap_create_tcp_socket(NULL, &new->sd) != APR_SUCCESS) {
+ if (ap_create_tcp_socket(&new->sd, NULL) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, NULL,
"make_sock: failed to get a socket for %s", addr);
return;
}
dummyno = fileno(dummy);
- ap_put_os_file(p, &s->error_log, &dummyno);
+ ap_put_os_file(&s->error_log, &dummyno, p);
}
#ifdef HAVE_SYSLOG
else {
fname = ap_server_root_relative(p, s->error_fname);
/* Change to AP funcs. */
- if (ap_open(p, fname, APR_BUFFERED | APR_APPEND | APR_READ | APR_WRITE,
- APR_OS_DEFAULT, &s->error_log) != APR_SUCCESS) {
+ if (ap_open(&s->error_log, p, fname, APR_BUFFERED | APR_APPEND |
+ APR_READ | APR_WRITE, APR_OS_DEFAULT) != APR_SUCCESS) {
perror("fopen");
fprintf(stderr, "%s: could not open error log file %s.\n",
ap_server_argv0, fname);
if (((level & APLOG_LEVELMASK) != APLOG_NOTICE) &&
((level & APLOG_LEVELMASK) > DEFAULT_LOGLEVEL))
return;
- ap_put_os_file(NULL, &logf, &errfileno);
+ ap_put_os_file(&logf, &errfileno, NULL);
}
else if (s->error_log) {
/*
pl = ap_palloc(p, sizeof (*pl));
pl->p = p;
dummyno = fileno(dummy);
- ap_put_os_file(p, &pl->write_f, &dummyno);
+ ap_put_os_file(&pl->write_f, &dummyno, p);
return pl;
}
ap_util_init();
ap_util_uri_init();
- ap_create_context(NULL, &pglobal);
+ ap_create_context(&pglobal, NULL);
g_pHookPool=pglobal;
- ap_create_context(pglobal, &pcommands);
+ ap_create_context(&pcommands, pglobal);
ap_server_pre_read_config = ap_make_array(pcommands, 1, sizeof(char *));
ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *));
ap_server_config_defines = ap_make_array(pcommands, 1, sizeof(char *));
}
}
- ap_create_context(pglobal, &pconf);
- ap_create_context(pglobal, &plog);
- ap_create_context(pconf, &ptemp);
+ ap_create_context(&pconf, pglobal);
+ ap_create_context(&plog, pglobal);
+ ap_create_context(&ptemp, pconf);
/* for legacy reasons, we read the configuration twice before
we actually serve any requests */
for (;;) {
ap_clear_pool(pconf);
- ap_create_context(pconf, &ptemp);
+ ap_create_context(&ptemp, pconf);
ap_server_root = def_server_root;
ap_run_pre_config(pconf, plog, ptemp);
server_conf = ap_read_config(pconf, ptemp, confname);
int native_socket;
pthread_mutex_lock(&thread_pool_create_mutex);
- ap_create_context(thread_pool_parent, &tpool);
+ ap_create_context(&tpool, thread_pool_parent);
pthread_mutex_unlock(&thread_pool_create_mutex);
- ap_create_context(tpool, &ptrans);
+ ap_create_context(&ptrans, tpool);
while (!workers_may_exit) {
workers_may_exit |= (max_requests_per_child != 0) && (requests_this_child <= 0);
/* XXX: Should we check for POLLERR? */
if (listenfds[curr_pollfd].revents & POLLIN) {
last_pollfd = curr_pollfd;
- ap_put_os_sock(tpool, &sd, &listenfds[curr_pollfd].fd);
+ ap_put_os_sock(&sd, &listenfds[curr_pollfd].fd, tpool);
goto got_fd;
}
} while (curr_pollfd != last_pollfd);
}
got_fd:
if (!workers_may_exit) {
- ap_accept(sd, &csd);
+ ap_accept(&csd, sd);
SAFE_ACCEPT(accept_mutex_off(0));
SAFE_ACCEPT(intra_mutex_off(0));
pthread_mutex_lock(&idle_thread_count_mutex);
my_pid = getpid();
child_num = child_num_arg;
- ap_create_context(pconf, &pchild);
+ ap_create_context(&pchild, pconf);
/*stuff to do before we switch id's, so we have permissions.*/
for (i = 0; i < max_threads; i++) {
worker_thread_free_ids[i] = i;
}
- ap_create_context(pchild, &thread_pool_parent);
+ ap_create_context(&thread_pool_parent, pchild);
pthread_mutex_init(&thread_pool_create_mutex, NULL);
pthread_mutex_init(&idle_thread_count_mutex, NULL);
pthread_mutex_init(&worker_thread_count_mutex, NULL);
free(ti);
- ap_create_context(tpool, &ptrans);
+ ap_create_context(&ptrans, tpool);
pthread_mutex_lock(&worker_thread_count_mutex);
worker_thread_count++;
/* XXX: Should we check for POLLERR? */
if (listenfds[curr_pollfd].revents & POLLIN) {
last_pollfd = curr_pollfd;
- ap_put_os_sock(tpool, &sd, &listenfds[curr_pollfd].fd);
+ ap_put_os_sock(&sd, &listenfds[curr_pollfd].fd, tpool);
goto got_fd;
}
} while (curr_pollfd != last_pollfd);
}
got_fd:
if (!workers_may_exit) {
- ap_accept(sd, &csd);
+ ap_accept(&csd, sd);
SAFE_ACCEPT(accept_mutex_off(0));
SAFE_ACCEPT(intra_mutex_off(0));
}
ap_listen_rec *lr;
my_pid = getpid();
- ap_create_context(pconf, &pchild);
+ ap_create_context(&pchild, pconf);
/*stuff to do before we switch id's, so we have permissions.*/
reopen_scoreboard(pchild);
my_info->pid = my_child_num;
my_info->tid = i;
my_info->sd = 0;
- ap_create_context(pchild, &my_info->tpool);
+ ap_create_context(&my_info->tpool, pchild);
/* We are creating threads right now */
(void) ap_update_child_status(my_child_num, i, SERVER_STARTING,
unlock_it.l_pid = 0; /* pid not actually interesting */
expand_lock_fname(p);
- ap_open(p, ap_lock_fname, APR_CREATE | APR_WRITE | APR_EXCL,
- APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, &tempfile);
+ ap_open(&tempfile, p, ap_lock_fname, APR_CREATE | APR_WRITE | APR_EXCL,
+ APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD);
ap_get_os_file(tempfile, &lock_fd);
if (lock_fd == -1) {
perror("open");
{
ap_file_t *tempfile;
- ap_open(p, ap_lock_fname, APR_WRITE, APR_UREAD|APR_UWRITE, &tempfile);
+ ap_open(&tempfile, p, ap_lock_fname, APR_WRITE, APR_UREAD|APR_UWRITE);
if (!tempfile) {
ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
"Child cannot open lock file: %s", ap_lock_fname);
/* Get a sub ap_context_t for global allocations in this child, so that
* we can have cleanups occur when the child exits.
*/
- ap_create_context(pconf, &pchild);
+ ap_create_context(&pchild, pconf);
- ap_create_context(pchild, &ptrans);
+ ap_create_context(&ptrans, pchild);
/* needs to be done before we switch UIDs so we have permissions */
reopen_scoreboard(pchild);
clean_child_exit(0);
}
clen = sizeof(sa_client);
- stat = ap_accept(sd, &csd);
+ stat = ap_accept(&csd, sd);
if (stat == APR_SUCCESS || stat != APR_EINTR)
break;
}
result = FROM_UNKNOWN;
- if (ap_create_tcp_socket(conn->pool, &sock) != APR_SUCCESS) {
+ if (ap_create_tcp_socket(&sock, conn->pool) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, srv,
"socket: rfc1413: error creating socket");
conn->remote_logname = result;
return NULL;
}
- stat = ap_open(p, name, APR_READ | APR_BUFFERED, APR_OS_DEFAULT, &file);
+ stat = ap_open(&file, p, name, APR_READ | APR_BUFFERED, APR_OS_DEFAULT);
#ifdef DEBUG
saved_errno = errno;
ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL,
* since that is better than allowing errors to go unnoticed. Don't do
* this on Win32, though, since we haven't fork()'d.
*/
- ap_put_os_file(r->pool, &r->server->error_log, &errfileno);
+ ap_put_os_file(&r->server->error_log, &errfileno, r->pool);
#endif
/* TODO: all that RLimit stuff should become part of the spawning API,