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/server provider.c
Date Sat, 30 Nov 2002 19:00:19 GMT
jerenkrantz    2002/11/30 11:00:19

  Modified:    include  Tag: APACHE_2_0_BRANCH ap_provider.h
               modules/dav/main Tag: APACHE_2_0_BRANCH providers.c
               server   Tag: APACHE_2_0_BRANCH provider.c
  Log:
  Backport of change made to HEAD:
  
  "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."
  
  Reviewed by:	Will Rowe
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.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.2.2
  retrieving revision 1.2.2.3
  diff -u -u -r1.2.2.2 -r1.2.2.3
  --- ap_provider.h	30 Nov 2002 18:45:23 -0000	1.2.2.2
  +++ ap_provider.h	30 Nov 2002 19:00:18 -0000	1.2.2.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
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.1  +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.10.2.1
  diff -u -u -r1.10 -r1.10.2.1
  --- providers.c	20 Sep 2002 00:57:50 -0000	1.10
  +++ providers.c	30 Nov 2002 19:00:18 -0000	1.10.2.1
  @@ -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");
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +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.2.2
  retrieving revision 1.1.2.3
  diff -u -u -r1.1.2.2 -r1.1.2.3
  --- provider.c	30 Nov 2002 18:45:23 -0000	1.1.2.2
  +++ provider.c	30 Nov 2002 19:00:18 -0000	1.1.2.3
  @@ -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);
   }
  
  
  

Mime
View raw message