subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1148134 - /subversion/trunk/subversion/libsvn_ra/ra_loader.c
Date Tue, 19 Jul 2011 03:23:13 GMT
Author: danielsh
Date: Tue Jul 19 03:23:12 2011
New Revision: 1148134

URL: http://svn.apache.org/viewvc?rev=1148134&view=rev
Log:
In the RA loader, ask the library what schemes it supports after it has been
loaded.

* subversion/libsvn_ra/ra_loader.c
  (has_scheme_of): Change signature.
  (svn_ra_open4, svn_ra_get_ra_library): Track signature change.
  (svn_ra_open4): After loading a library, actually check which
    schemes are supported.

Modified:
    subversion/trunk/subversion/libsvn_ra/ra_loader.c

Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=1148134&r1=1148133&r2=1148134&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Tue Jul 19 03:23:12 2011
@@ -201,14 +201,13 @@ load_ra_module(svn_ra__init_func_t *func
   return SVN_NO_ERROR;
 }
 
-/* If DEFN may support URL, return the scheme.  Else, return NULL. */
+/* If SCHEMES contains URL, return the scheme.  Else, return NULL. */
 static const char *
-has_scheme_of(const struct ra_lib_defn *defn, const char *url)
+has_scheme_of(const char * const *schemes, const char *url)
 {
-  const char * const *schemes;
   apr_size_t len;
 
-  for (schemes = defn->schemes; *schemes != NULL; ++schemes)
+  for ( ; *schemes != NULL; ++schemes)
     {
       const char *scheme = *schemes;
       len = strlen(scheme);
@@ -454,7 +453,7 @@ svn_error_t *svn_ra_open4(svn_ra_session
     {
       const char *scheme;
 
-      if ((scheme = has_scheme_of(defn, repos_URL)))
+      if ((scheme = has_scheme_of(defn->schemes, repos_URL)))
         {
           svn_ra__init_func_t initfunc = defn->initfunc;
 
@@ -475,6 +474,11 @@ svn_error_t *svn_ra_open4(svn_ra_session
 
           SVN_ERR(check_ra_version(vtable->get_version(), scheme));
 
+          if (! has_scheme_of(vtable->get_schemes(sesspool), repos_URL))
+            /* Library doesn't support the scheme at runtime. */
+            continue;
+
+
           break;
         }
     }
@@ -1332,7 +1336,7 @@ svn_ra_get_ra_library(svn_ra_plugin_t **
   for (defn = ra_libraries; defn->ra_name != NULL; ++defn)
     {
       const char *scheme;
-      if ((scheme = has_scheme_of(defn, url)))
+      if ((scheme = has_scheme_of(defn->schemes, url)))
         {
           svn_ra_init_func_t compat_initfunc = defn->compat_initfunc;
 



Mime
View raw message