Browse Source

added MOVE, COPY, PROPPATCH and nearly complete PROPFIND (Level 1-3 of litmus passed)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@593 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.2
Jan Kneschke 17 years ago
parent
commit
163c25a2a9
  1. 39
      configure.in
  2. 4
      src/Makefile.am
  3. 4
      src/connections.c
  4. 3
      src/keyvalue.c
  5. 2
      src/keyvalue.h
  6. 1298
      src/mod_webdav.c
  7. 4
      src/request.c

39
configure.in

@ -268,9 +268,20 @@ AC_ARG_WITH(gamin, AC_HELP_STRING([--with-gamin],[gamin for reducing number of s
AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
])
],[AC_MSG_RESULT(no)])
AC_SUBST(FAM_LIB)
AC_MSG_CHECKING(for properties in mod_webdav)
AC_ARG_WITH(webdav-props, AC_HELP_STRING([--with-webdav-props],[properties in mod_webdav]),
[AC_MSG_RESULT(yes)
PKG_CHECK_MODULES(XML, libxml-2.0, [
AC_DEFINE([HAVE_LIBXML2], [1], [libxml2])
AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h])
])
PKG_CHECK_MODULES(SQLITE, sqlite3, [
AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
])
],[AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for gdbm)
AC_ARG_WITH(gdbm, AC_HELP_STRING([--with-gdbm],[gdbm storage for mod_trigger_b4_dl]),
@ -292,7 +303,7 @@ AC_ARG_WITH(memcache, AC_HELP_STRING([--with-memcache],[memcached storage for mo
AC_CHECK_HEADERS([memcache.h],[
MEMCACHE_LIB=-lmemcache
AC_DEFINE([HAVE_MEMCACHE], [1], [libmemcache])
AC_DEFINE([HAVE_MEMCACHE_H], [1])
AC_DEFINE([HAVE_MEMCACHE_H], [1], [memcache.h])
])
])
],[AC_MSG_RESULT(no)])
@ -301,14 +312,22 @@ AC_SUBST(MEMCACHE_LIB)
AC_MSG_CHECKING(for lua)
AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
[AC_MSG_RESULT(yes)
AC_CHECK_LIB(lua, lua_open, [
AC_PATH_PROG(LUACONFIG, lua-config)
if test x"$LUACONFIG" != x; then
LUA_CFLAGS=`$LUACONFIG --include`
LUA_LIB=`$LUACONFIG --libs --extralibs`
else
AC_CHECK_LIB(lua, lua_open, [
AC_CHECK_HEADERS([lua.h],[
LUA_LIB="-llua -llualib -lm"
LUA_LIB=-llua
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
])
])
])
fi
],[AC_MSG_RESULT(no)])
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIB)
@ -548,12 +567,18 @@ else
fi
features="stat-cache-fam"
if test ! "x$FAM_LIB" = x; then
if test ! "x$FAM_LIBS" = x; then
enable_feature="$enable_feature $features"
else
disable_feature="$disable_feature $features"
fi
features="webdav-properties"
if test "x$XML_LIBS" \!= x -a "x$SQLITE_LIBS" \!= x; then
enable_feature="$enable_feature $features"
else
disable_feature="$disable_feature $features"
fi
## post processing
do_build=`echo $do_build | sed 's/ /\n/g' | sort`

4
src/Makefile.am

@ -70,11 +70,13 @@ endif
lib_LTLIBRARIES += mod_webdav.la
mod_webdav_la_SOURCES = mod_webdav.c
mod_webdav_la_CFLAGS = $(XML_CFLAGS)
mod_webdav_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_webdav_la_LIBADD = $(common_libadd)
mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS)
lib_LTLIBRARIES += mod_cml.la
mod_cml_la_SOURCES = mod_cml.c mod_cml_lua.c mod_cml_funcs.c
mod_cml_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
mod_cml_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_cml_la_LIBADD = $(MEMCACHE_LIB) $(common_libadd) $(LUA_LIB)

4
src/connections.c

@ -306,6 +306,10 @@ static int connection_handle_write_prepare(server *srv, connection *con) {
case HTTP_METHOD_PUT:
case HTTP_METHOD_MKCOL:
case HTTP_METHOD_DELETE:
case HTTP_METHOD_COPY:
case HTTP_METHOD_MOVE:
case HTTP_METHOD_PROPFIND:
case HTTP_METHOD_PROPPATCH:
break;
case HTTP_METHOD_OPTIONS:
if (con->uri.path->ptr[0] != '*') {

3
src/keyvalue.c

@ -16,10 +16,13 @@ static keyvalue http_methods[] = {
{ HTTP_METHOD_POST, "POST" },
{ HTTP_METHOD_HEAD, "HEAD" },
{ HTTP_METHOD_PROPFIND, "PROPFIND" },
{ HTTP_METHOD_PROPPATCH, "PROPPATCH" },
{ HTTP_METHOD_OPTIONS, "OPTIONS" },
{ HTTP_METHOD_MKCOL, "MKCOL" },
{ HTTP_METHOD_PUT, "PUT" },
{ HTTP_METHOD_DELETE, "DELETE" },
{ HTTP_METHOD_COPY, "COPY" },
{ HTTP_METHOD_MOVE, "MOVE" },
{ HTTP_METHOD_UNSET, NULL }
};

2
src/keyvalue.h

@ -7,7 +7,7 @@
# include <pcre.h>
#endif
typedef enum { HTTP_METHOD_UNSET = -1, HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_HEAD, HTTP_METHOD_PROPFIND, HTTP_METHOD_OPTIONS, HTTP_METHOD_MKCOL, HTTP_METHOD_PUT, HTTP_METHOD_DELETE } http_method_t;
typedef enum { HTTP_METHOD_UNSET = -1, HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_HEAD, HTTP_METHOD_PROPFIND, HTTP_METHOD_OPTIONS, HTTP_METHOD_MKCOL, HTTP_METHOD_PUT, HTTP_METHOD_DELETE, HTTP_METHOD_COPY, HTTP_METHOD_MOVE, HTTP_METHOD_PROPPATCH } http_method_t;
typedef enum { HTTP_VERSION_UNSET = -1, HTTP_VERSION_1_0, HTTP_VERSION_1_1 } http_version_t;
typedef struct {

1298
src/mod_webdav.c

File diff suppressed because it is too large

4
src/request.c

@ -958,10 +958,12 @@ int http_request_parse(server *srv, connection *con) {
{
server_socket *srv_socket = con->srv_socket;
#if 0
if (con->request.http_content_type == NULL) {
log_error_write(srv, __FILE__, __LINE__, "s",
"POST request, but content-type not set");
"Content-Length request, but content-type not set");
}
#endif
if (con_length_set == 0) {
/* content-length is missing */

Loading…
Cancel
Save