#ifdef DAV_USE_GDBM
#include <gdbm.h>
#else
+
+/* ### need to APR-ize */
#include <fcntl.h> /* for O_RDONLY, O_WRONLY */
-#include "sdbm/sdbm.h"
+#include <sys/stat.h> /* for S_IRUSR, etc */
+/* ### ACK! fix this... */
+#include "../../../lib/sdbm/sdbm.h"
#endif
-#include "mod_dav.h"
-#include "dav_fs_repos.h"
+#include "../main/mod_dav.h"
+#include "repos.h"
#ifdef DAV_USE_GDBM
#endif
struct dav_db {
- pool *pool;
+ ap_pool_t *pool;
dav_dbm_file file;
};
#define D2G(d) (*(datum*)&(d))
-void dav_dbm_get_statefiles(pool *p, const char *fname,
+void dav_dbm_get_statefiles(ap_pool_t *p, const char *fname,
const char **state1, const char **state2)
{
char *work;
#endif
}
-static dav_error * dav_fs_dbm_error(dav_db *db, pool *p)
+static dav_error * dav_fs_dbm_error(dav_db *db, ap_pool_t *p)
{
int save_errno = errno;
int errcode;
/* ensure that our state subdirectory is present */
/* ### does this belong here or in dav_fs_repos.c ?? */
-void dav_fs_ensure_state_dir(pool * p, const char *dirname)
+void dav_fs_ensure_state_dir(ap_pool_t * p, const char *dirname)
{
const char *pathname = ap_pstrcat(p, dirname, "/" DAV_FS_STATE_DIR, NULL);
/* ### do we need to deal with the umask? */
/* just try to make it, ignoring any resulting errors */
- mkdir(pathname, DAV_FS_MODE_DIR);
+ (void) ap_make_dir(pathname, APR_OS_DEFAULT, p);
}
/* dav_dbm_open_direct: Opens a *dbm database specified by path.
* ro = boolean read-only flag.
*/
-dav_error * dav_dbm_open_direct(pool *p, const char *pathname, int ro,
+dav_error * dav_dbm_open_direct(ap_pool_t *p, const char *pathname, int ro,
dav_db **pdb)
{
dav_dbm_file file;
return NULL;
}
-static dav_error * dav_dbm_open(pool * p, const dav_resource *resource, int ro,
- dav_db **pdb)
+static dav_error * dav_dbm_open(ap_pool_t * p, const dav_resource *resource,
+ int ro, dav_db **pdb)
{
const char *dirpath;
const char *fname;
** DAV filesystem lock implementation
*/
+/* ### this stuff is temporary... need APR */
#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#ifndef O_BINARY
+#define O_BINARY (0)
+#endif
#include "httpd.h"
#include "http_log.h"
-#include "mod_dav.h"
-#include "dav_opaquelock.h"
-#include "dav_fs_repos.h"
+#include "../main/mod_dav.h"
+#include "../main/dav_opaquelock.h"
+#include "repos.h"
/* ---------------------------------------------------------------
/* ack. forward declare. */
-static dav_error * dav_fs_remove_locknull_member(pool *p,
+static dav_error * dav_fs_remove_locknull_member(ap_pool_t *p,
const char *filename,
dav_buffer *pbuf);
struct dav_lockdb_private
{
request_rec *r; /* for accessing the uuid state */
- pool *pool; /* a pool to use */
+ ap_pool_t *pool; /* a pool to use */
const char *lockdb_path; /* where is the lock database? */
int opened; /* we opened the database */
** Parse an opaquelocktoken URI into a locktoken.
*/
static dav_error * dav_fs_parse_locktoken(
- pool *p,
+ ap_pool_t *p,
const char *char_token,
dav_locktoken **locktoken_p)
{
** Generate the URI for a locktoken
*/
static const char *dav_fs_format_locktoken(
- pool *p,
+ ap_pool_t *p,
const dav_locktoken *locktoken)
{
const char *uuid_token = dav_format_opaquelocktoken(p, &locktoken->uuid);
**
** Given a pathname, build a DAV_TYPE_FNAME lock database key.
*/
-static dav_datum dav_fs_build_fname_key(pool *p, const char *pathname)
+static dav_datum dav_fs_build_fname_key(ap_pool_t *p, const char *pathname)
{
dav_datum key;
** (non-Win32 and file exists ):
** dav_datum->dvalue = inode, dev_major, dev_minor
*/
-static dav_datum dav_fs_build_key(pool *p, const dav_resource *resource)
+static dav_datum dav_fs_build_key(ap_pool_t *p, const dav_resource *resource)
{
const char *file = dav_fs_pathname(resource);
#ifndef WIN32
** dav_fs_load_locknull_list: Returns a dav_buffer dump of the locknull file
** for the given directory.
*/
-static dav_error * dav_fs_load_locknull_list(pool *p, const char *dirpath,
+static dav_error * dav_fs_load_locknull_list(ap_pool_t *p, const char *dirpath,
dav_buffer *pbuf)
{
struct stat finfo;
** dav_fs_save_locknull_list: Saves contents of pbuf into the
** locknull file for dirpath.
*/
-static dav_error * dav_fs_save_locknull_list(pool *p, const char *dirpath,
+static dav_error * dav_fs_save_locknull_list(ap_pool_t *p, const char *dirpath,
dav_buffer *pbuf)
{
const char *pathname;
** dav_fs_remove_locknull_member: Removes filename from the locknull list
** for directory path.
*/
-static dav_error * dav_fs_remove_locknull_member(pool *p, const char *filename,
+static dav_error * dav_fs_remove_locknull_member(ap_pool_t *p, const char *filename,
dav_buffer *pbuf)
{
dav_error *err;
const dav_resource *resource)
{
dav_buffer buf = { 0 };
- pool *p = lockdb->info->pool;
+ ap_pool_t *p = lockdb->info->pool;
const char *dirpath;
const char *fname;
dav_error *err;
{
dav_buffer buf = { 0 };
dav_error *err;
- pool *p = lockdb->info->pool;
+ ap_pool_t *p = lockdb->info->pool;
const char *pathname = dav_fs_pathname(resource);
if ((err = dav_fs_remove_locknull_member(p, pathname, &buf)) != NULL) {
int calltype,
dav_lock **locks)
{
- pool *p = lockdb->info->pool;
+ ap_pool_t *p = lockdb->info->pool;
dav_datum key;
dav_error *err;
dav_lock *lock = NULL;
int make_indirect,
const dav_lock *lock)
{
- pool *p = lockdb->info->pool;
+ ap_pool_t *p = lockdb->info->pool;
dav_error *err;
dav_lock_indirect *ip;
dav_lock_discovery *dp;
#include <string.h>
+/* ### this stuff is temporary... need APR */
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#ifndef O_BINARY
+#define O_BINARY (0)
+#endif
+
#include "httpd.h"
#include "http_log.h"
#include "http_protocol.h" /* for ap_set_* (in dav_fs_set_headers) */
#include "http_request.h" /* for ap_update_mtime() */
-#include "mod_dav.h"
-#include "dav_fs_repos.h"
+#include "../main/mod_dav.h"
+#include "repos.h"
/* to assist in debugging mod_dav's GET handling */
/* context needed to identify a resource */
struct dav_resource_private {
- pool *pool; /* memory storage pool associated with request */
+ ap_pool_t *pool; /* memory storage pool associated with request */
const char *pathname; /* full pathname to resource */
- struct stat finfo; /* filesystem info */
+ ap_finfo_t finfo; /* filesystem info */
};
/* private context for doing a filesystem walk */
/* define the dav_stream structure for our use */
struct dav_stream {
- pool *p;
+ ap_pool_t *p;
int fd;
const char *pathname; /* we may need to remove it at close time */
};
**
** PRIVATE REPOSITORY FUNCTIONS
*/
-pool *dav_fs_pool(const dav_resource *resource)
+ap_pool_t *dav_fs_pool(const dav_resource *resource)
{
return resource->info->pool;
}
static dav_error * dav_fs_copymove_file(
int is_move,
- pool * p,
+ ap_pool_t * p,
const char *src,
const char *dst,
dav_buffer *pbuf)
/* ### need more buffers to replace the pool argument */
static dav_error * dav_fs_copymove_state(
int is_move,
- pool * p,
+ ap_pool_t * p,
const char *src_dir, const char *src_file,
const char *dst_dir, const char *dst_file,
dav_buffer *pbuf)
{
- struct stat src_finfo; /* finfo for source file */
- struct stat dst_state_finfo; /* finfo for STATE directory */
+ ap_finfo_t src_finfo; /* finfo for source file */
+ ap_finfo_t dst_state_finfo; /* finfo for STATE directory */
const char *src;
const char *dst;
src = ap_pstrcat(p, src_dir, "/" DAV_FS_STATE_DIR "/", src_file, NULL);
/* the source file doesn't exist */
- if (stat(src, &src_finfo) != 0) {
+ if (ap_stat(&src_finfo, src, p) != 0) {
return NULL;
}
}
/* get info about the state directory */
- if (stat(dst, &dst_state_finfo) != 0) {
+ if (ap_stat(&dst_state_finfo, dst, p) != 0) {
/* Ack! Where'd it go? */
/* ### use something besides 500? */
return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
}
/* The mkdir() may have failed because a *file* exists there already */
- if (!S_ISDIR(dst_state_finfo.st_mode)) {
+ if (dst_state_finfo.filetype != APR_DIR) {
/* ### try to recover by deleting this file? (and mkdir again) */
/* ### use something besides 500? */
return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
dst = ap_pstrcat(p, dst, "/", dst_file, NULL);
/* copy/move the file now */
+#if 0
+ /* ### need st_dev from APR */
+
if (is_move && src_finfo.st_dev == dst_state_finfo.st_dev) {
/* simple rename is possible since it is on the same device */
if (rename(src, dst) != 0) {
"Could not move state file.");
}
}
- else {
+ else
+#endif
+ {
/* gotta copy (and delete) */
return dav_fs_copymove_file(is_move, p, src, dst, pbuf);
}
return NULL;
}
-static dav_error *dav_fs_copymoveset(int is_move, pool *p,
+static dav_error *dav_fs_copymoveset(int is_move, ap_pool_t *p,
const dav_resource *src,
const dav_resource *dst,
dav_buffer *pbuf)
return err;
}
-static dav_error *dav_fs_deleteset(pool *p, const dav_resource *resource)
+static dav_error *dav_fs_deleteset(ap_pool_t *p, const dav_resource *resource)
{
const char *dirpath;
const char *fname;
ctx->finfo = r->finfo;
/* Preserve case on OSes which fold canonical filenames */
-#if MODULE_MAGIC_NUMBER_MAJOR > 19990320 || (MODULE_MAGIC_NUMBER_MAJOR == 19990320 && MODULE_MAGIC_NUMBER_MINOR >= 8)
+#if 0
+ /* ### not available in Apache 2.0 yet */
filename = r->case_preserved_filename;
#else
filename = r->filename;
resource->uri = r->uri;
}
- if (r->finfo.st_mode != 0) {
+ if (r->finfo.protection != 0) {
resource->exists = 1;
- resource->collection = S_ISDIR(r->finfo.st_mode);
+ resource->collection = r->finfo.filetype == APR_DIR;
/* unused info in the URL will indicate a null resource */
/* retain proper integrity across the structures */
if (!resource->exists) {
- ctx->finfo.st_mode = 0;
+ ctx->finfo.protection = 0;
}
}
}
parent_resource->uri = uri;
}
- if (stat(parent_ctx->pathname, &parent_ctx->finfo) == 0) {
+ if (ap_stat(&parent_ctx->finfo, parent_ctx->pathname, ctx->pool) == 0) {
parent_resource->exists = 1;
}
#ifdef WIN32
return stricmp(ctx1->pathname, ctx2->pathname) == 0;
#else
- if (ctx1->finfo.st_mode != 0)
- return ctx1->finfo.st_ino == ctx2->finfo.st_ino;
+ if (ctx1->finfo.protection != 0)
+ return ctx1->finfo.inode == ctx2->finfo.inode;
else
return strcmp(ctx1->pathname, ctx2->pathname) == 0;
#endif
dav_stream_mode mode,
dav_stream **stream)
{
- pool *p = resource->info->pool;
+ ap_pool_t *p = resource->info->pool;
dav_stream *ds = ap_palloc(p, sizeof(*ds));
int flags;
return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
"An error occurred while opening a resource.");
}
+
+ /* ### need to fix this */
+#if 0
ap_note_cleanups_for_fd(p, ds->fd);
+#endif
*stream = ds;
return NULL;
static dav_error * dav_fs_close_stream(dav_stream *stream, int commit)
{
+ /* ### need to fix this */
+#if 0
ap_kill_cleanups_for_fd(stream->p, stream->fd);
+#endif
close(stream->fd);
if (!commit) {
return NULL;
/* make sure the proper mtime is in the request record */
- ap_update_mtime(r, resource->info->finfo.st_mtime);
+ ap_update_mtime(r, resource->info->finfo.mtime);
/* ### note that these use r->filename rather than <resource> */
ap_set_last_modified(r);
ap_table_setn(r->headers_out, "Accept-Ranges", "bytes");
/* set up the Content-Length header */
- ap_set_content_length(r, resource->info->finfo.st_size);
+ ap_set_content_length(r, resource->info->finfo.size);
/* ### how to set the content type? */
/* ### until this is resolved, the Content-Type header is busted */
/* nothing to free ... */
}
-static dav_error * dav_fs_create_collection(pool *p, dav_resource *resource)
+static dav_error * dav_fs_create_collection(ap_pool_t *p, dav_resource *resource)
{
dav_resource_private *ctx = resource->info;
}
#endif
+#if 0
+ /* ### we need st_dev in ap_finfo_t */
+
/* determine whether a simple rename will work.
* Assume source exists, else we wouldn't get called.
*/
if (dstinfo->finfo.st_mode != 0) {
+ /* ### APR does not expose the st_dev concept! */
if (dstinfo->finfo.st_dev == srcinfo->finfo.st_dev) {
/* target exists and is on the same device. */
can_rename = 1;
can_rename = 1;
}
}
+#endif
/* if we can't simply renamed, then do it the hard way... */
if (!can_rename) {
dav_buffer_place_mem(wctx->pool,
&fsctx->path1, ep->d_name, len + 1, 0);
- if (lstat(fsctx->path1.buf, &fsctx->info1.finfo) != 0) {
+ if (ap_lstat(&fsctx->info1.finfo, fsctx->path1.buf, wctx->pool) != 0) {
/* woah! where'd it go? */
/* ### should have a better error here */
err = dav_new_error(wctx->pool, HTTP_NOT_FOUND, 0, NULL);
fsctx->res1.uri = wctx->uri.buf;
/* ### for now, only process regular files (e.g. skip symlinks) */
- if (S_ISREG(fsctx->info1.finfo.st_mode)) {
+ if (fsctx->info1.finfo.filetype == APR_REG) {
/* call the function for the specified dir + file */
if ((err = (*wctx->func)(wctx, DAV_CALLTYPE_MEMBER)) != NULL) {
/* ### maybe add a higher-level description? */
break;
}
}
- else if (S_ISDIR(fsctx->info1.finfo.st_mode)) {
+ else if (fsctx->info1.finfo.filetype == APR_DIR) {
size_t save_path_len = fsctx->path1.cur_len;
size_t save_uri_len = wctx->uri.cur_len;
size_t save_path2_len = fsctx->path2.cur_len;
if (!resource->exists)
return ap_pstrdup(ctx->pool, "");
- if (ctx->finfo.st_mode != 0) {
+ if (ctx->finfo.protection != 0) {
return ap_psprintf(ctx->pool, "\"%lx-%lx-%lx\"",
- (unsigned long) ctx->finfo.st_ino,
- (unsigned long) ctx->finfo.st_size,
- (unsigned long) ctx->finfo.st_mtime);
+ (unsigned long) ctx->finfo.inode,
+ (unsigned long) ctx->finfo.size,
+ (unsigned long) ctx->finfo.mtime);
}
- return ap_psprintf(ctx->pool, "\"%lx\"", (unsigned long) ctx->finfo.st_mtime);
+ return ap_psprintf(ctx->pool, "\"%lx\"", (unsigned long) ctx->finfo.mtime);
}
static const dav_hooks_repository dav_hooks_repository_fs =
const char *value;
const char *s;
dav_prop_insert which;
- pool *p = resource->info->pool;
+ ap_pool_t *p = resource->info->pool;
const dav_fs_liveprop_name *scan;
int ns;
** create the file), then we should be pretty safe here.
*/
dav_format_time(DAV_STYLE_ISO8601,
- resource->info->finfo.st_ctime,
+ resource->info->finfo.ctime,
buf);
value = buf;
break;
if (resource->collection)
return DAV_PROP_INSERT_NOTDEF;
- (void) sprintf(buf, "%ld", resource->info->finfo.st_size);
+ (void) sprintf(buf, "%ld", resource->info->finfo.size);
value = buf;
break;
case DAV_PROPID_FS_getlastmodified:
dav_format_time(DAV_STYLE_RFC822,
- resource->info->finfo.st_mtime,
+ resource->info->finfo.mtime,
buf);
value = buf;
break;
return DAV_PROP_INSERT_NOTDEF;
/* the files are "ours" so we only need to check owner exec privs */
- if (resource->info->finfo.st_mode & DAV_FS_MODE_XUSR)
+ if (resource->info->finfo.protection & APR_UEXECUTE)
value = "T";
else
value = "F";
dav_liveprop_rollback **rollback_ctx)
{
int value = context != NULL;
- mode_t mode = resource->info->finfo.st_mode;
- int old_value = (resource->info->finfo.st_mode & DAV_FS_MODE_XUSR) != 0;
+ ap_fileperms_t perms = resource->info->finfo.protection;
+ int old_value = (perms & APR_UEXECUTE) != 0;
/* assert: prop == executable. operation == SET. */
if (value == old_value)
return NULL;
- mode &= ~DAV_FS_MODE_XUSR;
+ perms &= ~APR_UEXECUTE;
if (value)
- mode |= DAV_FS_MODE_XUSR;
+ perms |= APR_UEXECUTE;
+#if 0
+ /* ### crap... APR does not have a chmod() ... skip for now. */
if (chmod(resource->info->pathname, mode) == -1) {
return dav_new_error(resource->info->pool,
HTTP_INTERNAL_SERVER_ERROR, 0,
"Could not set the executable flag of the "
"target resource.");
}
+#endif
/* update the resource and set up the rollback context */
- resource->info->finfo.st_mode = mode;
+ resource->info->finfo.protection = perms;
*rollback_ctx = (dav_liveprop_rollback *)old_value;
return NULL;
void *context,
dav_liveprop_rollback *rollback_ctx)
{
- mode_t mode = resource->info->finfo.st_mode & ~DAV_FS_MODE_XUSR;
+ ap_fileperms_t perms = resource->info->finfo.protection & ~APR_UEXECUTE;
int value = rollback_ctx != NULL;
/* assert: prop == executable. operation == SET. */
/* restore the executable bit */
if (value)
- mode |= DAV_FS_MODE_XUSR;
+ perms |= APR_UEXECUTE;
+#if 0
+ /* ### crap... APR does not have a chmod() ... skip for now. */
if (chmod(resource->info->pathname, mode) == -1) {
return dav_new_error(resource->info->pool,
HTTP_INTERNAL_SERVER_ERROR, 0,
"After a failure occurred, the resource's "
"executable flag could not be restored.");
}
+#endif
/* restore the resource's state */
- resource->info->finfo.st_mode = mode;
+ resource->info->finfo.protection = perms;
return NULL;
}
#endif /* WIN32 */
/* ensure that our state subdirectory is present */
-void dav_fs_ensure_state_dir(pool *p, const char *dirname);
+void dav_fs_ensure_state_dir(ap_pool_t *p, const char *dirname);
/* return the storage pool associated with a resource */
-pool *dav_fs_pool(const dav_resource *resource);
+ap_pool_t *dav_fs_pool(const dav_resource *resource);
/* return the full pathname for a resource */
const char *dav_fs_pathname(const dav_resource *resource);
/* DBM functions used by the repository and locking providers */
extern const dav_hooks_db dav_hooks_db_dbm;
-dav_error * dav_dbm_open_direct(pool *p, const char *pathname, int ro,
+dav_error * dav_dbm_open_direct(ap_pool_t *p, const char *pathname, int ro,
dav_db **pdb);
-void dav_dbm_get_statefiles(pool *p, const char *fname,
+void dav_dbm_get_statefiles(ap_pool_t *p, const char *fname,
const char **state1, const char **state2);
int allow_depthinfinity;
long limit_xml_body;
- table *d_params; /* per-directory DAV config parameters */
+ ap_table_t *d_params; /* per-directory DAV config parameters */
struct dav_dyn_mod_ctx *dmc;
dav_dyn_hooks propdb;
extern module MODULE_VAR_EXPORT dav_module;
/* copy a module's providers into our per-directory configuration state */
-static void dav_copy_providers(pool *p, const char *name, dav_dir_conf *conf)
+static void dav_copy_providers(ap_pool_t *p, const char *name, dav_dir_conf *conf)
{
const dav_dyn_module *mod;
const dav_dyn_provider *provider;
}
}
-static void dav_init_handler(server_rec *s, pool *p)
+static void dav_init_handler(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp,
+ server_rec *s)
{
/* DBG0("dav_init_handler"); */
- ap_add_version_component("DAV/" DAV_VERSION);
+ ap_add_version_component(p, "DAV/" DAV_VERSION);
dav_process_builtin_modules(p);
}
-static void *dav_create_server_config(pool *p, server_rec *s)
+static void *dav_create_server_config(ap_pool_t *p, server_rec *s)
{
dav_server_conf *newconf;
return newconf;
}
-static void *dav_merge_server_config(pool *p, void *base, void *overrides)
+static void *dav_merge_server_config(ap_pool_t *p, void *base, void *overrides)
{
dav_server_conf *parent = base;
dav_server_conf *child = overrides;
return newconf;
}
-static void *dav_create_dir_config(pool *p, char *dir)
+static void *dav_create_dir_config(ap_pool_t *p, char *dir)
{
/* NOTE: dir==NULL creates the default per-dir config */
return conf;
}
-static void *dav_merge_dir_config(pool *p, void *base, void *overrides)
+static void *dav_merge_dir_config(ap_pool_t *p, void *base, void *overrides)
{
dav_dir_conf *parent = base;
dav_dir_conf *child = overrides;
return conf->lockdb_path;
}
-table *dav_get_dir_params(const request_rec *r)
+ap_table_t *dav_get_dir_params(const request_rec *r)
{
dav_dir_conf *conf;
/* begin the response now... */
ap_send_http_header(r);
- /* ### hard or soft? */
- ap_soft_timeout("send error body", r);
-
ap_rvputs(r,
DAV_RESPONSE_BODY_1,
r->status_line,
ap_rputs(ap_psignature("\n<P><HR>\n", r), r);
ap_rputs(DAV_RESPONSE_BODY_4, r);
- ap_kill_timeout(r);
-
/* the response has been sent. */
/*
* ### Use of DONE obviates logging..!
** in a URI (to form a query section). We must explicitly handle it so that
** we can embed the URI into an XML document.
*/
-static const char *dav_xml_escape_uri(pool *p, const char *uri)
+static const char *dav_xml_escape_uri(ap_pool_t *p, const char *uri)
{
const char *e_uri = ap_escape_uri(p, uri);
static void dav_send_multistatus(request_rec *r, int status,
dav_response *first,
- array_header *namespaces)
+ ap_array_header_t *namespaces)
{
/* Set the correct status and Content-Type */
r->status = status;
/* Send all of the headers now */
ap_send_http_header(r);
- /* Start a timeout for delivering the response. */
- ap_soft_timeout("sending multistatus response", r);
-
/* Send the actual multistatus response now... */
ap_rputs(DAV_XML_HEADER DEBUG_CR
"<D:multistatus xmlns:D=\"DAV:\"", r);
}
ap_rputs("</D:multistatus>" DEBUG_CR, r);
-
- /* Done with sending and the timeout. */
- ap_kill_timeout(r);
}
/*
continue;
if (errscan->save_errno != 0) {
errno = errscan->save_errno;
- ap_log_rerror(APLOG_MARK, level, r, "%s [%d, #%d]",
+ ap_log_rerror(APLOG_MARK, level, errno, r, "%s [%d, #%d]",
errscan->desc, errscan->status, errscan->error_id);
}
else {
- ap_log_rerror(APLOG_MARK, level | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, level | APLOG_NOERRNO, 0, r,
"%s [%d, #%d]",
errscan->desc, errscan->status, errscan->error_id);
}
/* The caller will return an HTTP_BAD_REQUEST. This will augment the
* default message that Apache provides. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"An invalid Depth header was specified.");
return -1;
}
/* The caller will return an HTTP_BAD_REQUEST. This will augment the
* default message that Apache provides. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"An invalid Overwrite header was specified.");
return -1;
}
repos_hooks = DAV_AS_HOOKS_REPOSITORY(&conf->repository);
if (repos_hooks == NULL || repos_hooks->get_resource == NULL) {
/* ### this should happen at startup rather than per-request */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"No %s has been configured.",
repos_hooks == NULL
? "repository module"
/* all set. send the headers now. */
ap_send_http_header(r);
- /* start a timeout for delivering the response. */
- ap_soft_timeout("sending GET response", r);
-
buffer = ap_palloc(r->pool, DAV_READ_BLOCKSIZE);
while (1) {
size_t amt;
if (range_start > range_end)
break;
}
-
- /* reset the timeout after a successful write */
- ap_reset_timeout(r);
}
- /* Done with the request; clear its timeout */
- ap_kill_timeout(r);
-
if (err != NULL)
return dav_handle_err(r, err, NULL);
if (resource->collection && depth != DAV_INFINITY) {
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"Depth must be \"infinity\" for DELETE of a collection.");
return HTTP_BAD_REQUEST;
}
if (!resource->collection && depth == 1) {
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"Depth of \"1\" is not allowed for DELETE.");
return HTTP_BAD_REQUEST;
}
if (doc && !dav_validate_root(doc, "propfind")) {
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"The \"propfind\" element was not found.");
return HTTP_BAD_REQUEST;
}
/* "propfind" element must have one of the above three children */
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"The \"propfind\" element does not contain one of "
"the required child elements (the specific command).");
return HTTP_BAD_REQUEST;
return DONE;
}
-static dav_text * dav_failed_proppatch(pool *p, array_header *prop_ctx)
+static dav_text * dav_failed_proppatch(ap_pool_t *p,
+ ap_array_header_t *prop_ctx)
{
dav_text_header hdr = { 0 };
int i = prop_ctx->nelts;
return hdr.first;
}
-static dav_text * dav_success_proppatch(pool *p, array_header *prop_ctx)
+static dav_text * dav_success_proppatch(ap_pool_t *p, ap_array_header_t *prop_ctx)
{
dav_text_header hdr = { 0 };
int i = prop_ctx->nelts;
** reverse order.
*/
static int dav_process_ctx_list(void (*func)(dav_prop_ctx *ctx),
- array_header *ctx_list, int stop_on_error,
+ ap_array_header_t *ctx_list, int stop_on_error,
int reverse)
{
int i = ctx_list->nelts;
int failure = 0;
dav_response resp = { 0 };
dav_text *propstat_text;
- array_header *ctx_list;
+ ap_array_header_t *ctx_list;
dav_prop_ctx *ctx;
/* Ask repository module to resolve the resource */
if (doc == NULL || !dav_validate_root(doc, "propertyupdate")) {
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"The request body does not contain "
"a \"propertyupdate\" element.");
return HTTP_BAD_REQUEST;
dav_close_propdb(propdb);
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"A \"prop\" element is missing inside "
"the propertyupdate command.");
return HTTP_BAD_REQUEST;
if (tenc) {
if (strcasecmp(tenc, "chunked")) {
/* Use this instead of Apache's default error string */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"Unknown Transfer-Encoding %s", tenc);
return HTTP_NOT_IMPLEMENTED;
}
}
if (*pos != '\0') {
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"Invalid Content-Length %s", lenp);
return HTTP_BAD_REQUEST;
}
}
if (dest == NULL) {
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"The request is missing a Destination header.");
return HTTP_BAD_REQUEST;
}
if (lookup.rnew == NULL) {
if (lookup.err.status == HTTP_BAD_REQUEST) {
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
lookup.err.desc);
return HTTP_BAD_REQUEST;
}
}
if (depth == 1) {
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"Depth must be \"0\" or \"infinity\" for COPY or MOVE.");
return HTTP_BAD_REQUEST;
}
if (is_move && is_dir && depth != DAV_INFINITY) {
/* This supplies additional information for the default message. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"Depth must be \"infinity\" when moving a collection.");
return HTTP_BAD_REQUEST;
}
depth = dav_get_depth(r, DAV_INFINITY);
if (depth != 0 && depth != DAV_INFINITY) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"Depth must be 0 or \"infinity\" for LOCK.");
return HTTP_BAD_REQUEST;
}
}
new_lock_request = 1;
- lock->auth_user = ap_pstrdup(r->pool, r->connection->user);
+ lock->auth_user = ap_pstrdup(r->pool, r->user);
}
resource_state = dav_get_resource_state(r, resource);
r->content_type = DAV_XML_CONTENT_TYPE;
ap_send_http_header(r);
- ap_soft_timeout("send LOCK response", r);
ap_rputs(DAV_XML_HEADER DEBUG_CR "<D:prop xmlns:D=\"DAV:\">" DEBUG_CR, r);
if (lock == NULL)
}
ap_rputs("</D:prop>", r);
- ap_kill_timeout(r);
-
/* the response has been sent. */
return DONE;
return DECLINED;
if ((const_locktoken_txt = ap_table_get(r->headers_in, "Lock-Token")) == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"Unlock failed (%s): No Lock-Token specified in header", r->filename);
return HTTP_BAD_REQUEST;
}
return DECLINED;
}
+static void register_hooks(void)
+{
+ ap_hook_post_config(dav_init_handler, NULL, NULL, AP_HOOK_MIDDLE);
+ ap_hook_type_checker(dav_type_checker, NULL, NULL, AP_HOOK_MIDDLE);
+}
/*---------------------------------------------------------------------------
**
module MODULE_VAR_EXPORT dav_module =
{
- STANDARD_MODULE_STUFF,
- dav_init_handler, /* initializer */
+ STANDARD20_MODULE_STUFF,
dav_create_dir_config, /* dir config creater */
dav_merge_dir_config, /* dir merger --- default is to override */
dav_create_server_config, /* server config */
dav_merge_server_config, /* merge server config */
dav_cmds, /* command table */
dav_handlers, /* handlers */
- NULL, /* filename translation */
- NULL, /* check_user_id */
- NULL, /* check auth */
- NULL, /* check access */
- dav_type_checker, /* type_checker */
- NULL, /* fixups */
- NULL, /* logger */
- NULL, /* header parser */
- NULL, /* child_init */
- NULL, /* child_exit */
- NULL /* post read-request */
+ register_hooks, /* register hooks */
};
struct dav_error *prev; /* previous error (in stack) */
/* deferred computation of the description */
- void (*compute_desc)(struct dav_error *err, pool *p);
+ void (*compute_desc)(struct dav_error *err, ap_pool_t *p);
int ctx_i;
const char *ctx_s;
void *ctx_p;
** Create a new error structure. save_errno will be filled with the current
** errno value.
*/
-dav_error *dav_new_error(pool *p, int status, int error_id, const char *desc);
+dav_error *dav_new_error(ap_pool_t *p, int status, int error_id, const char *desc);
/*
** Push a new error description onto the stack of errors.
** <error_id> can specify a new error_id since the topmost description has
** changed.
*/
-dav_error *dav_push_error(pool *p, int status, int error_id, const char *desc,
+dav_error *dav_push_error(ap_pool_t *p, int status, int error_id, const char *desc,
dav_error *prev);
#define DAV_BUFFER_PAD 64 /* amount of pad when growing */
/* set the cur_len to the given size and ensure space is available */
-void dav_set_bufsize(pool *p, dav_buffer *pbuf, size_t size);
+void dav_set_bufsize(ap_pool_t *p, dav_buffer *pbuf, size_t size);
/* initialize a buffer and copy the specified (null-term'd) string into it */
-void dav_buffer_init(pool *p, dav_buffer *pbuf, const char *str);
+void dav_buffer_init(ap_pool_t *p, dav_buffer *pbuf, const char *str);
/* check that the buffer can accomodate <extra_needed> more bytes */
-void dav_check_bufsize(pool *p, dav_buffer *pbuf, size_t extra_needed);
+void dav_check_bufsize(ap_pool_t *p, dav_buffer *pbuf, size_t extra_needed);
/* append a string to the end of the buffer, adjust length */
-void dav_buffer_append(pool *p, dav_buffer *pbuf, const char *str);
+void dav_buffer_append(ap_pool_t *p, dav_buffer *pbuf, const char *str);
/* place a string on the end of the buffer, do NOT adjust length */
-void dav_buffer_place(pool *p, dav_buffer *pbuf, const char *str);
+void dav_buffer_place(ap_pool_t *p, dav_buffer *pbuf, const char *str);
/* place some memory on the end of a buffer; do NOT adjust length */
-void dav_buffer_place_mem(pool *p, dav_buffer *pbuf, const void *mem,
+void dav_buffer_place_mem(ap_pool_t *p, dav_buffer *pbuf, const void *mem,
size_t amt, size_t pad);
} dav_lookup_result;
-void dav_text_append(pool *p, dav_text_header *hdr, const char *text);
+void dav_text_append(ap_pool_t *p, dav_text_header *hdr, const char *text);
dav_lookup_result dav_lookup_uri(const char *uri, request_rec *r);
void *m_context; /* module-level context (i.e. managed globals) */
void *d_context; /* per-directory context */
- table *d_params; /* per-directory DAV config parameters */
+ ap_table_t *d_params; /* per-directory DAV config parameters */
int *ns_map; /* for LIVEPROP, map provider URI to global URI */
**
** NOTE: the pool should be the "configuration pool"
*/
-void dav_process_builtin_modules(pool *p);
-void dav_process_module(pool *p, const dav_dyn_module *mod);
+void dav_process_builtin_modules(ap_pool_t *p);
+void dav_process_module(ap_pool_t *p, const dav_dyn_module *mod);
-int * dav_collect_liveprop_uris(pool *p, const dav_hooks_liveprop *hooks);
-extern array_header *dav_liveprop_uris;
+int * dav_collect_liveprop_uris(ap_pool_t *p, const dav_hooks_liveprop *hooks);
+extern ap_array_header_t *dav_liveprop_uris;
-void *dav_prepare_scan(pool *p, const dav_dyn_module *mod);
+void *dav_prepare_scan(ap_pool_t *p, const dav_dyn_module *mod);
int dav_scan_providers(void *ctx,
const dav_dyn_provider **provider,
dav_dyn_hooks *output);
typedef struct dav_xml_doc
{
- dav_xml_elem *root; /* root element */
- array_header *namespaces; /* array of namespaces used */
+ dav_xml_elem *root; /* root element */
+ ap_array_header_t *namespaces; /* array of namespaces used */
} dav_xml_doc;
const char *tagname);
void dav_xml2text(
- pool *p,
+ ap_pool_t *p,
const dav_xml_elem *elem,
int style,
- array_header *namespaces,
+ ap_array_header_t *namespaces,
int *ns_map,
const char **pbuf,
size_t *psize
#define DAV_X2T_LANG_INNER 2 /* xml:lang + inner contents */
#define DAV_X2T_FULL_NS_LANG 3 /* FULL + ns defns + xml:lang */
-const char *dav_empty_elem(pool *p, const dav_xml_elem *elem);
-void dav_quote_xml_elem(pool *p, dav_xml_elem *elem);
-const char * dav_quote_string(pool *p, const char *s, int quotes);
+const char *dav_empty_elem(ap_pool_t *p, const dav_xml_elem *elem);
+void dav_quote_xml_elem(ap_pool_t *p, dav_xml_elem *elem);
+const char * dav_quote_string(ap_pool_t *p, const char *s, int quotes);
/* --------------------------------------------------------------------
/* hook functions to enable pluggable databases */
struct dav_hooks_db
{
- dav_error * (*open)(pool *p, const dav_resource *resource, int ro,
+ dav_error * (*open)(ap_pool_t *p, const dav_resource *resource, int ro,
dav_db **pdb);
void (*close)(dav_db *db);
* in the given pool.
*/
dav_error * (*parse_locktoken)(
- pool *p,
+ ap_pool_t *p,
const char *char_token,
dav_locktoken **locktoken_p
);
* Always returns non-NULL.
*/
const char * (*format_locktoken)(
- pool *p,
+ ap_pool_t *p,
const dav_locktoken *locktoken
);
dav_lockdb *lockdb,
dav_resource *resource,
int ro,
- array_header *ns_xlate,
+ ap_array_header_t *ns_xlate,
dav_propdb **propdb);
void dav_close_propdb(dav_propdb *db);
#define DAV_CALLTYPE_LOCKNULL 3 /* called for a locknull resource */
#define DAV_CALLTYPE_POSTFIX 4 /* postfix call for a collection */
- struct pool *pool;
+ ap_pool_t *pool;
request_rec *r; /* original request */
dav_buffer uri; /* current URI */
* is a collection.
*/
dav_error * (*create_collection)(
- pool *p, dav_resource *resource
+ ap_pool_t *p, dav_resource *resource
);
/* Copy one resource to another. The destination must not exist.
*/
/* allow providers access to the per-directory parameters */
-table *dav_get_dir_params(const request_rec *r);
+ap_table_t *dav_get_dir_params(const request_rec *r);
/* fetch the "LimitXMLRequestBody" in force for this resource */
size_t dav_get_limit_xml_body(const request_rec *r);
/* manage an array of unique URIs: dav_insert_uri() and DAV_GET_URI_ITEM() */
/* return the URI's (existing) index, or insert it and return a new index */
-int dav_insert_uri(array_header *uri_array, const char *uri);
+int dav_insert_uri(ap_array_header_t *uri_array, const char *uri);
#define DAV_GET_URI_ITEM(ary, i) (((const char * const *)(ary)->elts)[i])
struct dav_propdb {
int version; /* *minor* version of this db */
- pool *p; /* the pool we should use */
+ ap_pool_t *p; /* the pool we should use */
request_rec *r; /* the request record */
dav_resource *resource; /* the target resource */
short ns_count; /* number of entries in table */
int ns_table_dirty; /* ns_table was modified */
- array_header *ns_xlate; /* translation of an elem->ns to URI */
+ ap_array_header_t *ns_xlate; /* translation of an elem->ns to URI */
int *ns_map; /* map elem->ns to propdb ns values */
int incomplete_map; /* some mappings do not exist */
return -1;
}
-static void dav_insert_xmlns(pool *p, const char *pre_prefix, int ns,
+static void dav_insert_xmlns(ap_pool_t *p, const char *pre_prefix, int ns,
const char *ns_uri, dav_text_header *phdr)
{
const char *s;
/* add a namespace decl from one of the namespace tables */
static void dav_add_marked_xmlns(dav_propdb *propdb, char *marks, int ns,
- array_header *ns_table,
+ ap_array_header_t *ns_table,
const char *pre_prefix,
dav_text_header *phdr)
{
dav_error *dav_open_propdb(request_rec *r, dav_lockdb *lockdb,
dav_resource *resource,
int ro,
- array_header * ns_xlate,
+ ap_array_header_t * ns_xlate,
dav_propdb **p_propdb)
{
dav_propdb *propdb = ap_pcalloc(r->pool, sizeof(*propdb));
#include "http_protocol.h"
-dav_error *dav_new_error(pool *p, int status, int error_id, const char *desc)
+dav_error *dav_new_error(ap_pool_t *p, int status, int error_id, const char *desc)
{
int save_errno = errno;
dav_error *err = ap_pcalloc(p, sizeof(*err));
return err;
}
-dav_error *dav_push_error(pool *p, int status, int error_id, const char *desc,
+dav_error *dav_push_error(ap_pool_t *p, int status, int error_id, const char *desc,
dav_error *prev)
{
dav_error *err = ap_pcalloc(p, sizeof(*err));
return err;
}
-void dav_text_append(pool * p, dav_text_header *hdr, const char *text)
+void dav_text_append(ap_pool_t * p, dav_text_header *hdr, const char *text)
{
dav_text *t = ap_palloc(p, sizeof(*t));
}
}
-void dav_check_bufsize(pool * p, dav_buffer *pbuf, size_t extra_needed)
+void dav_check_bufsize(ap_pool_t * p, dav_buffer *pbuf, size_t extra_needed)
{
/* grow the buffer if necessary */
if (pbuf->cur_len + extra_needed > pbuf->alloc_len) {
}
}
-void dav_set_bufsize(pool * p, dav_buffer *pbuf, size_t size)
+void dav_set_bufsize(ap_pool_t * p, dav_buffer *pbuf, size_t size)
{
/* NOTE: this does not retain prior contents */
/* initialize a buffer and copy the specified (null-term'd) string into it */
-void dav_buffer_init(pool *p, dav_buffer *pbuf, const char *str)
+void dav_buffer_init(ap_pool_t *p, dav_buffer *pbuf, const char *str)
{
dav_set_bufsize(p, pbuf, strlen(str));
memcpy(pbuf->buf, str, pbuf->cur_len + 1);
}
/* append a string to the end of the buffer, adjust length */
-void dav_buffer_append(pool *p, dav_buffer *pbuf, const char *str)
+void dav_buffer_append(ap_pool_t *p, dav_buffer *pbuf, const char *str)
{
size_t len = strlen(str);
}
/* place a string on the end of the buffer, do NOT adjust length */
-void dav_buffer_place(pool *p, dav_buffer *pbuf, const char *str)
+void dav_buffer_place(ap_pool_t *p, dav_buffer *pbuf, const char *str)
{
size_t len = strlen(str);
}
/* place some memory on the end of a buffer; do NOT adjust length */
-void dav_buffer_place_mem(pool *p, dav_buffer *pbuf, const void *mem,
+void dav_buffer_place_mem(ap_pool_t *p, dav_buffer *pbuf, const void *mem,
size_t amt, size_t pad)
{
dav_check_bufsize(p, pbuf, amt + pad);
}
static size_t dav_elem_size(const dav_xml_elem *elem, int style,
- array_header *namespaces, int *ns_map)
+ ap_array_header_t *namespaces, int *ns_map)
{
size_t size;
}
static char *dav_write_elem(char *s, const dav_xml_elem *elem, int style,
- array_header *namespaces, int *ns_map)
+ ap_array_header_t *namespaces, int *ns_map)
{
const dav_xml_elem *child;
size_t len;
}
/* convert an element to a text string */
-void dav_xml2text(pool * p,
+void dav_xml2text(ap_pool_t * p,
const dav_xml_elem *elem,
int style,
- array_header *namespaces,
+ ap_array_header_t *namespaces,
int *ns_map,
const char **pbuf,
size_t *psize)
*psize = size;
}
-const char *dav_empty_elem(pool * p, const dav_xml_elem *elem)
+const char *dav_empty_elem(ap_pool_t * p, const dav_xml_elem *elem)
{
if (elem->ns == DAV_NS_NONE) {
/*
** quotes is typically set to true for XML strings that will occur within
** double quotes -- attribute values.
*/
-const char * dav_quote_string(pool *p, const char *s, int quotes)
+const char * dav_quote_string(ap_pool_t *p, const char *s, int quotes)
{
const char *scan;
int len = 0;
return qstr;
}
-void dav_quote_xml_elem(pool *p, dav_xml_elem *elem)
+void dav_quote_xml_elem(ap_pool_t *p, dav_xml_elem *elem)
{
dav_text *scan_txt;
dav_xml_attr *scan_attr;
/* add_if_resource returns a new if_header, linking it to next_ih.
*/
-static dav_if_header *dav_add_if_resource(pool *p, dav_if_header *next_ih,
+static dav_if_header *dav_add_if_resource(ap_pool_t *p, dav_if_header *next_ih,
const char *uri, size_t uri_len)
{
dav_if_header *ih;
/* add_if_state adds a condition to an if_header.
*/
-static dav_error * dav_add_if_state(pool *p, dav_if_header *ih,
+static dav_error * dav_add_if_state(ap_pool_t *p, dav_if_header *ih,
const char *state_token,
dav_if_state_type t, int condition,
const dav_hooks_locks *locks_hooks)
/* dav_validate_resource_state:
* Returns NULL if path/uri meets if-header and lock requirements
*/
-static dav_error * dav_validate_resource_state(pool *p,
+static dav_error * dav_validate_resource_state(ap_pool_t *p,
const dav_resource *resource,
dav_lockdb *lockdb,
const dav_if_header *if_header,
** to manipulate a resource.
*/
if (lock->auth_user &&
- (!r->connection->user ||
- strcmp(lock->auth_user, r->connection->user))) {
+ (!r->user ||
+ strcmp(lock->auth_user, r->user))) {
const char *errmsg;
errmsg = ap_pstrcat(p, "User \"",
- r->connection->user,
+ r->user,
"\" submitted a locktoken created "
"by user \"",
lock->auth_user, "\".", NULL);
}
/* return the URI's (existing) index, or insert it and return a new index */
-int dav_insert_uri(array_header *uri_array, const char *uri)
+int dav_insert_uri(ap_array_header_t *uri_array, const char *uri)
{
int i;
const char **pelt;
const dav_hooks_locks *hooks = DAV_GET_HOOKS_LOCKS(r);
int count = 0;
dav_buffer work_buf = { 0 };
- pool *p = r->pool;
+ ap_pool_t *p = r->pool;
/* If no locks or no lock provider, there are no locks */
if (lock == NULL || hooks == NULL) {
dav_lock **lock_request)
{
const dav_hooks_locks *hooks = DAV_GET_HOOKS_LOCKS(r);
- pool *p = r->pool;
+ ap_pool_t *p = r->pool;
dav_error *err;
dav_xml_elem *child;
dav_lock *lock;
** namespace [repository] hierarchy. Note that some lock providers may be
** able to return this information with a traversal.
*/
-static dav_error * dav_get_direct_resource(pool *p,
+static dav_error * dav_get_direct_resource(ap_pool_t *p,
dav_lockdb *lockdb,
const dav_locktoken *locktoken,
const dav_resource *resource,
if (err != NULL) {
/* ### don't log an error. return err. add higher-level desc. */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"Failed to query lock-null status for %s",
r->filename);
*/
/* James Clark's Expat parser */
-#include <xmlparse.h>
+/* ### need to fix this... */
+#include "../lib/expat-lite/xmlparse.h"
#include "httpd.h"
#include "http_protocol.h"
#include "http_log.h"
-#include "mod_dav.h"
+/* ### need to fix this... */
+#include "../modules/dav/main/mod_dav.h"
/* errors related to namespace processing */
/* content for parsing */
typedef struct dav_xml_ctx {
dav_xml_doc *doc; /* the doc we're parsing */
- ap_pool *p; /* the pool we allocate from */
+ ap_pool_t *p; /* the pool we allocate from */
dav_xml_elem *cur_elem; /* current element */
int error; /* an error has occurred */
while ((len = ap_get_client_block(r, buffer, DAV_READ_BLOCKSIZE)) > 0) {
total_read += len;
if (limit_xml_body && total_read > limit_xml_body) {
- ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"XML request body is larger than the configured "
"limit of %lu", (unsigned long)limit_xml_body);
goto read_error;
if (ctx.error) {
switch (ctx.error) {
case DAV_NS_ERROR_UNKNOWN_PREFIX:
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"An undefined namespace prefix was used.");
break;
default:
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"There was an error within the XML request body.");
break;
}
enum XML_Error err = XML_GetErrorCode(parser);
/* ### fix this error message (default vs special) */
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"XML parser error code: %s (%d).",
XML_ErrorString(err), err);