diff -u -r davfs2-0.2.1/src/davfsd.c davfs2-0.2.1_withlockopt/src/davfsd.c --- davfs2-0.2.1/src/davfsd.c 2002-10-14 08:34:02.000000000 +0800 +++ davfs2-0.2.1_withlockopt/src/davfsd.c 2003-04-17 16:15:02.000000000 +0800 @@ -66,6 +66,9 @@ static int count = 0; +/* use locks - default yes */ +static int davfs_locks = 1; + /* default stat */ struct stat generic_stat = { 0 /* dev */ , 0 /* pad */ , 0 /* inode */ , S_IFREG | 0666 /* mode */ , @@ -541,7 +544,7 @@ /* FIXME : Do we really need to check it? */ if (v->has_changed) { DBG1("saving the file %s ", v->local_name); - return_value = dav_put_unlock(v->real_name, v->local_name); + return_value = dav_put_unlock(v->real_name, v->local_name, davfs_locks); } if (v->is_dir==1) { @@ -657,7 +660,7 @@ else { /* If is is write or trunc (NULL lock) */ if (flags & C_O_WRITE) { - if (dav_lock(name)) { /* Lock fail?? */ + if (dav_lock(name, davfs_locks)) { /* Lock fail?? */ DBG1("LOCK failed: %s\n", name); out_buf->oh.result = dav_get_errno(); return NULL; @@ -758,6 +761,7 @@ /* Set mount point for signal out */ davfs_dev = ne_strdup(mopt.dev); // TODO: free this somewhere davfs_mpoint = ne_strdup(mopt.mpoint); //TODO: free this somewhere + davfs_locks = mopt.locks; setvbuf(stdout, NULL, _IONBF, 0); diff -u -r davfs2-0.2.1/src/util.c davfs2-0.2.1_withlockopt/src/util.c --- davfs2-0.2.1/src/util.c 2002-10-14 08:34:02.000000000 +0800 +++ davfs2-0.2.1_withlockopt/src/util.c 2003-04-17 16:05:52.000000000 +0800 @@ -85,6 +85,12 @@ *value++ = 0; /* Ignore option without value */ + + if(!strcmp(name, "nolock")) { + mopt->locks = 0; + return 1; + } + if(value==NULL) return 0; @@ -107,7 +113,7 @@ mopt->uid = atoi(value); return 1; } - + if(!strcmp(name, "mode")) { /* Length should be three */ if(strlen(value)==3) diff -u -r davfs2-0.2.1/src/util.h davfs2-0.2.1_withlockopt/src/util.h --- davfs2-0.2.1/src/util.h 2002-10-14 08:34:02.000000000 +0800 +++ davfs2-0.2.1_withlockopt/src/util.h 2003-04-17 16:01:02.000000000 +0800 @@ -72,6 +72,7 @@ mode_t mode; /* default mode */ char *option; /* Have all option data */ int merr; /* mount error */ + int locks; /* use locks - default = 1 (yes) */ } dav_mount_opt; /* Delete the item from /etc/mtab */ diff -u -r davfs2-0.2.1/src/webdav.c davfs2-0.2.1_withlockopt/src/webdav.c --- davfs2-0.2.1/src/webdav.c 2002-10-14 08:34:02.000000000 +0800 +++ davfs2-0.2.1_withlockopt/src/webdav.c 2003-04-17 16:17:28.000000000 +0800 @@ -601,10 +601,12 @@ } /* Lock the resource for write and save the lock to lock_store */ -int dav_lock(const char *name) { +int dav_lock(const char *name,int use_locks) { char *uri = resolve_path(path, name, 0); struct ne_lock *lock; - + if (!use_locks) { + return NE_OK; + } /* Let's lock the resource */ lock = ne_lock_create(); lock->depth = NE_DEPTH_ZERO; @@ -631,7 +633,7 @@ /* Get localfile and save it to the server * It should be locked */ -int dav_put_unlock(const char *name, const char *fname) { +int dav_put_unlock(const char *name, const char *fname, int use_locks) { int fd; int ret = NE_OK; char *uri = resolve_path(path, name, 0); @@ -649,7 +651,10 @@ ret = -1; } close(fd); - + if (!use_locks) { + NE_FREE(uri); + return ret; + } /* Lst's get the lock */ server.path = (char *)uri; /* Change path */ lock = ne_lockstore_findbyuri(lock_store, &server); diff -u -r davfs2-0.2.1/src/webdav.h davfs2-0.2.1_withlockopt/src/webdav.h --- davfs2-0.2.1/src/webdav.h 2002-10-14 08:34:02.000000000 +0800 +++ davfs2-0.2.1_withlockopt/src/webdav.h 2003-04-17 16:18:04.000000000 +0800 @@ -93,10 +93,10 @@ /* Lock the file */ -int dav_lock(const char *name); +int dav_lock(const char *name, int use_locks); /* Get localfile and save it to the server */ -int dav_put_unlock(const char *name, const char *fname); +int dav_put_unlock(const char *name, const char *fname, int use_locks); /* let's get stat */ int dav_stat(const char *name, struct stat *st,