util.c revision 33bdcae1f7a1a65e351dda2a766a0cf28b1e695d
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari/* ====================================================================
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * The Apache Software License, Version 1.1
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * Copyright (c) 2000-2003 The Apache Software Foundation. All rights
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * Redistribution and use in source and binary forms, with or without
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * modification, are permitted provided that the following conditions
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * 1. Redistributions of source code must retain the above copyright
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * notice, this list of conditions and the following disclaimer.
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * 2. Redistributions in binary form must reproduce the above copyright
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * notice, this list of conditions and the following disclaimer in
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * the documentation and/or other materials provided with the
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * distribution.
b5c780c06889ceb5c241a6b5da7ef0663e5451caDaniel Calegari * 3. The end-user documentation included with the redistribution,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * if any, must include the following acknowledgment:
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * "This product includes software developed by the
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * Apache Software Foundation (http://www.apache.org/)."
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * Alternately, this acknowledgment may appear in the software itself,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * if and wherever such third-party acknowledgments normally appear.
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * 4. The names "Apache" and "Apache Software Foundation" must
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * not be used to endorse or promote products derived from this
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * software without prior written permission. For written
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * permission, please contact apache@apache.org.
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * 5. Products derived from this software may not be called "Apache",
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * nor may "Apache" appear in their name, without prior written
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * permission of the Apache Software Foundation.
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * SUCH DAMAGE.
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * ====================================================================
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * This software consists of voluntary contributions made by many
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * individuals on behalf of the Apache Software Foundation. For more
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * information on the Apache Software Foundation, please see
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari** DAV extension module for Apache 2.0.*
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari** - various utilities, repository-independent
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(dav_error*) dav_new_error(apr_pool_t *p, int status,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari dav_error *err = apr_pcalloc(p, sizeof(*err));
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari /* DBG3("dav_new_error: %d %d %s", status, error_id, desc ? desc : "(no desc)"); */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(dav_error*) dav_new_error_tag(apr_pool_t *p, int status,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari dav_error *err = dav_new_error(p, status, error_id, desc);
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(dav_error*) dav_push_error(apr_pool_t *p, int status,
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari dav_error *err = apr_pcalloc(p, sizeof(*err));
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel CalegariDAV_DECLARE(void) dav_check_bufsize(apr_pool_t * p, dav_buffer *pbuf,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari /* grow the buffer if necessary */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari if (pbuf->cur_len + extra_needed > pbuf->alloc_len) {
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari pbuf->alloc_len += extra_needed + DAV_BUFFER_PAD;
f3a838d9e2932da421939f348a2c3d31ded88989Daniel CalegariDAV_DECLARE(void) dav_set_bufsize(apr_pool_t * p, dav_buffer *pbuf,
f3a838d9e2932da421939f348a2c3d31ded88989Daniel Calegari /* NOTE: this does not retain prior contents */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari /* NOTE: this function is used to init the first pointer, too, since
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari the PAD will be larger than alloc_len (0) for zeroed structures */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari /* grow if we don't have enough for the requested size plus padding */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari if (size + DAV_BUFFER_PAD > pbuf->alloc_len) {
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari /* set the new length; min of MINSIZE */
b5c780c06889ceb5c241a6b5da7ef0663e5451caDaniel Calegari/* initialize a buffer and copy the specified (null-term'd) string into it */
b5c780c06889ceb5c241a6b5da7ef0663e5451caDaniel CalegariDAV_DECLARE(void) dav_buffer_init(apr_pool_t *p, dav_buffer *pbuf,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari/* append a string to the end of the buffer, adjust length */
b5c780c06889ceb5c241a6b5da7ef0663e5451caDaniel CalegariDAV_DECLARE(void) dav_buffer_append(apr_pool_t *p, dav_buffer *pbuf,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari memcpy(pbuf->buf + pbuf->cur_len, str, len + 1);
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari/* place a string on the end of the buffer, do NOT adjust length */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(void) dav_buffer_place(apr_pool_t *p, dav_buffer *pbuf,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari memcpy(pbuf->buf + pbuf->cur_len, str, len + 1);
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari/* place some memory on the end of a buffer; do NOT adjust length */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(void) dav_buffer_place_mem(apr_pool_t *p, dav_buffer *pbuf,
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari memcpy(pbuf->buf + pbuf->cur_len, mem, amt);
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari** dav_lookup_uri()
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari** Extension for ap_sub_req_lookup_uri() which can't handle absolute
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari** URIs properly.
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari** If NULL is returned, then an error occurred with parsing the URI or
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari** the URI does not match the current server.
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegaridav_lookup_result dav_lookup_uri(const char *uri, request_rec * r,
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari /* first thing to do is parse the URI into various components */
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari if (apr_uri_parse(r->pool, uri, &comp) != APR_SUCCESS) {
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari result.err.desc = "Invalid syntax in Destination URI.";
b5c780c06889ceb5c241a6b5da7ef0663e5451caDaniel Calegari /* the URI must be an absoluteURI (WEBDAV S9.3) */
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari if (comp.scheme == NULL && must_be_absolute) {
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari result.err.desc = "Destination URI must be an absolute URI.";
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari /* the URI must not have a query (args) or a fragment */
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari if (comp.query != NULL || comp.fragment != NULL) {
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari "Destination URI contains invalid components "
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari "(a query or a fragment).";
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari /* If the scheme or port was provided, then make sure that it matches
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari the scheme/port of this request. If the request must be absolute,
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari then require the (explicit/implicit) scheme/port be matching.
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari ### hmm. if a port wasn't provided (does the parse return port==0?),
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari ### but we're on a non-standard port, then we won't detect that the
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari ### URI's port implies the wrong one.
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari if (comp.scheme != NULL || comp.port != 0 || must_be_absolute)
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari /* ### not sure this works if the current request came in via https: */
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari /* insert a port if the URI did not contain one */
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari comp.port = apr_uri_port_of_scheme(comp.scheme);
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari /* now, verify that the URI uses the same scheme as the current.
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari request. the port must match our port.
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari apr_sockaddr_port_get(&port, r->connection->local_addr);
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari "Destination URI refers to "
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari "different scheme or port "
b767e7055b5ef62c990a111ac0524500592f8781Daniel Calegari "(want: %s://hostname:%d)",
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari /* we have verified the scheme, port, and general structure */
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari ** Hrm. IE5 will pass unqualified hostnames for both the
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari ** Host: and Destination: headers. This breaks the
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari ** http_vhost.c::matches_aliases function.
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari ** For now, qualify unqualified comp.hostnames with
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari ** r->server->server_hostname.
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari ** ### this is a big hack. Apache should provide a better way.
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari ** ### maybe the admin should list the unqualified hosts in a
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari ** ### <ServerAlias> block?
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari && (domain = strchr(r->server->server_hostname, '.')) != NULL) {
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari comp.hostname = apr_pstrcat(r->pool, comp.hostname, domain, NULL);
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari /* now, if a hostname was provided, then verify that it represents the
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari same server as the current connection. note that we just use our
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari port, since we've verified the URI matches ours */
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari !ap_matches_request_vhost(r, comp.hostname, port)) {
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari result.err.desc = "Destination URI refers to a different server.";
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari /* we have verified that the requested URI denotes the same server as
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari the current request. Therefore, we can use ap_sub_req_lookup_uri() */
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari /* reconstruct a URI as just the path */
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari new_file = apr_uri_unparse(r->pool, &comp, APR_URI_UNP_OMITSITEPART);
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari * Lookup the URI and return the sub-request. Note that we use the
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari * same HTTP method on the destination. This allows the destination
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari * to apply appropriate restrictions (e.g. readonly).
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari result.rnew = ap_sub_req_method_uri(r->method, new_file, r, NULL);
f3a838d9e2932da421939f348a2c3d31ded88989Daniel Calegari/* ---------------------------------------------------------------
f3a838d9e2932da421939f348a2c3d31ded88989Daniel Calegari** XML UTILITY FUNCTIONS
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari/* validate that the root element uses a given DAV: tagname (TRUE==valid) */
f3a838d9e2932da421939f348a2c3d31ded88989Daniel Calegariint dav_validate_root(const apr_xml_doc *doc, const char *tagname)
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari/* find and return the (unique) child with a given DAV: tagname */
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegariapr_xml_elem *dav_find_child(const apr_xml_elem *elem, const char *tagname)
7e9757ba2f41c4ac30634a4a1f1d87a042e37c45Daniel Calegari if (child->ns == APR_XML_NS_DAV_ID && !strcmp(child->name, tagname))
f3a838d9e2932da421939f348a2c3d31ded88989Daniel Calegari/* gather up all the CDATA into a single string */
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel CalegariDAV_DECLARE(const char *) dav_xml_get_cdata(const apr_xml_elem *elem, apr_pool_t *pool,
cba1bca86fce751bb0dc758f4a7e43ff95640137Daniel Calegari const char *found_text = NULL; /* initialize to avoid gcc warning */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari for (scan = elem->first_cdata.first; scan != NULL; scan = scan->next) {
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari for (child = elem->first_child; child != NULL; child = child->next) {
f3a838d9e2932da421939f348a2c3d31ded88989Daniel Calegari /* some fast-path cases:
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * 1) zero-length cdata
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari * 2) a single piece of cdata with no whitespace to strip
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari for (scan = elem->first_cdata.first; scan != NULL; scan = scan->next) {
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari for (child = elem->first_child; child != NULL; child = child->next) {
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari /* trim leading whitespace */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari while (apr_isspace(*cdata)) /* assume: return false for '\0' */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari /* trim trailing whitespace */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari while (len-- > 0 && apr_isspace(cdata[len]))
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(dav_xmlns_info *) dav_xmlns_create(apr_pool_t *pool)
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari dav_xmlns_info *xi = apr_pcalloc(pool, sizeof(*xi));
f3a838d9e2932da421939f348a2c3d31ded88989Daniel CalegariDAV_DECLARE(void) dav_xmlns_add(dav_xmlns_info *xi,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari /* this "should" not overwrite a prefix mapping */
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari apr_hash_set(xi->prefix_uri, prefix, APR_HASH_KEY_STRING, uri);
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari /* note: this may overwrite an existing URI->prefix mapping, but it
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari doesn't matter -- any prefix is usuable to specify the URI. */
f3a838d9e2932da421939f348a2c3d31ded88989Daniel Calegari apr_hash_set(xi->uri_prefix, uri, APR_HASH_KEY_STRING, prefix);
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(const char *) dav_xmlns_add_uri(dav_xmlns_info *xi,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari if ((prefix = apr_hash_get(xi->uri_prefix, uri,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari prefix = apr_psprintf(xi->pool, "g%d", xi->count++);
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(const char *) dav_xmlns_get_uri(dav_xmlns_info *xi,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari return apr_hash_get(xi->prefix_uri, prefix, APR_HASH_KEY_STRING);
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(const char *) dav_xmlns_get_prefix(dav_xmlns_info *xi,
b5c780c06889ceb5c241a6b5da7ef0663e5451caDaniel Calegari return apr_hash_get(xi->uri_prefix, uri, APR_HASH_KEY_STRING);
cebd8658147937d53195664ad8b1e37de1e6f017Daniel CalegariDAV_DECLARE(void) dav_xmlns_generate(dav_xmlns_info *xi,
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari apr_hash_index_t *hi = apr_hash_first(xi->pool, xi->prefix_uri);
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari for (; hi != NULL; hi = apr_hash_next(hi)) {
cebd8658147937d53195664ad8b1e37de1e6f017Daniel Calegari const char *s;
return DAV_TIMEOUT_INFINITE;
return DAV_TIMEOUT_INFINITE;
return DAV_TIMEOUT_INFINITE;
return NULL;
return ih;
const char *state_token,
if (t == dav_if_opaquelock) {
return NULL;
return err;
return NULL;
char *sp;
char *token;
token++;
return NULL;
return token;
char *str;
char *list;
const char *state_token;
int condition;
return NULL;
while (*str) {
switch(*str) {
while (*list) {
switch (*list) {
return err;
return err;
list++;
str++;
return NULL;
int flags,
request_rec *r)
const char *uri;
const char *etag;
int num_matched;
int num_that_apply;
int seen_locktoken;
return dav_push_error(p,
err);
if (seen_locktoken)
return NULL;
return NULL;
num_that_apply = 0;
case dav_if_etag:
char *new_etag;
int mismatch;
reason =
goto state_list_failed;
&& !mismatch) {
reason =
goto state_list_failed;
case dav_if_opaquelock:
reason =
goto state_list_failed;
num_matched = 0;
reason =
goto state_list_failed;
(!r->user ||
const char *errmsg;
r->user,
if (num_matched == 0
reason =
goto state_list_failed;
if (seen_locktoken) {
return NULL;
if (num_that_apply == 0) {
if (seen_locktoken)
return NULL;
locks_hooks)) {
return NULL;
apr_psprintf(p,
return NULL;
return NULL;
return err;
return NULL;
int result;
int lock_db_opened_locally = 0;
#if DAV_DEBUG
return err;
return err;
ctx.r = r;
&work_buf, r);
return err;
return err;
return NULL;
--idx;
return s2;
NULL);
request_rec *r,
int *auto_checkout)
*auto_checkout = 0;
err);
err);
return NULL;
/* see mod_dav.h for docco */
request_rec *r,
int parent_only,
return NULL;
goto done;
goto done;
int checkout_parent;
!= NULL) {
goto done;
if (!checkout_parent) {
goto done;
!= NULL)
err);
goto done;
if (parent_only)
goto done;
err);
goto done;
int checkout_resource;
goto done;
if (!checkout_resource) {
goto done;
!= NULL)
err);
goto done;
done:
return err;
return NULL;
/* see mod_dav.h for docco */
request_rec *r,
int undo,
int unlock,
return NULL;
if (undo) {
err);
err);
err);
return NULL;
!= NULL) {
err);
if (!unlock
!= NULL) {
err);
return NULL;