httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/dav/main mod_dav.c mod_dav.h
Date Fri, 07 Jul 2000 07:58:16 GMT
gstein      00/07/07 00:58:15

  Modified:    src/modules/dav/fs Makefile.in config.m4 repos.h
               src/modules/dav/main mod_dav.c mod_dav.h
  Added:       src/modules/dav/fs mod_dav_fs.c
  Log:
  turn dav/fs/ into a real module
  move the DAVLockDB directive to the dav_fs module
  
  Revision  Changes    Path
  1.2       +1 -1      apache-2.0/src/modules/dav/fs/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/dav/fs/Makefile.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Makefile.in	2000/06/28 09:49:10	1.1
  +++ Makefile.in	2000/07/07 07:58:10	1.2
  @@ -1,5 +1,5 @@
   
   LTLIBRARY_NAME    = libapachemod_dav_fs.la
  -LTLIBRARY_SOURCES = dbm.c lock.c repos.c
  +LTLIBRARY_SOURCES = mod_dav_fs.c dbm.c lock.c repos.c
   
   include $(top_srcdir)/build/ltlib.mk
  
  
  
  1.3       +1 -21     apache-2.0/src/modules/dav/fs/config.m4
  
  Index: config.m4
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/dav/fs/config.m4,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- config.m4	2000/07/01 14:08:24	1.2
  +++ config.m4	2000/07/07 07:58:11	1.3
  @@ -2,29 +2,9 @@
   
   APACHE_MODPATH_INIT(dav/fs)
   
  -dnl ### dav_fs is not a module, but we want to have it enabled/disabled
  -dnl ### like one. with a bit o' work, dav_fs *will* become a true module.
  -
  -dnl ### this is snarfed from APACHE_MODULE. it does not allow dav_fs to be
  -dnl ### shared, and it does not add it into MODLIST. basically... it is
  -dnl ### just a static library to link into Apache at this point
  -AC_DEFUN(DAV_FS_MODULE,[
  -  AC_MSG_CHECKING(whether to enable mod_$1)
  -  define([optname],[  --]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
  -  AC_ARG_ENABLE(translit($1,_,-),optname() substr([                         ],len(optname()))$2,,enable_$1=ifelse($5,,no,$5))
  -  undefine([optname])dnl
  -  AC_MSG_RESULT($enable_$1)
  -  if test "$enable_$1" != "no"; then
  -    APACHE_MODPATH_ADD($1, , $3)
  -  fi
  -])dnl
  -
  -
   dnl ### we want to default this based on whether dav is being used...
   dnl ### but there is no ordering to the config.m4 files right now...
  -DAV_FS_MODULE(dav_fs, DAV provider for the filesystem, , , no)
  -
  -
  +APACHE_MODULE(dav_fs, DAV provider for the filesystem, , , no)
   if test "$enable_dav_fs" = "yes"; then
     apache_need_sdbm=yes
   fi
  
  
  
  1.5       +3 -0      apache-2.0/src/modules/dav/fs/repos.h
  
  Index: repos.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/dav/fs/repos.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- repos.h	2000/07/07 02:22:17	1.4
  +++ repos.h	2000/07/07 07:58:11	1.5
  @@ -92,5 +92,8 @@
   void dav_dbm_get_statefiles(ap_pool_t *p, const char *fname,
   			    const char **state1, const char **state2);
   
  +/* where is the lock database located? */
  +const char *dav_get_lockdb_path(const request_rec *r);
  +
   
   #endif /* _DAV_FS_REPOS_H_ */
  
  
  
  1.1                  apache-2.0/src/modules/dav/fs/mod_dav_fs.c
  
  Index: mod_dav_fs.c
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  #include "httpd.h"
  #include "http_config.h"
  
  #include "mod_dav.h"
  #include "repos.h"
  
  /* per-server configuration */
  typedef struct {
      const char *lockdb_path;
  
  } dav_fs_server_conf;
  
  extern module MODULE_VAR_EXPORT dav_fs_module;
  
  const char *dav_get_lockdb_path(const request_rec *r)
  {
      dav_fs_server_conf *conf;
  
      conf = ap_get_module_config(r->server->module_config, &dav_fs_module);
      return conf->lockdb_path;
  }
  
  static void *dav_fs_create_server_config(ap_pool_t *p, server_rec *s)
  {
      return ap_pcalloc(p, sizeof(dav_fs_server_conf));
  }
  
  static void *dav_fs_merge_server_config(ap_pool_t *p,
                                          void *base, void *overrides)
  {
      dav_fs_server_conf *parent = base;
      dav_fs_server_conf *child = overrides;
      dav_fs_server_conf *newconf;
  
      newconf = ap_pcalloc(p, sizeof(*newconf));
  
      newconf->lockdb_path =
          child->lockdb_path ? child->lockdb_path : parent->lockdb_path;
  
      return newconf;
  }
  
  /*
   * Command handler for the DAVLockDB directive, which is TAKE1
   */
  static const char *dav_fs_cmd_davlockdb(cmd_parms *cmd, void *config,
                                          const char *arg1)
  {
      dav_fs_server_conf *conf;
  
      conf = ap_get_module_config(cmd->server->module_config,
                                  &dav_fs_module);
      arg1 = ap_os_canonical_filename(cmd->pool, arg1);
      conf->lockdb_path = ap_server_root_relative(cmd->pool, arg1);
  
      return NULL;
  }
  
  static const command_rec dav_fs_cmds[] =
  {
      /* per server */
      AP_INIT_TAKE1("DAVLockDB", dav_fs_cmd_davlockdb, NULL, RSRC_CONF,
                    "specify a lock database"),
  
      { NULL }
  };
  
  static void register_hooks(void)
  {
      /* nothing yet */
  }
  
  module MODULE_VAR_EXPORT dav_fs_module =
  {
      STANDARD20_MODULE_STUFF,
      NULL,			/* dir config creater */
      NULL,			/* dir merger --- default is to override */
      dav_fs_create_server_config,	/* server config */
      dav_fs_merge_server_config,	/* merge server config */
      dav_fs_cmds,		/* command table */
      NULL,                       /* handlers */
      register_hooks,             /* register hooks */
  };
  
  
  
  1.8       +5 -35     apache-2.0/src/modules/dav/main/mod_dav.c
  
  Index: mod_dav.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/dav/main/mod_dav.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- mod_dav.c	2000/07/04 00:28:25	1.7
  +++ mod_dav.c	2000/07/07 07:58:13	1.8
  @@ -121,8 +121,6 @@
   
   /* per-server configuration */
   typedef struct {
  -    const char *lockdb_path;	/* lock database path */
  -
       uuid_state st;		/* UUID state for opaquelocktoken */
   
   } dav_server_conf;
  @@ -218,7 +216,6 @@
   
       newconf = (dav_server_conf *) ap_pcalloc(p, sizeof(*newconf));
   
  -    newconf->lockdb_path = NULL;
       dav_create_uuid_state(&newconf->st);
   
       return newconf;
  @@ -226,14 +223,16 @@
   
   static void *dav_merge_server_config(ap_pool_t *p, void *base, void *overrides)
   {
  -    dav_server_conf *parent = base;
       dav_server_conf *child = overrides;
       dav_server_conf *newconf;
   
       newconf = (dav_server_conf *) ap_pcalloc(p, sizeof(*newconf));
  -
  -    newconf->lockdb_path = DAV_INHERIT_VALUE(parent, child, lockdb_path);
   
  +    /* ### hmm. we should share the uuid state rather than copy it. if we
  +       ### do another merge, then we'll just get the old one, rather than
  +       ### an updated state.
  +       ### of course... the UUID generation should move into APR
  +    */
       memcpy(&newconf->st, &child->st, sizeof(newconf->st));
   
       return newconf;
  @@ -325,14 +324,6 @@
       return &conf->st;
   }
   
  -const char *dav_get_lockdb_path(const request_rec *r)
  -{
  -    dav_server_conf *conf;
  -
  -    conf = ap_get_module_config(r->server->module_config, &dav_module);
  -    return conf->lockdb_path;
  -}
  -
   ap_table_t *dav_get_dir_params(const request_rec *r)
   {
       dav_dir_conf *conf;
  @@ -357,7 +348,6 @@
       const dav_dyn_hooks *hooks;
       static const dav_dyn_hooks null_hooks = { { 0 } };
   
  -    /* Call repository hook to resolve resource */
       conf = (dav_dir_conf *) ap_get_module_config(r->per_dir_config,
   						 &dav_module);
       switch (provider_type) {
  @@ -431,22 +421,6 @@
   }
   
   /*
  - * Command handler for the DAVLockDB directive, which is TAKE1
  - */
  -static const char *dav_cmd_davlockdb(cmd_parms *cmd, void *config,
  -                                     const char *arg1)
  -{
  -    dav_server_conf *conf;
  -
  -    conf = (dav_server_conf *) ap_get_module_config(cmd->server->module_config,
  -						    &dav_module);
  -    arg1 = ap_os_canonical_filename(cmd->pool, arg1);
  -    conf->lockdb_path = ap_server_root_relative(cmd->pool, arg1);
  -
  -    return NULL;
  -}
  -
  -/*
    * Command handler for DAVMinTimeout directive, which is TAKE1
    */
   static const char *dav_cmd_davmintimeout(cmd_parms *cmd, void *config,
  @@ -3265,10 +3239,6 @@
       /* per directory/location */
       AP_INIT_FLAG("DAV", dav_cmd_dav, NULL, ACCESS_CONF,
                    "turn DAV on/off for a directory or location"),
  -
  -    /* per server */
  -    AP_INIT_TAKE1("DAVLockDB", dav_cmd_davlockdb, NULL,	RSRC_CONF,
  -                  "specify a lock database"),
   
       /* per directory/location, or per server */
       AP_INIT_TAKE1("DAVMinTimeout", dav_cmd_davmintimeout, NULL,
  
  
  
  1.8       +0 -1      apache-2.0/src/modules/dav/main/mod_dav.h
  
  Index: mod_dav.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/dav/main/mod_dav.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- mod_dav.h	2000/07/07 02:23:07	1.7
  +++ mod_dav.h	2000/07/07 07:58:14	1.8
  @@ -933,7 +933,6 @@
   				    dav_buffer *pbuf);
   
   /* LockDB-related public lock functions */
  -const char *dav_get_lockdb_path(const request_rec *r);
   dav_error * dav_lock_parse_lockinfo(request_rec *r,
   				    const dav_resource *resrouce,
   				    dav_lockdb *lockdb,
  
  
  

Mime
View raw message