httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: httpd-2.0/modules/dav/main providers.c
Date Sat, 30 Nov 2002 18:48:41 GMT
jerenkrantz    2002/11/30 10:48:41

  Modified:    include  ap_provider.h
               server   provider.c
               .        CHANGES
               modules/aaa mod_auth_basic.c mod_auth_digest.c
                        mod_authn_dbm.c mod_authn_file.c
               modules/dav/main providers.c
  Log:
  Per Greg's request, add a version string component to the ap_provider.h
  functions.  This allows modules to register different versions of the
  same provider.
  
  Revision  Changes    Path
  1.3       +5 -1      httpd-2.0/include/ap_provider.h
  
  Index: ap_provider.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/ap_provider.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- ap_provider.h	20 Sep 2002 01:00:53 -0000	1.2
  +++ ap_provider.h	30 Nov 2002 18:48:40 -0000	1.3
  @@ -67,12 +67,14 @@
    * @param pool The pool to create any storage from
    * @param provider_group The group to store the provider in
    * @param provider_name The name for this provider
  + * @param provider_version The version for this provider
    * @param provider Opaque structure for this provider
    * @return APR_SUCCESS if all went well
    */
   AP_DECLARE(apr_status_t) ap_register_provider(apr_pool_t *pool,
                                                 const char *provider_group,
                                                 const char *provider_name,
  +                                              const char *provider_version,
                                                 const void *provider);
   
   /**
  @@ -80,9 +82,11 @@
    * provider pool.
    * @param provider_group The group to look for this provider in
    * @param provider_name The name for the provider
  + * @param provider_version The version for the provider
    * @return provider pointer to provider if found, NULL otherwise
    */
   AP_DECLARE(void *) ap_lookup_provider(const char *provider_group,
  -                                      const char *provider_name);
  +                                      const char *provider_name,
  +                                      const char *provider_version);
   
   #endif
  
  
  
  1.2       +24 -4     httpd-2.0/server/provider.c
  
  Index: provider.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/provider.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- provider.c	20 Sep 2002 00:57:50 -0000	1.1
  +++ provider.c	30 Nov 2002 18:48:40 -0000	1.2
  @@ -69,9 +69,11 @@
   AP_DECLARE(apr_status_t) ap_register_provider(apr_pool_t *pool,
                                                 const char *provider_group,
                                                 const char *provider_name,
  +                                              const char *provider_version,
                                                 const void *provider)
   {
       apr_hash_t *provider_group_hash;
  +    apr_hash_t *provider_version_hash;
   
       if (global_providers == NULL) {
           global_providers = apr_hash_make(pool);
  @@ -89,17 +91,28 @@
           
       }
   
  +    provider_version_hash = apr_hash_get(provider_group_hash, provider_name,
  +                                         APR_HASH_KEY_STRING);
  +
  +    if (!provider_version_hash) {
  +        provider_version_hash = apr_hash_make(pool);
  +        apr_hash_set(provider_group_hash, provider_name, APR_HASH_KEY_STRING,
  +                     provider_version_hash);
  +        
  +    }
  +
       /* just set it. no biggy if it was there before. */
  -    apr_hash_set(provider_group_hash, provider_name, APR_HASH_KEY_STRING,
  +    apr_hash_set(provider_version_hash, provider_version, APR_HASH_KEY_STRING,
                    provider);
   
       return APR_SUCCESS;
   }
   
   AP_DECLARE(void *) ap_lookup_provider(const char *provider_group,
  -                                      const char *provider_name)
  +                                      const char *provider_name,
  +                                      const char *provider_version)
   {
  -    apr_hash_t *provider_group_hash;
  +    apr_hash_t *provider_group_hash, *provider_name_hash;
   
       if (global_providers == NULL) {
           return NULL;
  @@ -112,6 +125,13 @@
           return NULL;
       }
   
  -    return apr_hash_get(provider_group_hash, provider_name,
  +    provider_name_hash = apr_hash_get(provider_group_hash, provider_name,
  +                                      APR_HASH_KEY_STRING);
  +
  +    if (provider_name_hash == NULL) {
  +        return NULL;
  +    }
  +
  +    return apr_hash_get(provider_name_hash, provider_version,
                           APR_HASH_KEY_STRING);
   }
  
  
  
  1.998     +2 -2      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.997
  retrieving revision 1.998
  diff -u -u -r1.997 -r1.998
  --- CHANGES	30 Nov 2002 18:47:12 -0000	1.997
  +++ CHANGES	30 Nov 2002 18:48:40 -0000	1.998
  @@ -2,10 +2,10 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Add version string to provider API.  [Justin Erenkrantz]
  +
     *) Rewrite of aaa modules to an authn/authz model.
        [Dirk-Willem van Gulik, Justin Erenkrantz]
  -
  -
   
   Changes with Apache 2.0.44
   
  
  
  
  1.7       +2 -2      httpd-2.0/modules/aaa/mod_auth_basic.c
  
  Index: mod_auth_basic.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_auth_basic.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- mod_auth_basic.c	20 Sep 2002 00:57:49 -0000	1.6
  +++ mod_auth_basic.c	30 Nov 2002 18:48:40 -0000	1.7
  @@ -115,7 +115,7 @@
   
       /* lookup and cache the actual provider now */
       newp->provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
  -                                        newp->provider_name);
  +                                        newp->provider_name, "0");
   
       if (newp->provider == NULL) {
           /* by the time they use it, the provider should be loaded and
  @@ -256,7 +256,7 @@
            */
           if (!current_provider) {
               provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
  -                                          AUTHN_DEFAULT_PROVIDER);
  +                                          AUTHN_DEFAULT_PROVIDER, "0");
           }
           else {
               provider = current_provider->provider;
  
  
  
  1.73      +2 -2      httpd-2.0/modules/aaa/mod_auth_digest.c
  
  Index: mod_auth_digest.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_auth_digest.c,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -u -r1.72 -r1.73
  --- mod_auth_digest.c	20 Sep 2002 00:57:49 -0000	1.72
  +++ mod_auth_digest.c	30 Nov 2002 18:48:41 -0000	1.73
  @@ -506,7 +506,7 @@
   
       /* lookup and cache the actual provider now */
       newp->provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
  -                                        newp->provider_name);
  +                                        newp->provider_name, "0");
   
       if (newp->provider == NULL) {
          /* by the time they use it, the provider should be loaded and
  @@ -1476,7 +1476,7 @@
            */
           if (!current_provider) {
               provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP,
  -                                          AUTHN_DEFAULT_PROVIDER);
  +                                          AUTHN_DEFAULT_PROVIDER, "0");
           }
           else {
               provider = current_provider->provider;
  
  
  
  1.8       +2 -1      httpd-2.0/modules/aaa/mod_authn_dbm.c
  
  Index: mod_authn_dbm.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_authn_dbm.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -u -r1.7 -r1.8
  --- mod_authn_dbm.c	22 Sep 2002 05:18:33 -0000	1.7
  +++ mod_authn_dbm.c	30 Nov 2002 18:48:41 -0000	1.8
  @@ -191,7 +191,8 @@
   
   static void register_hooks(apr_pool_t *p)
   {
  -    ap_register_provider(p, AUTHN_PROVIDER_GROUP, "dbm", &authn_dbm_provider);
  +    ap_register_provider(p, AUTHN_PROVIDER_GROUP, "dbm", "0",
  +                         &authn_dbm_provider);
   }
   
   module AP_MODULE_DECLARE_DATA authn_dbm_module =
  
  
  
  1.6       +2 -1      httpd-2.0/modules/aaa/mod_authn_file.c
  
  Index: mod_authn_file.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_authn_file.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -u -r1.5 -r1.6
  --- mod_authn_file.c	20 Sep 2002 06:14:31 -0000	1.5
  +++ mod_authn_file.c	30 Nov 2002 18:48:41 -0000	1.6
  @@ -219,7 +219,8 @@
   
   static void register_hooks(apr_pool_t *p)
   {
  -    ap_register_provider(p, AUTHN_PROVIDER_GROUP, "file", &authn_file_provider);
  +    ap_register_provider(p, AUTHN_PROVIDER_GROUP, "file", "0",
  +                         &authn_file_provider);
   }
   
   module AP_MODULE_DECLARE_DATA authn_file_module =
  
  
  
  1.11      +2 -2      httpd-2.0/modules/dav/main/providers.c
  
  Index: providers.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/dav/main/providers.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -u -r1.10 -r1.11
  --- providers.c	20 Sep 2002 00:57:50 -0000	1.10
  +++ providers.c	30 Nov 2002 18:48:41 -0000	1.11
  @@ -62,10 +62,10 @@
   DAV_DECLARE(void) dav_register_provider(apr_pool_t *p, const char *name,
                                           const dav_provider *provider)
   {
  -    ap_register_provider(p, DAV_PROVIDER_GROUP, name, provider);
  +    ap_register_provider(p, DAV_PROVIDER_GROUP, name, "0", provider);
   }
   
   const dav_provider * dav_lookup_provider(const char *name)
   {
  -    return ap_lookup_provider(DAV_PROVIDER_GROUP, name);
  +    return ap_lookup_provider(DAV_PROVIDER_GROUP, name, "0");
   }
  
  
  

Mime
View raw message