[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] allow >1 URL schemes per RA plugin

From: Joe Orton <jorton_at_redhat.com>
Date: 2001-06-27 23:43:37 CEST

The ra_dav plugin can support SSL, which means https: scheme URLs, but
the current ra interface only allows one URL scheme per plugin. It could
have two seperate _init functions, but that seems a bit clunky. Is this
change okay?

Index: include/svn_ra.h
===================================================================
RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/include/svn_ra.h,v
retrieving revision 1.60
diff -u -r1.60 svn_ra.h
--- include/svn_ra.h 2001/06/12 17:41:27 1.60
+++ include/svn_ra.h 2001/06/27 21:33:19
@@ -196,10 +196,10 @@
    However, all "ra_FOO" implementations *must* export a function named
    `svn_ra_FOO_init()' of type `svn_ra_init_func_t'.
 
- When called by libsvn_client, this routine simply returns an
- internal, static plugin structure. In addition, it returns the URI
- scheme handled by this RA module. POOL is a pool for allocating
- configuration / one-time data.
+ When called by libsvn_client, this routine adds an entry (or
+ entries) to the hash table for any URL schemes it handles. The hash
+ value must be of type (svn_ra_plugin_t *). POOL is a pool for
+ allocating configuration / one-time data.
 
    This type is defined to use the "C Calling Conventions" to ensure that
    abi_version is the first parameter. The RA plugin must check that value
@@ -209,8 +209,7 @@
 */
 typedef svn_error_t *(*svn_ra_init_func_t) (int abi_version,
                                             apr_pool_t *pool,
- const char **url_scheme,
- const svn_ra_plugin_t **plugin);
+ apr_hash_t *hash);
 
 /* The current ABI (Application Binary Interface) version for the
    RA plugin model. This version number will change when the ABI
@@ -236,12 +235,10 @@
 
 svn_error_t * svn_ra_dav_init (int abi_version,
                                apr_pool_t *pool,
- const char **url_scheme,
- const svn_ra_plugin_t **plugin);
+ apr_hash_t *hash);
 svn_error_t * svn_ra_local_init (int abi_version,
                                  apr_pool_t *pool,
- const char **url_scheme,
- const svn_ra_plugin_t **plugin);
+ apr_hash_t *hash);
 
 
 
Index: libsvn_ra/ra_loader.c
===================================================================
RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_ra/ra_loader.c,v
retrieving revision 1.8
diff -u -r1.8 ra_loader.c
--- libsvn_ra/ra_loader.c 2001/06/13 09:10:33 1.8
+++ libsvn_ra/ra_loader.c 2001/06/27 21:33:19
@@ -147,14 +147,8 @@
         {
           /* linked in or successfully dynloaded */
 
- const char *url_scheme;
- const svn_ra_plugin_t *ra_plugin;
+ SVN_ERR( (*initfunc)(SVN_RA_ABI_VERSION, pool, ra_library_hash) );
 
- SVN_ERR( (*initfunc)(SVN_RA_ABI_VERSION,
- pool, &url_scheme, &ra_plugin) );
-
- apr_hash_set (ra_library_hash,
- url_scheme, APR_HASH_KEY_STRING, ra_plugin);
         }
     }
 
Index: libsvn_ra_dav/session.c
===================================================================
RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_ra_dav/session.c,v
retrieving revision 1.27
diff -u -r1.27 session.c
--- libsvn_ra_dav/session.c 2001/06/26 20:24:01 1.27
+++ libsvn_ra_dav/session.c 2001/06/27 21:33:19
@@ -136,15 +136,17 @@
 
 svn_error_t *svn_ra_dav_init(int abi_version,
                              apr_pool_t *pconf,
- const char **url_type,
- const svn_ra_plugin_t **plugin)
+ apr_hash_t *hash)
 {
   /* ### need a version number to check here... */
   if (abi_version != 0)
     ;
 
- *url_type = "http";
- *plugin = &dav_plugin;
+ apr_hash_set (hash, "http", APR_HASH_KEY_STRING, &dav_plugin);
+
+ /* ### should ask neon whether it supports SSL or not, and skip this
+ ### if it doesn't. */
+ apr_hash_set (hash, "https", APR_HASH_KEY_STRING, &dav_plugin);
 
   return NULL;
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:32 2006

This is an archived mail posted to the Subversion Dev mailing list.