You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2005/11/10 16:06:49 UTC
svn commit: r332305 [1/5] - in /httpd/httpd/trunk: modules/aaa/
modules/arch/netware/ modules/arch/win32/ modules/cache/ modules/dav/fs/
modules/dav/main/ modules/debug/ modules/experimental/ modules/filters/
modules/generators/ modules/http/ modules/l...
Author: jim
Date: Thu Nov 10 07:05:51 2005
New Revision: 332305
URL: http://svn.apache.org/viewcvs?rev=332305&view=rev
Log:
No functional change: simple detabbing of indented code.
Modified:
httpd/httpd/trunk/modules/aaa/mod_authn_default.c
httpd/httpd/trunk/modules/aaa/mod_authnz_ldap.c
httpd/httpd/trunk/modules/arch/netware/libprews.c
httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c
httpd/httpd/trunk/modules/arch/win32/mod_isapi.c
httpd/httpd/trunk/modules/cache/cache_hash.c
httpd/httpd/trunk/modules/cache/cache_util.c
httpd/httpd/trunk/modules/cache/mod_file_cache.c
httpd/httpd/trunk/modules/dav/fs/lock.c
httpd/httpd/trunk/modules/dav/main/liveprop.c
httpd/httpd/trunk/modules/debug/mod_dumpio.c
httpd/httpd/trunk/modules/experimental/mod_case_filter.c
httpd/httpd/trunk/modules/experimental/mod_example.c
httpd/httpd/trunk/modules/filters/mod_charset_lite.c
httpd/httpd/trunk/modules/generators/mod_asis.c
httpd/httpd/trunk/modules/generators/mod_cgid.c
httpd/httpd/trunk/modules/http/http_core.c
httpd/httpd/trunk/modules/http/http_filters.c
httpd/httpd/trunk/modules/ldap/util_ldap.c
httpd/httpd/trunk/modules/ldap/util_ldap_cache.c
httpd/httpd/trunk/modules/mappers/mod_actions.c
httpd/httpd/trunk/modules/mappers/mod_imagemap.c
httpd/httpd/trunk/modules/mappers/mod_so.c
httpd/httpd/trunk/modules/mappers/mod_speling.c
httpd/httpd/trunk/modules/mappers/mod_vhost_alias.c
httpd/httpd/trunk/modules/metadata/mod_expires.c
httpd/httpd/trunk/modules/metadata/mod_headers.c
httpd/httpd/trunk/modules/metadata/mod_mime_magic.c
httpd/httpd/trunk/modules/metadata/mod_setenvif.c
httpd/httpd/trunk/modules/metadata/mod_unique_id.c
httpd/httpd/trunk/modules/metadata/mod_usertrack.c
httpd/httpd/trunk/modules/ssl/mod_ssl.c
httpd/httpd/trunk/modules/ssl/ssl_engine_config.c
httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c
httpd/httpd/trunk/modules/ssl/ssl_expr_scan.c
httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c
httpd/httpd/trunk/modules/ssl/ssl_scache_shmcb.c
httpd/httpd/trunk/modules/test/mod_optional_fn_export.c
httpd/httpd/trunk/modules/test/mod_optional_fn_import.c
httpd/httpd/trunk/modules/test/mod_optional_hook_export.c
httpd/httpd/trunk/modules/test/mod_optional_hook_import.c
httpd/httpd/trunk/os/bs2000/ebcdic.c
httpd/httpd/trunk/os/bs2000/os.c
httpd/httpd/trunk/os/netware/util_nw.c
httpd/httpd/trunk/os/unix/unixd.c
httpd/httpd/trunk/os/win32/util_win32.c
httpd/httpd/trunk/server/connection.c
httpd/httpd/trunk/server/core.c
httpd/httpd/trunk/server/mpm/beos/beos.c
httpd/httpd/trunk/server/mpm/experimental/event/fdqueue.c
httpd/httpd/trunk/server/mpm/experimental/leader/leader.c
httpd/httpd/trunk/server/mpm/experimental/perchild/perchild.c
httpd/httpd/trunk/server/mpm/experimental/threadpool/threadpool.c
httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c
httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c
httpd/httpd/trunk/server/mpm/netware/mpm_netware.c
httpd/httpd/trunk/server/mpm/winnt/child.c
httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
httpd/httpd/trunk/server/mpm/winnt/service.c
httpd/httpd/trunk/server/mpm/worker/worker.c
httpd/httpd/trunk/server/mpm_common.c
httpd/httpd/trunk/server/request.c
httpd/httpd/trunk/server/util_filter.c
httpd/httpd/trunk/server/util_md5.c
httpd/httpd/trunk/server/vhost.c
httpd/httpd/trunk/support/htcacheclean.c
httpd/httpd/trunk/support/logresolve.c
httpd/httpd/trunk/support/win32/wintty.c
httpd/httpd/trunk/test/cls.c
httpd/httpd/trunk/test/test-writev.c
httpd/httpd/trunk/test/time-sem.c
httpd/httpd/trunk/test/zb.c
Modified: httpd/httpd/trunk/modules/aaa/mod_authn_default.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/aaa/mod_authn_default.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authn_default.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authn_default.c Thu Nov 10 07:05:51 2005
@@ -46,7 +46,7 @@
OR_AUTHCFG,
"Set to 'Off' to allow access control to be passed along to "
"lower modules if the UserID is not known to this module. "
- "(default is On)."),
+ "(default is On)."),
{NULL}
};
@@ -60,7 +60,7 @@
const char *type;
if (!(type = ap_auth_type(r))) {
- return DECLINED;
+ return DECLINED;
}
/* fill in the r->user field */
@@ -74,7 +74,7 @@
}
if (conf->authoritative == 0) {
- return DECLINED;
+ return DECLINED;
}
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
Modified: httpd/httpd/trunk/modules/aaa/mod_authnz_ldap.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/aaa/mod_authnz_ldap.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authnz_ldap.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authnz_ldap.c Thu Nov 10 07:05:51 2005
@@ -246,7 +246,7 @@
*q++ = '5';
*q++ = 'c';
break;
- }
+ }
}
else
*q++ = *p++;
Modified: httpd/httpd/trunk/modules/arch/netware/libprews.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/arch/netware/libprews.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/arch/netware/libprews.c (original)
+++ httpd/httpd/trunk/modules/arch/netware/libprews.c Thu Nov 10 07:05:51 2005
@@ -76,5 +76,5 @@
int _NonAppCheckUnload( void )
{
- return 0;
+ return 0;
}
Modified: httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c (original)
+++ httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c Thu Nov 10 07:05:51 2005
@@ -113,7 +113,7 @@
struct NWSSLSrvConfigRec {
apr_table_t *sltable;
apr_table_t *slutable;
- apr_pool_t *pPool;
+ apr_pool_t *pPool;
};
struct secsocket_data {
@@ -266,7 +266,7 @@
if (!mutual) {
optParam = SO_SSL_ENABLE | SO_SSL_SERVER;
-
+
if (WSAIoctl(s, SO_SSL_SET_FLAGS, (char *)&optParam,
sizeof(optParam), NULL, 0, NULL, NULL, NULL)) {
ap_log_error(APLOG_MARK, APLOG_CRIT, WSAGetLastError(), sconf,
@@ -311,9 +311,9 @@
int convert_secure_socket(conn_rec *c, apr_socket_t *csd)
{
- int rcode;
- struct tlsclientopts sWS2Opts;
- struct nwtlsopts sNWTLSOpts;
+ int rcode;
+ struct tlsclientopts sWS2Opts;
+ struct nwtlsopts sNWTLSOpts;
struct sslserveropts opts;
unsigned long ulFlags;
SOCKET sock;
@@ -322,22 +322,22 @@
apr_os_sock_get(&sock, csd);
/* zero out buffers */
- memset((char *)&sWS2Opts, 0, sizeof(struct tlsclientopts));
- memset((char *)&sNWTLSOpts, 0, sizeof(struct nwtlsopts));
+ memset((char *)&sWS2Opts, 0, sizeof(struct tlsclientopts));
+ memset((char *)&sNWTLSOpts, 0, sizeof(struct nwtlsopts));
/* turn on ssl for the socket */
- ulFlags = (numcerts ? SO_TLS_ENABLE : SO_TLS_ENABLE | SO_TLS_BLIND_ACCEPT);
- rcode = WSAIoctl(sock, SO_TLS_SET_FLAGS, &ulFlags, sizeof(unsigned long),
+ ulFlags = (numcerts ? SO_TLS_ENABLE : SO_TLS_ENABLE | SO_TLS_BLIND_ACCEPT);
+ rcode = WSAIoctl(sock, SO_TLS_SET_FLAGS, &ulFlags, sizeof(unsigned long),
NULL, 0, NULL, NULL, NULL);
- if (SOCKET_ERROR == rcode)
- {
+ if (SOCKET_ERROR == rcode)
+ {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, c->base_server,
"Error: %d with ioctlsocket(flag SO_TLS_ENABLE)", WSAGetLastError());
- return rcode;
- }
+ return rcode;
+ }
ulFlags = SO_TLS_UNCLEAN_SHUTDOWN;
- WSAIoctl(sock, SO_TLS_SET_FLAGS, &ulFlags, sizeof(unsigned long),
+ WSAIoctl(sock, SO_TLS_SET_FLAGS, &ulFlags, sizeof(unsigned long),
NULL, 0, NULL, NULL, NULL);
/* setup the socket for SSL */
@@ -365,11 +365,11 @@
NULL, NULL);
/* make sure that it was successfull */
- if(SOCKET_ERROR == rcode ){
+ if(SOCKET_ERROR == rcode ){
ap_log_error(APLOG_MARK, APLOG_ERR, 0, c->base_server,
"Error: %d with ioctl (SO_TLS_SET_CLIENT)", WSAGetLastError());
- }
- return rcode;
+ }
+ return rcode;
}
int SSLize_Socket(SOCKET socketHnd, char *key, request_rec *r)
@@ -879,19 +879,19 @@
static int isSecure (const request_rec *r)
{
- return isSecureConn (r->server, r->connection);
+ return isSecureConn (r->server, r->connection);
}
static int isSecureUpgradeable (const request_rec *r)
{
- return isSecureConnUpgradeable (r->server, r->connection);
+ return isSecureConnUpgradeable (r->server, r->connection);
}
static int isSecureUpgraded (const request_rec *r)
{
secsocket_data *csd_data = (secsocket_data*)ap_get_module_config(r->connection->conn_config, &nwssl_module);
- return csd_data->is_secure;
+ return csd_data->is_secure;
}
static int nwssl_hook_Fixup(request_rec *r)
@@ -1053,14 +1053,14 @@
*/
if (result == NULL && c != NULL) {
- /* XXX-Can't get specific SSL info from NetWare */
+ /* XXX-Can't get specific SSL info from NetWare */
/* SSLConnRec *sslconn = myConnConfig(c);
if (strlen(var) > 4 && strcEQn(var, "SSL_", 4)
&& sslconn && sslconn->ssl)
result = ssl_var_lookup_ssl(p, c, var+4);*/
- if (strlen(var) > 4 && strcEQn(var, "SSL_", 4))
- result = NULL;
+ if (strlen(var) > 4 && strcEQn(var, "SSL_", 4))
+ result = NULL;
else if (strcEQ(var, "REMOTE_ADDR"))
result = c->remote_ip;
}
@@ -1070,7 +1070,7 @@
*/
if (result == NULL) {
if (strlen(var) > 12 && strcEQn(var, "SSL_VERSION_", 12))
- result = NULL;
+ result = NULL;
/* XXX-Can't get specific SSL info from NetWare */
/*result = ssl_var_lookup_ssl_version(p, var+12);*/
else if (strcEQ(var, "SERVER_SOFTWARE"))
Modified: httpd/httpd/trunk/modules/arch/win32/mod_isapi.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/arch/win32/mod_isapi.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/arch/win32/mod_isapi.c (original)
+++ httpd/httpd/trunk/modules/arch/win32/mod_isapi.c Thu Nov 10 07:05:51 2005
@@ -136,20 +136,20 @@
*/
fspec = ap_server_root_relative(cmd->pool, filename);
if (!fspec) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, APR_EBADPATH, cmd->server,
- "ISAPI: invalid module path, skipping %s", filename);
- return NULL;
+ ap_log_error(APLOG_MARK, APLOG_WARNING, APR_EBADPATH, cmd->server,
+ "ISAPI: invalid module path, skipping %s", filename);
+ return NULL;
}
if ((rv = apr_stat(&tmp, fspec, APR_FINFO_TYPE,
cmd->temp_pool)) != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, rv, cmd->server,
- "ISAPI: unable to stat, skipping %s", fspec);
- return NULL;
+ ap_log_error(APLOG_MARK, APLOG_WARNING, rv, cmd->server,
+ "ISAPI: unable to stat, skipping %s", fspec);
+ return NULL;
}
if (tmp.filetype != APR_REG) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
- "ISAPI: not a regular file, skipping %s", fspec);
- return NULL;
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
+ "ISAPI: not a regular file, skipping %s", fspec);
+ return NULL;
}
/* Load the extention as cached (with null request_rec) */
@@ -157,7 +157,7 @@
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_WARNING, rv, cmd->server,
"ISAPI: unable to cache, skipping %s", fspec);
- return NULL;
+ return NULL;
}
return NULL;
@@ -874,12 +874,12 @@
apr_bucket_brigade *bb;
apr_bucket *b;
bb = apr_brigade_create(cid->r->pool, c->bucket_alloc);
- b = apr_bucket_transient_create((char*) data_type + ate,
+ b = apr_bucket_transient_create((char*) data_type + ate,
headlen - ate, c->bucket_alloc);
- APR_BRIGADE_INSERT_TAIL(bb, b);
+ APR_BRIGADE_INSERT_TAIL(bb, b);
b = apr_bucket_flush_create(c->bucket_alloc);
- APR_BRIGADE_INSERT_TAIL(bb, b);
- ap_pass_brigade(cid->r->output_filters, bb);
+ APR_BRIGADE_INSERT_TAIL(bb, b);
+ ap_pass_brigade(cid->r->output_filters, bb);
cid->response_sent = 1;
}
return 1;
@@ -1274,13 +1274,13 @@
apr_bucket_brigade *bb;
apr_bucket *b;
bb = apr_brigade_create(cid->r->pool, c->bucket_alloc);
- b = apr_bucket_transient_create(shi->pszHeader + ate,
+ b = apr_bucket_transient_create(shi->pszHeader + ate,
shi->cchHeader - ate,
c->bucket_alloc);
- APR_BRIGADE_INSERT_TAIL(bb, b);
+ APR_BRIGADE_INSERT_TAIL(bb, b);
b = apr_bucket_flush_create(c->bucket_alloc);
- APR_BRIGADE_INSERT_TAIL(bb, b);
- ap_pass_brigade(cid->r->output_filters, bb);
+ APR_BRIGADE_INSERT_TAIL(bb, b);
+ ap_pass_brigade(cid->r->output_filters, bb);
cid->response_sent = 1;
}
return 1;
@@ -1608,8 +1608,8 @@
apr_pool_create_ex(&loaded.pool, pconf, NULL, NULL);
if (!loaded.pool) {
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, NULL,
- "ISAPI: could not create the isapi cache pool");
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, NULL,
+ "ISAPI: could not create the isapi cache pool");
return APR_EGENERAL;
}
Modified: httpd/httpd/trunk/modules/cache/cache_hash.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/cache/cache_hash.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_hash.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_hash.c Thu Nov 10 07:05:51 2005
@@ -114,9 +114,9 @@
{
hi->this = hi->next;
while (!hi->this) {
- if (hi->index > hi->ht->max)
- return NULL;
- hi->this = hi->ht->array[hi->index++];
+ if (hi->index > hi->ht->max)
+ return NULL;
+ hi->this = hi->ht->array[hi->index++];
}
hi->next = hi->this->next;
return hi;
@@ -216,15 +216,15 @@
/* scan linked list */
for (hep = &ht->array[hash % ht->max], he = *hep;
- he;
- hep = &he->next, he = *hep) {
- if (he->hash == hash &&
- he->klen == klen &&
- memcmp(he->key, key, klen) == 0)
- break;
+ he;
+ hep = &he->next, he = *hep) {
+ if (he->hash == hash &&
+ he->klen == klen &&
+ memcmp(he->key, key, klen) == 0)
+ break;
}
if (he || !val)
- return hep;
+ return hep;
/* add a new entry for non-NULL values */
he = malloc(sizeof(*he));
if (!he) {
@@ -247,9 +247,9 @@
cache_hash_entry_t *he;
he = *find_entry(ht, key, klen, NULL);
if (he)
- return (void *)he->val;
+ return (void *)he->val;
else
- return NULL;
+ return NULL;
}
CACHE_DECLARE(void *) cache_hash_set(cache_hash_t *ht,
Modified: httpd/httpd/trunk/modules/cache/cache_util.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/cache/cache_util.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_util.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_util.c Thu Nov 10 07:05:51 2005
@@ -209,9 +209,9 @@
|| ap_cache_liststr(NULL, cc_req, "no-cache", NULL)) {
if (!conf->ignorecachecontrol) {
- /* Treat as stale, causing revalidation */
- return 0;
- }
+ /* Treat as stale, causing revalidation */
+ return 0;
+ }
ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server,
"Incoming request is asking for a uncached version of "
Modified: httpd/httpd/trunk/modules/cache/mod_file_cache.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/cache/mod_file_cache.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_file_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_file_cache.c Thu Nov 10 07:05:51 2005
@@ -43,9 +43,9 @@
cachefile directives into your configuration to direct files to
be cached.
- cachefile /path/to/file1
- cachefile /path/to/file2
- ...
+ cachefile /path/to/file1
+ cachefile /path/to/file2
+ ...
These files are only cached when the server is restarted, so if you
change the list, or if the files are changed, then you'll need to
@@ -138,23 +138,23 @@
ap_log_error(APLOG_MARK, APLOG_WARNING, APR_EBADPATH, cmd->server,
"mod_file_cache: invalid file path "
"%s, skipping", filename);
- return;
+ return;
}
if ((rc = apr_stat(&tmp.finfo, fspec, APR_FINFO_MIN,
cmd->temp_pool)) != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
- "mod_file_cache: unable to stat(%s), skipping", fspec);
- return;
+ ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
+ "mod_file_cache: unable to stat(%s), skipping", fspec);
+ return;
}
if (tmp.finfo.filetype != APR_REG) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
- "mod_file_cache: %s isn't a regular file, skipping", fspec);
- return;
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
+ "mod_file_cache: %s isn't a regular file, skipping", fspec);
+ return;
}
if (tmp.finfo.size > AP_MAX_SENDFILE) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
- "mod_file_cache: %s is too large to cache, skipping", fspec);
- return;
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
+ "mod_file_cache: %s is too large to cache, skipping", fspec);
+ return;
}
rc = apr_file_open(&fd, fspec, APR_READ | APR_BINARY | APR_XTHREAD,
@@ -162,7 +162,7 @@
if (rc != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
"mod_file_cache: unable to open(%s, O_RDONLY), skipping", fspec);
- return;
+ return;
}
apr_file_inherit_set(fd);
@@ -248,12 +248,12 @@
/* we only operate when at least one cachefile directive was used */
if (!apr_hash_count(sconf->fileht)) {
- return DECLINED;
+ return DECLINED;
}
res = ap_core_translate(r);
if (res != OK || !r->filename) {
- return res;
+ return res;
}
/* search the cache */
@@ -329,7 +329,7 @@
match = ap_get_module_config(r->request_config, &file_cache_module);
if (match == NULL) {
- return DECLINED;
+ return DECLINED;
}
/* note that we would handle GET on this resource */
Modified: httpd/httpd/trunk/modules/dav/fs/lock.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/dav/fs/lock.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/fs/lock.c (original)
+++ httpd/httpd/trunk/modules/dav/fs/lock.c Thu Nov 10 07:05:51 2005
@@ -88,8 +88,8 @@
/* ack. forward declare. */
static dav_error * dav_fs_remove_locknull_member(apr_pool_t *p,
- const char *filename,
- dav_buffer *pbuf);
+ const char *filename,
+ dav_buffer *pbuf);
/*
** Use the opaquelock scheme for locktokens
@@ -98,7 +98,7 @@
apr_uuid_t uuid;
};
#define dav_compare_locktoken(plt1, plt2) \
- memcmp(&(plt1)->uuid, &(plt2)->uuid, sizeof((plt1)->uuid))
+ memcmp(&(plt1)->uuid, &(plt2)->uuid, sizeof((plt1)->uuid))
/* #################################################################
@@ -150,15 +150,15 @@
** prefix + Fixed length + lock token + 2 strings + 2 nulls (one for each string)
*/
#define dav_size_direct(a) (1 + sizeof(dav_lock_discovery_fixed) \
- + sizeof(apr_uuid_t) \
- + ((a)->owner ? strlen((a)->owner) : 0) \
- + ((a)->auth_user ? strlen((a)->auth_user) : 0) \
- + 2)
+ + sizeof(apr_uuid_t) \
+ + ((a)->owner ? strlen((a)->owner) : 0) \
+ + ((a)->auth_user ? strlen((a)->auth_user) : 0) \
+ + 2)
/* Stored indirect lock info - lock token and apr_datum_t */
#define dav_size_indirect(a) (1 + sizeof(apr_uuid_t) \
- + sizeof(time_t) \
- + sizeof((a)->key.dsize) + (a)->key.dsize)
+ + sizeof(time_t) \
+ + sizeof((a)->key.dsize) + (a)->key.dsize)
/*
** The lockdb structure.
@@ -212,7 +212,7 @@
/* internal function for creating locks */
static dav_lock *dav_fs_alloc_lock(dav_lockdb *lockdb, apr_datum_t key,
- const dav_locktoken *locktoken)
+ const dav_locktoken *locktoken)
{
dav_lock_combined *comb;
@@ -222,11 +222,11 @@
comb->priv.key = key;
if (locktoken == NULL) {
- comb->pub.locktoken = &comb->token;
+ comb->pub.locktoken = &comb->token;
apr_uuid_get(&comb->token.uuid);
}
else {
- comb->pub.locktoken = locktoken;
+ comb->pub.locktoken = locktoken;
}
return &comb->pub;
@@ -245,18 +245,18 @@
dav_locktoken *locktoken;
if (ap_strstr_c(char_token, "opaquelocktoken:") != char_token) {
- return dav_new_error(p,
- HTTP_BAD_REQUEST, DAV_ERR_LOCK_UNK_STATE_TOKEN,
- "The lock token uses an unknown State-token "
- "format and could not be parsed.");
+ return dav_new_error(p,
+ HTTP_BAD_REQUEST, DAV_ERR_LOCK_UNK_STATE_TOKEN,
+ "The lock token uses an unknown State-token "
+ "format and could not be parsed.");
}
char_token += 16;
locktoken = apr_pcalloc(p, sizeof(*locktoken));
if (apr_uuid_parse(&locktoken->uuid, char_token)) {
- return dav_new_error(p, HTTP_BAD_REQUEST, DAV_ERR_LOCK_PARSE_TOKEN,
- "The opaquelocktoken has an incorrect format "
- "and could not be parsed.");
+ return dav_new_error(p, HTTP_BAD_REQUEST, DAV_ERR_LOCK_PARSE_TOKEN,
+ "The opaquelocktoken has an incorrect format "
+ "and could not be parsed.");
}
*locktoken_p = locktoken;
@@ -300,18 +300,18 @@
dav_error *err;
if (lockdb->info->opened)
- return NULL;
+ return NULL;
err = dav_dbm_open_direct(lockdb->info->pool,
- lockdb->info->lockdb_path,
- lockdb->ro,
- &lockdb->info->db);
+ lockdb->info->lockdb_path,
+ lockdb->ro,
+ &lockdb->info->db);
if (err != NULL) {
- return dav_push_error(lockdb->info->pool,
- HTTP_INTERNAL_SERVER_ERROR,
- DAV_ERR_LOCK_OPENDB,
- "Could not open the lock database.",
- err);
+ return dav_push_error(lockdb->info->pool,
+ HTTP_INTERNAL_SERVER_ERROR,
+ DAV_ERR_LOCK_OPENDB,
+ "Could not open the lock database.",
+ err);
}
/* all right. it is opened now. */
@@ -329,7 +329,7 @@
** Note that only one can be open read/write.
*/
static dav_error * dav_fs_open_lockdb(request_rec *r, int ro, int force,
- dav_lockdb **lockdb)
+ dav_lockdb **lockdb)
{
dav_lockdb_combined *comb;
@@ -342,19 +342,19 @@
comb->priv.lockdb_path = dav_get_lockdb_path(r);
if (comb->priv.lockdb_path == NULL) {
- return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
- DAV_ERR_LOCK_NO_DB,
- "A lock database was not specified with the "
- "DAVLockDB directive. One must be specified "
- "to use the locking functionality.");
+ return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
+ DAV_ERR_LOCK_NO_DB,
+ "A lock database was not specified with the "
+ "DAVLockDB directive. One must be specified "
+ "to use the locking functionality.");
}
/* done initializing. return it. */
*lockdb = &comb->pub;
if (force) {
- /* ### add a higher-level comment? */
- return dav_fs_really_open_lockdb(*lockdb);
+ /* ### add a higher-level comment? */
+ return dav_fs_really_open_lockdb(*lockdb);
}
return NULL;
@@ -368,7 +368,7 @@
static void dav_fs_close_lockdb(dav_lockdb *lockdb)
{
if (lockdb->info->db != NULL)
- dav_dbm_close(lockdb->info->db);
+ dav_dbm_close(lockdb->info->db);
}
/*
@@ -389,7 +389,7 @@
*key.dptr = DAV_TYPE_FNAME;
memcpy(key.dptr + 1, pathname, key.dsize - 1);
if (key.dptr[key.dsize - 2] == '/')
- key.dptr[--key.dsize - 1] = '\0';
+ key.dptr[--key.dsize - 1] = '\0';
return key;
}
@@ -419,15 +419,15 @@
if ((rv == APR_SUCCESS || rv == APR_INCOMPLETE)
&& ((finfo.valid & APR_FINFO_IDENT) == APR_FINFO_IDENT))
{
- /* ### can we use a buffer for this? */
- key.dsize = 1 + sizeof(finfo.inode) + sizeof(finfo.device);
- key.dptr = apr_palloc(p, key.dsize);
- *key.dptr = DAV_TYPE_INODE;
- memcpy(key.dptr + 1, &finfo.inode, sizeof(finfo.inode));
- memcpy(key.dptr + 1 + sizeof(finfo.inode), &finfo.device,
- sizeof(finfo.device));
+ /* ### can we use a buffer for this? */
+ key.dsize = 1 + sizeof(finfo.inode) + sizeof(finfo.device);
+ key.dptr = apr_palloc(p, key.dsize);
+ *key.dptr = DAV_TYPE_INODE;
+ memcpy(key.dptr + 1, &finfo.inode, sizeof(finfo.inode));
+ memcpy(key.dptr + 1 + sizeof(finfo.inode), &finfo.device,
+ sizeof(finfo.device));
- return key;
+ return key;
}
return dav_fs_build_fname_key(p, file);
@@ -449,8 +449,8 @@
** If direct and indirect == NULL, the key is removed.
*/
static dav_error * dav_fs_save_lock_record(dav_lockdb *lockdb, apr_datum_t key,
- dav_lock_discovery *direct,
- dav_lock_indirect *indirect)
+ dav_lock_discovery *direct,
+ dav_lock_indirect *indirect)
{
dav_error *err;
apr_datum_t val = { 0 };
@@ -460,34 +460,34 @@
#if DAV_DEBUG
if (lockdb->ro) {
- return dav_new_error(lockdb->info->pool,
- HTTP_INTERNAL_SERVER_ERROR, 0,
- "INTERNAL DESIGN ERROR: the lockdb was opened "
- "readonly, but an attempt to save locks was "
- "performed.");
+ return dav_new_error(lockdb->info->pool,
+ HTTP_INTERNAL_SERVER_ERROR, 0,
+ "INTERNAL DESIGN ERROR: the lockdb was opened "
+ "readonly, but an attempt to save locks was "
+ "performed.");
}
#endif
if ((err = dav_fs_really_open_lockdb(lockdb)) != NULL) {
- /* ### add a higher-level error? */
- return err;
+ /* ### add a higher-level error? */
+ return err;
}
/* If nothing to save, delete key */
if (dp == NULL && ip == NULL) {
/* don't fail if the key is not present */
/* ### but what about other errors? */
- (void) dav_dbm_delete(lockdb->info->db, key);
+ (void) dav_dbm_delete(lockdb->info->db, key);
return NULL;
}
-
+
while(dp) {
- val.dsize += dav_size_direct(dp);
- dp = dp->next;
+ val.dsize += dav_size_direct(dp);
+ dp = dp->next;
}
while(ip) {
- val.dsize += dav_size_indirect(ip);
- ip = ip->next;
+ val.dsize += dav_size_indirect(ip);
+ ip = ip->next;
}
/* ### can this be apr_palloc() ? */
@@ -497,49 +497,49 @@
ip = indirect;
while(dp) {
- *ptr++ = DAV_LOCK_DIRECT; /* Direct lock - lock_discovery struct follows */
- memcpy(ptr, dp, sizeof(dp->f)); /* Fixed portion of struct */
- ptr += sizeof(dp->f);
+ *ptr++ = DAV_LOCK_DIRECT; /* Direct lock - lock_discovery struct follows */
+ memcpy(ptr, dp, sizeof(dp->f)); /* Fixed portion of struct */
+ ptr += sizeof(dp->f);
memcpy(ptr, dp->locktoken, sizeof(*dp->locktoken));
ptr += sizeof(*dp->locktoken);
- if (dp->owner == NULL) {
- *ptr++ = '\0';
- }
- else {
- memcpy(ptr, dp->owner, strlen(dp->owner) + 1);
- ptr += strlen(dp->owner) + 1;
- }
- if (dp->auth_user == NULL) {
+ if (dp->owner == NULL) {
+ *ptr++ = '\0';
+ }
+ else {
+ memcpy(ptr, dp->owner, strlen(dp->owner) + 1);
+ ptr += strlen(dp->owner) + 1;
+ }
+ if (dp->auth_user == NULL) {
*ptr++ = '\0';
- }
- else {
- memcpy(ptr, dp->auth_user, strlen(dp->auth_user) + 1);
- ptr += strlen(dp->auth_user) + 1;
- }
+ }
+ else {
+ memcpy(ptr, dp->auth_user, strlen(dp->auth_user) + 1);
+ ptr += strlen(dp->auth_user) + 1;
+ }
- dp = dp->next;
+ dp = dp->next;
}
while(ip) {
- *ptr++ = DAV_LOCK_INDIRECT; /* Indirect lock prefix */
- memcpy(ptr, ip->locktoken, sizeof(*ip->locktoken)); /* Locktoken */
- ptr += sizeof(*ip->locktoken);
- memcpy(ptr, &ip->timeout, sizeof(ip->timeout)); /* Expire time */
- ptr += sizeof(ip->timeout);
- memcpy(ptr, &ip->key.dsize, sizeof(ip->key.dsize)); /* Size of key */
- ptr += sizeof(ip->key.dsize);
- memcpy(ptr, ip->key.dptr, ip->key.dsize); /* Key data */
- ptr += ip->key.dsize;
- ip = ip->next;
+ *ptr++ = DAV_LOCK_INDIRECT; /* Indirect lock prefix */
+ memcpy(ptr, ip->locktoken, sizeof(*ip->locktoken)); /* Locktoken */
+ ptr += sizeof(*ip->locktoken);
+ memcpy(ptr, &ip->timeout, sizeof(ip->timeout)); /* Expire time */
+ ptr += sizeof(ip->timeout);
+ memcpy(ptr, &ip->key.dsize, sizeof(ip->key.dsize)); /* Size of key */
+ ptr += sizeof(ip->key.dsize);
+ memcpy(ptr, ip->key.dptr, ip->key.dsize); /* Key data */
+ ptr += ip->key.dsize;
+ ip = ip->next;
}
if ((err = dav_dbm_store(lockdb->info->db, key, val)) != NULL) {
- /* ### more details? add an error_id? */
- return dav_push_error(lockdb->info->pool,
- HTTP_INTERNAL_SERVER_ERROR,
- DAV_ERR_LOCK_SAVE_LOCK,
- "Could not save lock information.",
- err);
+ /* ### more details? add an error_id? */
+ return dav_push_error(lockdb->info->pool,
+ HTTP_INTERNAL_SERVER_ERROR,
+ DAV_ERR_LOCK_SAVE_LOCK,
+ "Could not save lock information.",
+ err);
}
return NULL;
@@ -556,9 +556,9 @@
** ### How much "logging" does RFC 2518 require?
*/
static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, apr_datum_t key,
- int add_method,
- dav_lock_discovery **direct,
- dav_lock_indirect **indirect)
+ int add_method,
+ dav_lock_discovery **direct,
+ dav_lock_indirect **indirect)
{
apr_pool_t *p = lockdb->info->pool;
dav_error *err;
@@ -570,13 +570,13 @@
dav_buffer buf = { 0 };
if (add_method != DAV_APPEND_LIST) {
- *direct = NULL;
- *indirect = NULL;
+ *direct = NULL;
+ *indirect = NULL;
}
if ((err = dav_fs_really_open_lockdb(lockdb)) != NULL) {
- /* ### add a higher-level error? */
- return err;
+ /* ### add a higher-level error? */
+ return err;
}
/*
@@ -584,32 +584,32 @@
** locks for this resource. Just exit.
*/
if (lockdb->info->db == NULL)
- return NULL;
+ return NULL;
if ((err = dav_dbm_fetch(lockdb->info->db, key, &val)) != NULL)
return err;
-
+
if (!val.dsize)
- return NULL;
+ return NULL;
while (offset < val.dsize) {
- switch (*(val.dptr + offset++)) {
- case DAV_LOCK_DIRECT:
- /* Create and fill a dav_lock_discovery structure */
-
- dp = apr_pcalloc(p, sizeof(*dp));
- memcpy(dp, val.dptr + offset, sizeof(dp->f));
- offset += sizeof(dp->f);
+ switch (*(val.dptr + offset++)) {
+ case DAV_LOCK_DIRECT:
+ /* Create and fill a dav_lock_discovery structure */
+
+ dp = apr_pcalloc(p, sizeof(*dp));
+ memcpy(dp, val.dptr + offset, sizeof(dp->f));
+ offset += sizeof(dp->f);
dp->locktoken = apr_palloc(p, sizeof(*dp->locktoken));
memcpy(dp->locktoken, val.dptr + offset, sizeof(*dp->locktoken));
offset += sizeof(*dp->locktoken);
- if (*(val.dptr + offset) == '\0') {
- ++offset;
- }
- else {
- dp->owner = apr_pstrdup(p, val.dptr + offset);
- offset += strlen(dp->owner) + 1;
- }
+ if (*(val.dptr + offset) == '\0') {
+ ++offset;
+ }
+ else {
+ dp->owner = apr_pstrdup(p, val.dptr + offset);
+ offset += strlen(dp->owner) + 1;
+ }
if (*(val.dptr + offset) == '\0') {
++offset;
@@ -619,71 +619,71 @@
offset += strlen(dp->auth_user) + 1;
}
- if (!dav_fs_lock_expired(dp->f.timeout)) {
- dp->next = *direct;
- *direct = dp;
- }
- else {
- need_save = DAV_TRUE;
-
- /* Remove timed-out locknull fm .locknull list */
- if (*key.dptr == DAV_TYPE_FNAME) {
- const char *fname = key.dptr + 1;
- apr_finfo_t finfo;
+ if (!dav_fs_lock_expired(dp->f.timeout)) {
+ dp->next = *direct;
+ *direct = dp;
+ }
+ else {
+ need_save = DAV_TRUE;
+
+ /* Remove timed-out locknull fm .locknull list */
+ if (*key.dptr == DAV_TYPE_FNAME) {
+ const char *fname = key.dptr + 1;
+ apr_finfo_t finfo;
apr_status_t rv;
- /* if we don't see the file, then it's a locknull */
+ /* if we don't see the file, then it's a locknull */
rv = apr_stat(&finfo, fname, APR_FINFO_MIN | APR_FINFO_LINK, p);
- if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) {
- if ((err = dav_fs_remove_locknull_member(p, fname, &buf)) != NULL) {
+ if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) {
+ if ((err = dav_fs_remove_locknull_member(p, fname, &buf)) != NULL) {
/* ### push a higher-level description? */
return err;
}
- }
- }
- }
- break;
+ }
+ }
+ }
+ break;
- case DAV_LOCK_INDIRECT:
- /* Create and fill a dav_lock_indirect structure */
+ case DAV_LOCK_INDIRECT:
+ /* Create and fill a dav_lock_indirect structure */
- ip = apr_pcalloc(p, sizeof(*ip));
+ ip = apr_pcalloc(p, sizeof(*ip));
ip->locktoken = apr_palloc(p, sizeof(*ip->locktoken));
- memcpy(ip->locktoken, val.dptr + offset, sizeof(*ip->locktoken));
- offset += sizeof(*ip->locktoken);
- memcpy(&ip->timeout, val.dptr + offset, sizeof(ip->timeout));
- offset += sizeof(ip->timeout);
+ memcpy(ip->locktoken, val.dptr + offset, sizeof(*ip->locktoken));
+ offset += sizeof(*ip->locktoken);
+ memcpy(&ip->timeout, val.dptr + offset, sizeof(ip->timeout));
+ offset += sizeof(ip->timeout);
memcpy(&ip->key.dsize, val.dptr + offset, sizeof(ip->key.dsize)); /* length of datum */
- offset += sizeof(ip->key.dsize);
- ip->key.dptr = apr_palloc(p, ip->key.dsize);
- memcpy(ip->key.dptr, val.dptr + offset, ip->key.dsize);
- offset += ip->key.dsize;
-
- if (!dav_fs_lock_expired(ip->timeout)) {
- ip->next = *indirect;
- *indirect = ip;
- }
- else {
- need_save = DAV_TRUE;
- /* A locknull resource will never be locked indirectly */
- }
-
- break;
-
- default:
- dav_dbm_freedatum(lockdb->info->db, val);
-
- /* ### should use a computed_desc and insert corrupt token data */
- --offset;
- return dav_new_error(p,
- HTTP_INTERNAL_SERVER_ERROR,
- DAV_ERR_LOCK_CORRUPT_DB,
- apr_psprintf(p,
- "The lock database was found to "
- "be corrupt. offset %"
+ offset += sizeof(ip->key.dsize);
+ ip->key.dptr = apr_palloc(p, ip->key.dsize);
+ memcpy(ip->key.dptr, val.dptr + offset, ip->key.dsize);
+ offset += ip->key.dsize;
+
+ if (!dav_fs_lock_expired(ip->timeout)) {
+ ip->next = *indirect;
+ *indirect = ip;
+ }
+ else {
+ need_save = DAV_TRUE;
+ /* A locknull resource will never be locked indirectly */
+ }
+
+ break;
+
+ default:
+ dav_dbm_freedatum(lockdb->info->db, val);
+
+ /* ### should use a computed_desc and insert corrupt token data */
+ --offset;
+ return dav_new_error(p,
+ HTTP_INTERNAL_SERVER_ERROR,
+ DAV_ERR_LOCK_CORRUPT_DB,
+ apr_psprintf(p,
+ "The lock database was found to "
+ "be corrupt. offset %"
APR_SIZE_T_FMT ", c=%02x",
- offset, val.dptr[offset]));
- }
+ offset, val.dptr[offset]));
+ }
}
dav_dbm_freedatum(lockdb->info->db, val);
@@ -694,7 +694,7 @@
** ### timed-out locks from the response, but don't save that info back
*/
if (need_save == DAV_TRUE) {
- return dav_fs_save_lock_record(lockdb, key, *direct, *indirect);
+ return dav_fs_save_lock_record(lockdb, key, *direct, *indirect);
}
return NULL;
@@ -702,42 +702,42 @@
/* resolve <indirect>, returning <*direct> */
static dav_error * dav_fs_resolve(dav_lockdb *lockdb,
- dav_lock_indirect *indirect,
- dav_lock_discovery **direct,
- dav_lock_discovery **ref_dp,
- dav_lock_indirect **ref_ip)
+ dav_lock_indirect *indirect,
+ dav_lock_discovery **direct,
+ dav_lock_discovery **ref_dp,
+ dav_lock_indirect **ref_ip)
{
dav_error *err;
dav_lock_discovery *dir;
dav_lock_indirect *ind;
-
+
if ((err = dav_fs_load_lock_record(lockdb, indirect->key,
- DAV_CREATE_LIST,
- &dir, &ind)) != NULL) {
- /* ### insert a higher-level description? */
- return err;
+ DAV_CREATE_LIST,
+ &dir, &ind)) != NULL) {
+ /* ### insert a higher-level description? */
+ return err;
}
if (ref_dp != NULL) {
- *ref_dp = dir;
- *ref_ip = ind;
+ *ref_dp = dir;
+ *ref_ip = ind;
}
-
+
for (; dir != NULL; dir = dir->next) {
- if (!dav_compare_locktoken(indirect->locktoken, dir->locktoken)) {
- *direct = dir;
- return NULL;
- }
+ if (!dav_compare_locktoken(indirect->locktoken, dir->locktoken)) {
+ *direct = dir;
+ return NULL;
+ }
}
/* No match found (but we should have found one!) */
/* ### use a different description and/or error ID? */
return dav_new_error(lockdb->info->pool,
- HTTP_INTERNAL_SERVER_ERROR,
- DAV_ERR_LOCK_CORRUPT_DB,
- "The lock database was found to be corrupt. "
- "An indirect lock's direct lock could not "
- "be found.");
+ HTTP_INTERNAL_SERVER_ERROR,
+ DAV_ERR_LOCK_CORRUPT_DB,
+ "The lock database was found to be corrupt. "
+ "An indirect lock's direct lock could not "
+ "be found.");
}
/* ---------------------------------------------------------------
@@ -754,14 +754,14 @@
static const char *dav_fs_get_supportedlock(const dav_resource *resource)
{
static const char supported[] = DEBUG_CR
- "<D:lockentry>" DEBUG_CR
- "<D:lockscope><D:exclusive/></D:lockscope>" DEBUG_CR
- "<D:locktype><D:write/></D:locktype>" DEBUG_CR
- "</D:lockentry>" DEBUG_CR
- "<D:lockentry>" DEBUG_CR
- "<D:lockscope><D:shared/></D:lockscope>" DEBUG_CR
- "<D:locktype><D:write/></D:locktype>" DEBUG_CR
- "</D:lockentry>" DEBUG_CR;
+ "<D:lockentry>" DEBUG_CR
+ "<D:lockscope><D:exclusive/></D:lockscope>" DEBUG_CR
+ "<D:locktype><D:write/></D:locktype>" DEBUG_CR
+ "</D:lockentry>" DEBUG_CR
+ "<D:lockentry>" DEBUG_CR
+ "<D:lockscope><D:shared/></D:lockscope>" DEBUG_CR
+ "<D:locktype><D:write/></D:locktype>" DEBUG_CR
+ "</D:lockentry>" DEBUG_CR;
return supported;
}
@@ -783,7 +783,7 @@
** for the given directory.
*/
static dav_error * dav_fs_load_locknull_list(apr_pool_t *p, const char *dirpath,
- dav_buffer *pbuf)
+ dav_buffer *pbuf)
{
apr_finfo_t finfo;
apr_file_t *file = NULL;
@@ -794,7 +794,7 @@
dav_buffer_init(p, pbuf, dirpath);
if (pbuf->buf[pbuf->cur_len - 1] == '/')
- pbuf->buf[--pbuf->cur_len] = '\0';
+ pbuf->buf[--pbuf->cur_len] = '\0';
dav_buffer_place(p, pbuf, "/" DAV_FS_STATE_DIR "/" DAV_FS_LOCK_NULL_FILE);
@@ -803,38 +803,38 @@
if (apr_file_open(&file, pbuf->buf, APR_READ | APR_BINARY, APR_OS_DEFAULT,
p) != APR_SUCCESS) {
- return NULL;
+ return NULL;
}
rv = apr_file_info_get(&finfo, APR_FINFO_SIZE, file);
if (rv != APR_SUCCESS) {
- err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
- apr_psprintf(p,
- "Opened but could not stat file %s",
- pbuf->buf));
- goto loaderror;
+ err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
+ apr_psprintf(p,
+ "Opened but could not stat file %s",
+ pbuf->buf));
+ goto loaderror;
}
if (finfo.size != (apr_size_t)finfo.size) {
- err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
- apr_psprintf(p,
- "Opened but rejected huge file %s",
- pbuf->buf));
- goto loaderror;
+ err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
+ apr_psprintf(p,
+ "Opened but rejected huge file %s",
+ pbuf->buf));
+ goto loaderror;
}
amt = (apr_size_t)finfo.size;
dav_set_bufsize(p, pbuf, amt);
if (apr_file_read(file, pbuf->buf, &amt) != APR_SUCCESS
|| amt != finfo.size) {
- err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
- apr_psprintf(p,
- "Failure reading locknull file "
- "for %s", dirpath));
-
- /* just in case the caller disregards the returned error */
- pbuf->cur_len = 0;
- goto loaderror;
+ err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
+ apr_psprintf(p,
+ "Failure reading locknull file "
+ "for %s", dirpath));
+
+ /* just in case the caller disregards the returned error */
+ pbuf->cur_len = 0;
+ goto loaderror;
}
loaderror:
@@ -847,7 +847,7 @@
** locknull file for dirpath.
*/
static dav_error * dav_fs_save_locknull_list(apr_pool_t *p, const char *dirpath,
- dav_buffer *pbuf)
+ dav_buffer *pbuf)
{
const char *pathname;
apr_file_t *file = NULL;
@@ -855,42 +855,42 @@
apr_size_t amt;
if (pbuf->buf == NULL)
- return NULL;
+ return NULL;
dav_fs_ensure_state_dir(p, dirpath);
pathname = apr_pstrcat(p,
- dirpath,
- dirpath[strlen(dirpath) - 1] == '/' ? "" : "/",
- DAV_FS_STATE_DIR "/" DAV_FS_LOCK_NULL_FILE,
- NULL);
+ dirpath,
+ dirpath[strlen(dirpath) - 1] == '/' ? "" : "/",
+ DAV_FS_STATE_DIR "/" DAV_FS_LOCK_NULL_FILE,
+ NULL);
if (pbuf->cur_len == 0) {
- /* delete the file if cur_len == 0 */
- if (apr_file_remove(pathname, p) != 0) {
- return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
- apr_psprintf(p,
- "Error removing %s", pathname));
- }
- return NULL;
+ /* delete the file if cur_len == 0 */
+ if (apr_file_remove(pathname, p) != 0) {
+ return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
+ apr_psprintf(p,
+ "Error removing %s", pathname));
+ }
+ return NULL;
}
if (apr_file_open(&file, pathname,
APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BINARY,
APR_OS_DEFAULT, p) != APR_SUCCESS) {
- return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
- apr_psprintf(p,
- "Error opening %s for writing",
- pathname));
+ return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
+ apr_psprintf(p,
+ "Error opening %s for writing",
+ pathname));
}
amt = pbuf->cur_len;
if (apr_file_write(file, pbuf->buf, &amt) != APR_SUCCESS
|| amt != pbuf->cur_len) {
- err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
- apr_psprintf(p,
- "Error writing %" APR_SIZE_T_FMT
+ err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
+ apr_psprintf(p,
+ "Error writing %" APR_SIZE_T_FMT
" bytes to %s",
- pbuf->cur_len, pathname));
+ pbuf->cur_len, pathname));
}
apr_file_close(file);
@@ -903,7 +903,7 @@
*/
static dav_error * dav_fs_remove_locknull_member(apr_pool_t *p,
const char *filename,
- dav_buffer *pbuf)
+ dav_buffer *pbuf)
{
dav_error *err;
apr_size_t len;
@@ -915,33 +915,33 @@
int dirty = 0;
if (fname != NULL)
- *fname++ = '\0';
+ *fname++ = '\0';
else
- fname = dirpath;
+ fname = dirpath;
len = strlen(fname) + 1;
if ((err = dav_fs_load_locknull_list(p, dirpath, pbuf)) != NULL) {
- /* ### add a higher level description? */
- return err;
+ /* ### add a higher level description? */
+ return err;
}
for (scan = pbuf->buf, scanend = scan + pbuf->cur_len;
- scan < scanend;
- scan += scanlen) {
- scanlen = strlen(scan) + 1;
- if (len == scanlen && memcmp(fname, scan, scanlen) == 0) {
- pbuf->cur_len -= scanlen;
- memmove(scan, scan + scanlen, scanend - (scan + scanlen));
- dirty = 1;
- break;
- }
+ scan < scanend;
+ scan += scanlen) {
+ scanlen = strlen(scan) + 1;
+ if (len == scanlen && memcmp(fname, scan, scanlen) == 0) {
+ pbuf->cur_len -= scanlen;
+ memmove(scan, scan + scanlen, scanend - (scan + scanlen));
+ dirty = 1;
+ break;
+ }
}
if (dirty) {
- if ((err = dav_fs_save_locknull_list(p, dirpath, pbuf)) != NULL) {
- /* ### add a higher level description? */
- return err;
- }
+ if ((err = dav_fs_save_locknull_list(p, dirpath, pbuf)) != NULL) {
+ /* ### add a higher level description? */
+ return err;
+ }
}
return NULL;
@@ -976,7 +976,7 @@
if ((err = dav_fs_load_locknull_list(p, dirpath, &buf)) != NULL) {
return dav_push_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
- "Could not load .locknull file.", err);
+ "Could not load .locknull file.", err);
}
dav_buffer_append(p, &buf, fname);
@@ -984,7 +984,7 @@
if ((err = dav_fs_save_locknull_list(p, dirpath, &buf)) != NULL) {
return dav_push_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
- "Could not save .locknull file.", err);
+ "Could not save .locknull file.", err);
}
return NULL;
@@ -1010,36 +1010,36 @@
const char *pathname = dav_fs_pathname(resource);
if ((err = dav_fs_remove_locknull_member(p, pathname, &buf)) != NULL) {
- /* ### add a higher-level description? */
- return err;
+ /* ### add a higher-level description? */
+ return err;
}
{
- dav_lock_discovery *ld;
- dav_lock_indirect *id;
- apr_datum_t key;
-
- /*
- ** Fetch the lock(s) that made the resource lock-null. Remove
- ** them under the filename key. Obtain the new inode key, and
- ** save the same lock information under it.
- */
- key = dav_fs_build_fname_key(p, pathname);
- if ((err = dav_fs_load_lock_record(lockdb, key, DAV_CREATE_LIST,
- &ld, &id)) != NULL) {
- /* ### insert a higher-level error description */
- return err;
- }
-
- if ((err = dav_fs_save_lock_record(lockdb, key, NULL, NULL)) != NULL) {
- /* ### insert a higher-level error description */
- return err;
- }
-
- key = dav_fs_build_key(p, resource);
- if ((err = dav_fs_save_lock_record(lockdb, key, ld, id)) != NULL) {
- /* ### insert a higher-level error description */
- return err;
+ dav_lock_discovery *ld;
+ dav_lock_indirect *id;
+ apr_datum_t key;
+
+ /*
+ ** Fetch the lock(s) that made the resource lock-null. Remove
+ ** them under the filename key. Obtain the new inode key, and
+ ** save the same lock information under it.
+ */
+ key = dav_fs_build_fname_key(p, pathname);
+ if ((err = dav_fs_load_lock_record(lockdb, key, DAV_CREATE_LIST,
+ &ld, &id)) != NULL) {
+ /* ### insert a higher-level error description */
+ return err;
+ }
+
+ if ((err = dav_fs_save_lock_record(lockdb, key, NULL, NULL)) != NULL) {
+ /* ### insert a higher-level error description */
+ return err;
+ }
+
+ key = dav_fs_build_key(p, resource);
+ if ((err = dav_fs_save_lock_record(lockdb, key, ld, id)) != NULL) {
+ /* ### insert a higher-level error description */
+ return err;
}
}
@@ -1047,16 +1047,16 @@
}
static dav_error * dav_fs_create_lock(dav_lockdb *lockdb,
- const dav_resource *resource,
- dav_lock **lock)
+ const dav_resource *resource,
+ dav_lock **lock)
{
apr_datum_t key;
key = dav_fs_build_key(lockdb->info->pool, resource);
*lock = dav_fs_alloc_lock(lockdb,
- key,
- NULL);
+ key,
+ NULL);
(*lock)->is_locknull = !resource->exists;
@@ -1064,9 +1064,9 @@
}
static dav_error * dav_fs_get_locks(dav_lockdb *lockdb,
- const dav_resource *resource,
- int calltype,
- dav_lock **locks)
+ const dav_resource *resource,
+ int calltype,
+ dav_lock **locks)
{
apr_pool_t *p = lockdb->info->pool;
apr_datum_t key;
@@ -1078,62 +1078,62 @@
#if DAV_DEBUG
if (calltype == DAV_GETLOCKS_COMPLETE) {
- return dav_new_error(lockdb->info->pool,
- HTTP_INTERNAL_SERVER_ERROR, 0,
- "INTERNAL DESIGN ERROR: DAV_GETLOCKS_COMPLETE "
- "is not yet supported");
+ return dav_new_error(lockdb->info->pool,
+ HTTP_INTERNAL_SERVER_ERROR, 0,
+ "INTERNAL DESIGN ERROR: DAV_GETLOCKS_COMPLETE "
+ "is not yet supported");
}
#endif
key = dav_fs_build_key(p, resource);
if ((err = dav_fs_load_lock_record(lockdb, key, DAV_CREATE_LIST,
- &dp, &ip)) != NULL) {
- /* ### push a higher-level desc? */
- return err;
+ &dp, &ip)) != NULL) {
+ /* ### push a higher-level desc? */
+ return err;
}
/* copy all direct locks to the result list */
for (; dp != NULL; dp = dp->next) {
- newlock = dav_fs_alloc_lock(lockdb, key, dp->locktoken);
- newlock->is_locknull = !resource->exists;
- newlock->scope = dp->f.scope;
- newlock->type = dp->f.type;
- newlock->depth = dp->f.depth;
- newlock->timeout = dp->f.timeout;
- newlock->owner = dp->owner;
+ newlock = dav_fs_alloc_lock(lockdb, key, dp->locktoken);
+ newlock->is_locknull = !resource->exists;
+ newlock->scope = dp->f.scope;
+ newlock->type = dp->f.type;
+ newlock->depth = dp->f.depth;
+ newlock->timeout = dp->f.timeout;
+ newlock->owner = dp->owner;
newlock->auth_user = dp->auth_user;
- /* hook into the result list */
- newlock->next = lock;
- lock = newlock;
+ /* hook into the result list */
+ newlock->next = lock;
+ lock = newlock;
}
/* copy all the indirect locks to the result list. resolve as needed. */
for (; ip != NULL; ip = ip->next) {
- newlock = dav_fs_alloc_lock(lockdb, ip->key, ip->locktoken);
- newlock->is_locknull = !resource->exists;
+ newlock = dav_fs_alloc_lock(lockdb, ip->key, ip->locktoken);
+ newlock->is_locknull = !resource->exists;
- if (calltype == DAV_GETLOCKS_RESOLVED) {
- if ((err = dav_fs_resolve(lockdb, ip, &dp, NULL, NULL)) != NULL) {
- /* ### push a higher-level desc? */
- return err;
- }
-
- newlock->scope = dp->f.scope;
- newlock->type = dp->f.type;
- newlock->depth = dp->f.depth;
- newlock->timeout = dp->f.timeout;
- newlock->owner = dp->owner;
+ if (calltype == DAV_GETLOCKS_RESOLVED) {
+ if ((err = dav_fs_resolve(lockdb, ip, &dp, NULL, NULL)) != NULL) {
+ /* ### push a higher-level desc? */
+ return err;
+ }
+
+ newlock->scope = dp->f.scope;
+ newlock->type = dp->f.type;
+ newlock->depth = dp->f.depth;
+ newlock->timeout = dp->f.timeout;
+ newlock->owner = dp->owner;
newlock->auth_user = dp->auth_user;
- }
- else {
- /* DAV_GETLOCKS_PARTIAL */
- newlock->rectype = DAV_LOCKREC_INDIRECT_PARTIAL;
- }
-
- /* hook into the result list */
- newlock->next = lock;
- lock = newlock;
+ }
+ else {
+ /* DAV_GETLOCKS_PARTIAL */
+ newlock->rectype = DAV_LOCKREC_INDIRECT_PARTIAL;
+ }
+
+ /* hook into the result list */
+ newlock->next = lock;
+ lock = newlock;
}
*locks = lock;
@@ -1141,10 +1141,10 @@
}
static dav_error * dav_fs_find_lock(dav_lockdb *lockdb,
- const dav_resource *resource,
- const dav_locktoken *locktoken,
- int partial_ok,
- dav_lock **lock)
+ const dav_resource *resource,
+ const dav_locktoken *locktoken,
+ int partial_ok,
+ dav_lock **lock)
{
dav_error *err;
apr_datum_t key;
@@ -1155,58 +1155,58 @@
key = dav_fs_build_key(lockdb->info->pool, resource);
if ((err = dav_fs_load_lock_record(lockdb, key, DAV_CREATE_LIST,
- &dp, &ip)) != NULL) {
- /* ### push a higher-level desc? */
- return err;
+ &dp, &ip)) != NULL) {
+ /* ### push a higher-level desc? */
+ return err;
}
for (; dp != NULL; dp = dp->next) {
- if (!dav_compare_locktoken(locktoken, dp->locktoken)) {
- *lock = dav_fs_alloc_lock(lockdb, key, locktoken);
- (*lock)->is_locknull = !resource->exists;
- (*lock)->scope = dp->f.scope;
- (*lock)->type = dp->f.type;
- (*lock)->depth = dp->f.depth;
- (*lock)->timeout = dp->f.timeout;
- (*lock)->owner = dp->owner;
+ if (!dav_compare_locktoken(locktoken, dp->locktoken)) {
+ *lock = dav_fs_alloc_lock(lockdb, key, locktoken);
+ (*lock)->is_locknull = !resource->exists;
+ (*lock)->scope = dp->f.scope;
+ (*lock)->type = dp->f.type;
+ (*lock)->depth = dp->f.depth;
+ (*lock)->timeout = dp->f.timeout;
+ (*lock)->owner = dp->owner;
(*lock)->auth_user = dp->auth_user;
- return NULL;
- }
+ return NULL;
+ }
}
for (; ip != NULL; ip = ip->next) {
- if (!dav_compare_locktoken(locktoken, ip->locktoken)) {
- *lock = dav_fs_alloc_lock(lockdb, ip->key, locktoken);
- (*lock)->is_locknull = !resource->exists;
-
- /* ### nobody uses the resolving right now! */
- if (partial_ok) {
- (*lock)->rectype = DAV_LOCKREC_INDIRECT_PARTIAL;
- }
- else {
- (*lock)->rectype = DAV_LOCKREC_INDIRECT;
- if ((err = dav_fs_resolve(lockdb, ip, &dp,
- NULL, NULL)) != NULL) {
- /* ### push a higher-level desc? */
- return err;
- }
- (*lock)->scope = dp->f.scope;
- (*lock)->type = dp->f.type;
- (*lock)->depth = dp->f.depth;
- (*lock)->timeout = dp->f.timeout;
- (*lock)->owner = dp->owner;
+ if (!dav_compare_locktoken(locktoken, ip->locktoken)) {
+ *lock = dav_fs_alloc_lock(lockdb, ip->key, locktoken);
+ (*lock)->is_locknull = !resource->exists;
+
+ /* ### nobody uses the resolving right now! */
+ if (partial_ok) {
+ (*lock)->rectype = DAV_LOCKREC_INDIRECT_PARTIAL;
+ }
+ else {
+ (*lock)->rectype = DAV_LOCKREC_INDIRECT;
+ if ((err = dav_fs_resolve(lockdb, ip, &dp,
+ NULL, NULL)) != NULL) {
+ /* ### push a higher-level desc? */
+ return err;
+ }
+ (*lock)->scope = dp->f.scope;
+ (*lock)->type = dp->f.type;
+ (*lock)->depth = dp->f.depth;
+ (*lock)->timeout = dp->f.timeout;
+ (*lock)->owner = dp->owner;
(*lock)->auth_user = dp->auth_user;
- }
- return NULL;
- }
+ }
+ return NULL;
+ }
}
return NULL;
}
static dav_error * dav_fs_has_locks(dav_lockdb *lockdb,
- const dav_resource *resource,
- int *locks_present)
+ const dav_resource *resource,
+ int *locks_present)
{
dav_error *err;
apr_datum_t key;
@@ -1214,8 +1214,8 @@
*locks_present = 0;
if ((err = dav_fs_really_open_lockdb(lockdb)) != NULL) {
- /* ### insert a higher-level error description */
- return err;
+ /* ### insert a higher-level error description */
+ return err;
}
/*
@@ -1223,7 +1223,7 @@
** locks for this resource. Just exit.
*/
if (lockdb->info->db == NULL)
- return NULL;
+ return NULL;
key = dav_fs_build_key(lockdb->info->pool, resource);
@@ -1233,9 +1233,9 @@
}
static dav_error * dav_fs_append_locks(dav_lockdb *lockdb,
- const dav_resource *resource,
- int make_indirect,
- const dav_lock *lock)
+ const dav_resource *resource,
+ int make_indirect,
+ const dav_lock *lock)
{
apr_pool_t *p = lockdb->info->pool;
dav_error *err;
@@ -1245,8 +1245,8 @@
key = dav_fs_build_key(lockdb->info->pool, resource);
if ((err = dav_fs_load_lock_record(lockdb, key, 0, &dp, &ip)) != NULL) {
- /* ### maybe add in a higher-level description */
- return err;
+ /* ### maybe add in a higher-level description */
+ return err;
}
/*
@@ -1255,70 +1255,70 @@
*/
if (make_indirect) {
- for (; lock != NULL; lock = lock->next) {
+ for (; lock != NULL; lock = lock->next) {
- /* ### this works for any <lock> rectype */
- dav_lock_indirect *newi = apr_pcalloc(p, sizeof(*newi));
+ /* ### this works for any <lock> rectype */
+ dav_lock_indirect *newi = apr_pcalloc(p, sizeof(*newi));
- /* ### shut off the const warning for now */
- newi->locktoken = (dav_locktoken *)lock->locktoken;
- newi->timeout = lock->timeout;
- newi->key = lock->info->key;
- newi->next = ip;
- ip = newi;
- }
+ /* ### shut off the const warning for now */
+ newi->locktoken = (dav_locktoken *)lock->locktoken;
+ newi->timeout = lock->timeout;
+ newi->key = lock->info->key;
+ newi->next = ip;
+ ip = newi;
+ }
}
else {
- for (; lock != NULL; lock = lock->next) {
- /* create and link in the right kind of lock */
+ for (; lock != NULL; lock = lock->next) {
+ /* create and link in the right kind of lock */
- if (lock->rectype == DAV_LOCKREC_DIRECT) {
- dav_lock_discovery *newd = apr_pcalloc(p, sizeof(*newd));
+ if (lock->rectype == DAV_LOCKREC_DIRECT) {
+ dav_lock_discovery *newd = apr_pcalloc(p, sizeof(*newd));
- newd->f.scope = lock->scope;
- newd->f.type = lock->type;
- newd->f.depth = lock->depth;
- newd->f.timeout = lock->timeout;
- /* ### shut off the const warning for now */
- newd->locktoken = (dav_locktoken *)lock->locktoken;
- newd->owner = lock->owner;
+ newd->f.scope = lock->scope;
+ newd->f.type = lock->type;
+ newd->f.depth = lock->depth;
+ newd->f.timeout = lock->timeout;
+ /* ### shut off the const warning for now */
+ newd->locktoken = (dav_locktoken *)lock->locktoken;
+ newd->owner = lock->owner;
newd->auth_user = lock->auth_user;
- newd->next = dp;
- dp = newd;
- }
- else {
- /* DAV_LOCKREC_INDIRECT(_PARTIAL) */
-
- dav_lock_indirect *newi = apr_pcalloc(p, sizeof(*newi));
-
- /* ### shut off the const warning for now */
- newi->locktoken = (dav_locktoken *)lock->locktoken;
- newi->key = lock->info->key;
- newi->next = ip;
- ip = newi;
- }
- }
+ newd->next = dp;
+ dp = newd;
+ }
+ else {
+ /* DAV_LOCKREC_INDIRECT(_PARTIAL) */
+
+ dav_lock_indirect *newi = apr_pcalloc(p, sizeof(*newi));
+
+ /* ### shut off the const warning for now */
+ newi->locktoken = (dav_locktoken *)lock->locktoken;
+ newi->key = lock->info->key;
+ newi->next = ip;
+ ip = newi;
+ }
+ }
}
if ((err = dav_fs_save_lock_record(lockdb, key, dp, ip)) != NULL) {
- /* ### maybe add a higher-level description */
- return err;
+ /* ### maybe add a higher-level description */
+ return err;
}
/* we have a special list for recording locknull resources */
/* ### ack! this can add two copies to the locknull list */
if (!resource->exists
- && (err = dav_fs_add_locknull_state(lockdb, resource)) != NULL) {
- /* ### maybe add a higher-level description */
- return err;
+ && (err = dav_fs_add_locknull_state(lockdb, resource)) != NULL) {
+ /* ### maybe add a higher-level description */
+ return err;
}
return NULL;
}
static dav_error * dav_fs_remove_lock(dav_lockdb *lockdb,
- const dav_resource *resource,
- const dav_locktoken *locktoken)
+ const dav_resource *resource,
+ const dav_locktoken *locktoken)
{
dav_error *err;
dav_buffer buf = { 0 };
@@ -1329,36 +1329,36 @@
key = dav_fs_build_key(lockdb->info->pool, resource);
if (locktoken != NULL) {
- dav_lock_discovery *dp;
- dav_lock_discovery *dprev = NULL;
- dav_lock_indirect *ip;
- dav_lock_indirect *iprev = NULL;
-
- if ((err = dav_fs_load_lock_record(lockdb, key, DAV_CREATE_LIST,
- &dh, &ih)) != NULL) {
- /* ### maybe add a higher-level description */
- return err;
- }
-
- for (dp = dh; dp != NULL; dp = dp->next) {
- if (dav_compare_locktoken(locktoken, dp->locktoken) == 0) {
- if (dprev)
- dprev->next = dp->next;
- else
- dh = dh->next;
- }
- dprev = dp;
- }
-
- for (ip = ih; ip != NULL; ip = ip->next) {
- if (dav_compare_locktoken(locktoken, ip->locktoken) == 0) {
- if (iprev)
- iprev->next = ip->next;
- else
- ih = ih->next;
- }
- iprev = ip;
- }
+ dav_lock_discovery *dp;
+ dav_lock_discovery *dprev = NULL;
+ dav_lock_indirect *ip;
+ dav_lock_indirect *iprev = NULL;
+
+ if ((err = dav_fs_load_lock_record(lockdb, key, DAV_CREATE_LIST,
+ &dh, &ih)) != NULL) {
+ /* ### maybe add a higher-level description */
+ return err;
+ }
+
+ for (dp = dh; dp != NULL; dp = dp->next) {
+ if (dav_compare_locktoken(locktoken, dp->locktoken) == 0) {
+ if (dprev)
+ dprev->next = dp->next;
+ else
+ dh = dh->next;
+ }
+ dprev = dp;
+ }
+
+ for (ip = ih; ip != NULL; ip = ip->next) {
+ if (dav_compare_locktoken(locktoken, ip->locktoken) == 0) {
+ if (iprev)
+ iprev->next = ip->next;
+ else
+ ih = ih->next;
+ }
+ iprev = ip;
+ }
}
@@ -1379,38 +1379,38 @@
** any because a precondition is that none exist).
*/
if (!resource->exists && dh == NULL && ih == NULL
- && (err = dav_fs_remove_locknull_member(lockdb->info->pool,
- dav_fs_pathname(resource),
- &buf)) != NULL) {
- /* ### maybe add a higher-level description */
- return err;
+ && (err = dav_fs_remove_locknull_member(lockdb->info->pool,
+ dav_fs_pathname(resource),
+ &buf)) != NULL) {
+ /* ### maybe add a higher-level description */
+ return err;
}
return NULL;
}
static int dav_fs_do_refresh(dav_lock_discovery *dp,
- const dav_locktoken_list *ltl,
- time_t new_time)
+ const dav_locktoken_list *ltl,
+ time_t new_time)
{
int dirty = 0;
for (; ltl != NULL; ltl = ltl->next) {
- if (dav_compare_locktoken(dp->locktoken, ltl->locktoken) == 0)
- {
- dp->f.timeout = new_time;
- dirty = 1;
- }
+ if (dav_compare_locktoken(dp->locktoken, ltl->locktoken) == 0)
+ {
+ dp->f.timeout = new_time;
+ dirty = 1;
+ }
}
return dirty;
}
static dav_error * dav_fs_refresh_locks(dav_lockdb *lockdb,
- const dav_resource *resource,
- const dav_locktoken_list *ltl,
- time_t new_time,
- dav_lock **locks)
+ const dav_resource *resource,
+ const dav_locktoken_list *ltl,
+ time_t new_time,
+ dav_lock **locks)
{
dav_error *err;
apr_datum_t key;
@@ -1424,71 +1424,71 @@
key = dav_fs_build_key(lockdb->info->pool, resource);
if ((err = dav_fs_load_lock_record(lockdb, key, DAV_CREATE_LIST,
- &dp, &ip)) != NULL) {
- /* ### maybe add in a higher-level description */
- return err;
+ &dp, &ip)) != NULL) {
+ /* ### maybe add in a higher-level description */
+ return err;
}
/* ### we should be refreshing direct AND (resolved) indirect locks! */
/* refresh all of the direct locks on this resource */
for (dp_scan = dp; dp_scan != NULL; dp_scan = dp_scan->next) {
- if (dav_fs_do_refresh(dp_scan, ltl, new_time)) {
- /* the lock was refreshed. return the lock. */
- newlock = dav_fs_alloc_lock(lockdb, key, dp_scan->locktoken);
- newlock->is_locknull = !resource->exists;
- newlock->scope = dp_scan->f.scope;
- newlock->type = dp_scan->f.type;
- newlock->depth = dp_scan->f.depth;
- newlock->timeout = dp_scan->f.timeout;
- newlock->owner = dp_scan->owner;
+ if (dav_fs_do_refresh(dp_scan, ltl, new_time)) {
+ /* the lock was refreshed. return the lock. */
+ newlock = dav_fs_alloc_lock(lockdb, key, dp_scan->locktoken);
+ newlock->is_locknull = !resource->exists;
+ newlock->scope = dp_scan->f.scope;
+ newlock->type = dp_scan->f.type;
+ newlock->depth = dp_scan->f.depth;
+ newlock->timeout = dp_scan->f.timeout;
+ newlock->owner = dp_scan->owner;
newlock->auth_user = dp_scan->auth_user;
- newlock->next = *locks;
- *locks = newlock;
+ newlock->next = *locks;
+ *locks = newlock;
- dirty = 1;
- }
+ dirty = 1;
+ }
}
/* if we refreshed any locks, then save them back. */
if (dirty
- && (err = dav_fs_save_lock_record(lockdb, key, dp, ip)) != NULL) {
- /* ### maybe add in a higher-level description */
- return err;
+ && (err = dav_fs_save_lock_record(lockdb, key, dp, ip)) != NULL) {
+ /* ### maybe add in a higher-level description */
+ return err;
}
/* for each indirect lock, find its direct lock and refresh it. */
for (; ip != NULL; ip = ip->next) {
- dav_lock_discovery *ref_dp;
- dav_lock_indirect *ref_ip;
+ dav_lock_discovery *ref_dp;
+ dav_lock_indirect *ref_ip;
- if ((err = dav_fs_resolve(lockdb, ip, &dp_scan,
- &ref_dp, &ref_ip)) != NULL) {
- /* ### push a higher-level desc? */
- return err;
- }
- if (dav_fs_do_refresh(dp_scan, ltl, new_time)) {
- /* the lock was refreshed. return the lock. */
- newlock = dav_fs_alloc_lock(lockdb, ip->key, dp_scan->locktoken);
- newlock->is_locknull = !resource->exists;
- newlock->scope = dp_scan->f.scope;
- newlock->type = dp_scan->f.type;
- newlock->depth = dp_scan->f.depth;
- newlock->timeout = dp_scan->f.timeout;
- newlock->owner = dp_scan->owner;
+ if ((err = dav_fs_resolve(lockdb, ip, &dp_scan,
+ &ref_dp, &ref_ip)) != NULL) {
+ /* ### push a higher-level desc? */
+ return err;
+ }
+ if (dav_fs_do_refresh(dp_scan, ltl, new_time)) {
+ /* the lock was refreshed. return the lock. */
+ newlock = dav_fs_alloc_lock(lockdb, ip->key, dp_scan->locktoken);
+ newlock->is_locknull = !resource->exists;
+ newlock->scope = dp_scan->f.scope;
+ newlock->type = dp_scan->f.type;
+ newlock->depth = dp_scan->f.depth;
+ newlock->timeout = dp_scan->f.timeout;
+ newlock->owner = dp_scan->owner;
newlock->auth_user = dp_scan->auth_user;
- newlock->next = *locks;
- *locks = newlock;
+ newlock->next = *locks;
+ *locks = newlock;
- /* save the (resolved) direct lock back */
- if ((err = dav_fs_save_lock_record(lockdb, ip->key, ref_dp,
- ref_ip)) != NULL) {
- /* ### push a higher-level desc? */
- return err;
- }
- }
+ /* save the (resolved) direct lock back */
+ if ((err = dav_fs_save_lock_record(lockdb, ip->key, ref_dp,
+ ref_ip)) != NULL) {
+ /* ### push a higher-level desc? */
+ return err;
+ }
+ }
}
return NULL;
Modified: httpd/httpd/trunk/modules/dav/main/liveprop.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/dav/main/liveprop.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/main/liveprop.c (original)
+++ httpd/httpd/trunk/modules/dav/main/liveprop.c Thu Nov 10 07:05:51 2005
@@ -93,15 +93,15 @@
if (strcmp(ns_uri, uris[ns]) == 0)
break;
if (uris[ns] == NULL) {
- /* not our property (the namespace matched none of ours) */
- return 0;
+ /* not our property (the namespace matched none of ours) */
+ return 0;
}
/* second: look for the property in the liveprop specs */
for (scan = group->specs; scan->name != NULL; ++scan)
- if (ns == scan->ns && strcmp(name, scan->name) == 0) {
+ if (ns == scan->ns && strcmp(name, scan->name) == 0) {
*hooks = group->hooks;
- return scan->propid;
+ return scan->propid;
}
/* not our property (same namespace, but no matching prop name) */
Modified: httpd/httpd/trunk/modules/debug/mod_dumpio.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/debug/mod_dumpio.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/debug/mod_dumpio.c (original)
+++ httpd/httpd/trunk/modules/debug/mod_dumpio.c Thu Nov 10 07:05:51 2005
@@ -49,7 +49,7 @@
conn_rec *c = f->c;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, c->base_server,
- "mod_dumpio: %s (%s-%s): %" APR_SIZE_T_FMT " bytes",
+ "mod_dumpio: %s (%s-%s): %" APR_SIZE_T_FMT " bytes",
f->frec->name,
(APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data",
b->type->name,
@@ -101,9 +101,9 @@
conn_rec *c = f->c;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, c->base_server,
- "mod_dumpio: %s [%s-%s] %" APR_OFF_T_FMT " readbytes",
+ "mod_dumpio: %s [%s-%s] %" APR_OFF_T_FMT " readbytes",
f->frec->name,
- whichmode(mode),
+ whichmode(mode),
((block) == APR_BLOCK_READ) ? "blocking" : "nonblocking",
readbytes) ;
@@ -115,7 +115,7 @@
}
} else {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, c->base_server,
- "mod_dumpio: %s - %d", f->frec->name, ret) ;
+ "mod_dumpio: %s - %d", f->frec->name, ret) ;
}
return APR_SUCCESS ;
@@ -161,10 +161,10 @@
* We know that SSL is CONNECTION + 5
*/
ap_register_output_filter("DUMPIO_OUT", dumpio_output_filter,
- NULL, AP_FTYPE_CONNECTION + 3) ;
+ NULL, AP_FTYPE_CONNECTION + 3) ;
ap_register_input_filter("DUMPIO_IN", dumpio_input_filter,
- NULL, AP_FTYPE_CONNECTION + 3) ;
+ NULL, AP_FTYPE_CONNECTION + 3) ;
ap_hook_pre_connection(dumpio_pre_conn, NULL, NULL, APR_HOOK_MIDDLE);
}
@@ -205,11 +205,11 @@
};
module AP_MODULE_DECLARE_DATA dumpio_module = {
- STANDARD20_MODULE_STUFF,
- NULL,
- NULL,
- dumpio_create_sconfig,
- NULL,
- dumpio_cmds,
- dumpio_register_hooks
+ STANDARD20_MODULE_STUFF,
+ NULL,
+ NULL,
+ dumpio_create_sconfig,
+ NULL,
+ dumpio_cmds,
+ dumpio_register_hooks
};
Modified: httpd/httpd/trunk/modules/experimental/mod_case_filter.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/experimental/mod_case_filter.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/experimental/mod_case_filter.c (original)
+++ httpd/httpd/trunk/modules/experimental/mod_case_filter.c Thu Nov 10 07:05:51 2005
@@ -44,16 +44,16 @@
static void CaseFilterInsertFilter(request_rec *r)
{
CaseFilterConfig *pConfig=ap_get_module_config(r->server->module_config,
- &case_filter_module);
+ &case_filter_module);
if(!pConfig->bEnabled)
- return;
+ return;
ap_add_output_filter(s_szCaseFilterName,NULL,r,r->connection);
}
static apr_status_t CaseFilterOutFilter(ap_filter_t *f,
- apr_bucket_brigade *pbbIn)
+ apr_bucket_brigade *pbbIn)
{
request_rec *r = f->r;
conn_rec *c = r->connection;
@@ -65,31 +65,31 @@
pbktIn != APR_BRIGADE_SENTINEL(pbbIn);
pbktIn = APR_BUCKET_NEXT(pbktIn))
{
- const char *data;
- apr_size_t len;
- char *buf;
- apr_size_t n;
- apr_bucket *pbktOut;
-
- if(APR_BUCKET_IS_EOS(pbktIn))
- {
- apr_bucket *pbktEOS=apr_bucket_eos_create(c->bucket_alloc);
- APR_BRIGADE_INSERT_TAIL(pbbOut,pbktEOS);
- continue;
- }
-
- /* read */
- apr_bucket_read(pbktIn,&data,&len,APR_BLOCK_READ);
-
- /* write */
- buf = apr_bucket_alloc(len, c->bucket_alloc);
- for(n=0 ; n < len ; ++n)
- buf[n] = apr_toupper(data[n]);
-
- pbktOut = apr_bucket_heap_create(buf, len, apr_bucket_free,
- c->bucket_alloc);
- APR_BRIGADE_INSERT_TAIL(pbbOut,pbktOut);
- }
+ const char *data;
+ apr_size_t len;
+ char *buf;
+ apr_size_t n;
+ apr_bucket *pbktOut;
+
+ if(APR_BUCKET_IS_EOS(pbktIn))
+ {
+ apr_bucket *pbktEOS=apr_bucket_eos_create(c->bucket_alloc);
+ APR_BRIGADE_INSERT_TAIL(pbbOut,pbktEOS);
+ continue;
+ }
+
+ /* read */
+ apr_bucket_read(pbktIn,&data,&len,APR_BLOCK_READ);
+
+ /* write */
+ buf = apr_bucket_alloc(len, c->bucket_alloc);
+ for(n=0 ; n < len ; ++n)
+ buf[n] = apr_toupper(data[n]);
+
+ pbktOut = apr_bucket_heap_create(buf, len, apr_bucket_free,
+ c->bucket_alloc);
+ APR_BRIGADE_INSERT_TAIL(pbbOut,pbktOut);
+ }
/* XXX: is there any advantage to passing a brigade for each bucket? */
return ap_pass_brigade(f->next,pbbOut);
@@ -98,7 +98,7 @@
static const char *CaseFilterEnable(cmd_parms *cmd, void *dummy, int arg)
{
CaseFilterConfig *pConfig=ap_get_module_config(cmd->server->module_config,
- &case_filter_module);
+ &case_filter_module);
pConfig->bEnabled=arg;
return NULL;
@@ -115,7 +115,7 @@
{
ap_hook_insert_filter(CaseFilterInsertFilter,NULL,NULL,APR_HOOK_MIDDLE);
ap_register_output_filter(s_szCaseFilterName,CaseFilterOutFilter,NULL,
- AP_FTYPE_RESOURCE);
+ AP_FTYPE_RESOURCE);
}
module AP_MODULE_DECLARE_DATA case_filter_module =
Modified: httpd/httpd/trunk/modules/experimental/mod_example.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/experimental/mod_example.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/experimental/mod_example.c (original)
+++ httpd/httpd/trunk/modules/experimental/mod_example.c Thu Nov 10 07:05:51 2005
@@ -546,7 +546,7 @@
ap_rputs(" </H1>\n", r);
ap_rputs(" <P>\n", r);
ap_rprintf(r, " Apache HTTP Server version: \"%s\"\n",
- ap_get_server_version());
+ ap_get_server_version());
ap_rputs(" <BR>\n", r);
ap_rprintf(r, " Server built: \"%s\"\n", ap_get_server_built());
ap_rputs(" </P>\n", r);;
Modified: httpd/httpd/trunk/modules/filters/mod_charset_lite.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/filters/mod_charset_lite.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_charset_lite.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_charset_lite.c Thu Nov 10 07:05:51 2005
@@ -861,7 +861,7 @@
"can't open translation %s->%s",
dc->charset_source, dc->charset_default);
ctx->noop = 1;
- }
+ }
}
else {
ctx->noop = 1;
Modified: httpd/httpd/trunk/modules/generators/mod_asis.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/generators/mod_asis.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_asis.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_asis.c Thu Nov 10 07:05:51 2005
@@ -36,43 +36,43 @@
const char *location;
if(strcmp(r->handler,ASIS_MAGIC_TYPE) && strcmp(r->handler,"send-as-is"))
- return DECLINED;
+ return DECLINED;
r->allowed |= (AP_METHOD_BIT << M_GET);
if (r->method_number != M_GET)
- return DECLINED;
+ return DECLINED;
if (r->finfo.filetype == 0) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
- "File does not exist: %s", r->filename);
- return HTTP_NOT_FOUND;
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ "File does not exist: %s", r->filename);
+ return HTTP_NOT_FOUND;
}
if ((rv = apr_file_open(&f, r->filename, APR_READ,
APR_OS_DEFAULT, r->pool)) != APR_SUCCESS) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
- "file permissions deny server access: %s", r->filename);
- return HTTP_FORBIDDEN;
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ "file permissions deny server access: %s", r->filename);
+ return HTTP_FORBIDDEN;
}
ap_scan_script_header_err(r, f, NULL);
location = apr_table_get(r->headers_out, "Location");
if (location && location[0] == '/' &&
- ((r->status == HTTP_OK) || ap_is_HTTP_REDIRECT(r->status))) {
+ ((r->status == HTTP_OK) || ap_is_HTTP_REDIRECT(r->status))) {
- apr_file_close(f);
+ apr_file_close(f);
- /* Internal redirect -- fake-up a pseudo-request */
- r->status = HTTP_OK;
+ /* Internal redirect -- fake-up a pseudo-request */
+ r->status = HTTP_OK;
- /* This redirect needs to be a GET no matter what the original
- * method was.
- */
- r->method = apr_pstrdup(r->pool, "GET");
- r->method_number = M_GET;
+ /* This redirect needs to be a GET no matter what the original
+ * method was.
+ */
+ r->method = apr_pstrdup(r->pool, "GET");
+ r->method_number = M_GET;
- ap_internal_redirect_handler(location, r);
- return OK;
+ ap_internal_redirect_handler(location, r);
+ return OK;
}
if (!r->header_only) {
Modified: httpd/httpd/trunk/modules/generators/mod_cgid.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/generators/mod_cgid.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_cgid.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_cgid.c Thu Nov 10 07:05:51 2005
@@ -635,8 +635,8 @@
#if defined(ENETDOWN)
if (errno == ENETDOWN) {
/* The network has been shut down, no need to continue. Die gracefully */
- ++daemon_should_exit;
- }
+ ++daemon_should_exit;
+ }
#endif
if (errno != EINTR) {
ap_log_error(APLOG_MARK, APLOG_ERR, errno,
Modified: httpd/httpd/trunk/modules/http/http_core.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/http/http_core.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_core.c (original)
+++ httpd/httpd/trunk/modules/http/http_core.c Thu Nov 10 07:05:51 2005
@@ -42,7 +42,7 @@
AP_DECLARE_DATA ap_filter_rec_t *ap_byterange_filter_handle;
static const char *set_keep_alive_timeout(cmd_parms *cmd, void *dummy,
- const char *arg)
+ const char *arg)
{
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
if (err != NULL) {
@@ -54,7 +54,7 @@
}
static const char *set_keep_alive(cmd_parms *cmd, void *dummy,
- const char *arg)
+ const char *arg)
{
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
if (err != NULL) {
@@ -65,16 +65,16 @@
* so we accept anything but "Off" or "0" as "On"
*/
if (!strcasecmp(arg, "off") || !strcmp(arg, "0")) {
- cmd->server->keep_alive = 0;
+ cmd->server->keep_alive = 0;
}
else {
- cmd->server->keep_alive = 1;
+ cmd->server->keep_alive = 1;
}
return NULL;
}
static const char *set_keep_alive_max(cmd_parms *cmd, void *dummy,
- const char *arg)
+ const char *arg)
{
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
if (err != NULL) {
Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/http/http_filters.c?rev=332305&r1=332304&r2=332305&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Thu Nov 10 07:05:51 2005
@@ -782,7 +782,7 @@
&core_module);
if (conf->trace_enable == AP_TRACE_DISABLE) {
- apr_table_setn(r->notes, "error-notes",
+ apr_table_setn(r->notes, "error-notes",
"TRACE denied by server configuration");
return HTTP_FORBIDDEN;
}
@@ -804,7 +804,7 @@
if (r->remaining > 0) {
if (r->remaining > 65536) {
- apr_table_setn(r->notes, "error-notes",
+ apr_table_setn(r->notes, "error-notes",
"Extended TRACE request bodies cannot exceed 64k\n");
return HTTP_REQUEST_ENTITY_TOO_LARGE;
}
@@ -829,7 +829,7 @@
/* discard_rest_of_request_body into our buffer */
while (ap_get_client_block(r, bodyread, bodylen) > 0)
;
- apr_table_setn(r->notes, "error-notes",
+ apr_table_setn(r->notes, "error-notes",
"Extended TRACE request bodies cannot exceed 64k\n");
return HTTP_REQUEST_ENTITY_TOO_LARGE;
}