subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1365519 - in /subversion/trunk/subversion: libsvn_ra/ra_loader.h libsvn_ra_serf/serf.c
Date Wed, 25 Jul 2012 11:01:53 GMT
Author: rhuijben
Date: Wed Jul 25 11:01:53 2012
New Revision: 1365519

URL: http://svn.apache.org/viewvc?rev=1365519&view=rev
Log:
Use the scratch pool for some temporary work in the ra_serf reparent code.
Also rename some variables to help in documenting their purpose.

* subversion/libsvn_ra/ra_loader.h
  (svn_ra__vtable_t): Rename argument to repos_open function.

* subversion/libsvn_ra_serf/serf.c
  (svn_ra_serf__open): Rename argument to match purpose and avoid using the
    repos_URL name for a different purpose.

  (svn_ra_serf__reparent): Parse url in temp pool and only duplicate the result
    in the session pool.

Modified:
    subversion/trunk/subversion/libsvn_ra/ra_loader.h
    subversion/trunk/subversion/libsvn_ra_serf/serf.c

Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.h?rev=1365519&r1=1365518&r2=1365519&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.h Wed Jul 25 11:01:53 2012
@@ -58,7 +58,7 @@ typedef struct svn_ra__vtable_t {
      time this is called.  SESSION->priv may be set by this function. */
   svn_error_t *(*open_session)(svn_ra_session_t *session,
                                const char **corrected_url,
-                               const char *repos_URL,
+                               const char *session_URL,
                                const svn_ra_callbacks2_t *callbacks,
                                void *callback_baton,
                                apr_hash_t *config,

Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1365519&r1=1365518&r2=1365519&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Wed Jul 25 11:01:53 2012
@@ -344,7 +344,7 @@ svn_ra_serf__progress(void *progress_bat
 static svn_error_t *
 svn_ra_serf__open(svn_ra_session_t *session,
                   const char **corrected_url,
-                  const char *repos_URL,
+                  const char *session_URL,
                   const svn_ra_callbacks2_t *callbacks,
                   void *callback_baton,
                   apr_hash_t *config,
@@ -374,12 +374,12 @@ svn_ra_serf__open(svn_ra_session_t *sess
                                        serf_sess->pool));
 
 
-  status = apr_uri_parse(serf_sess->pool, repos_URL, &url);
+  status = apr_uri_parse(serf_sess->pool, session_URL, &url);
   if (status)
     {
       return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
-                               _("Illegal repository URL '%s'"),
-                               repos_URL);
+                               _("Illegal URL '%s'"),
+                               session_URL);
     }
   /* Contrary to what the comment for apr_uri_t.path says in apr-util 1.2.12 and
      older, for root paths url.path will be "", where serf requires "/". */
@@ -390,7 +390,7 @@ svn_ra_serf__open(svn_ra_session_t *sess
       url.port = apr_uri_port_of_scheme(url.scheme);
     }
   serf_sess->session_url = url;
-  serf_sess->session_url_str = apr_pstrdup(serf_sess->pool, repos_URL);
+  serf_sess->session_url_str = apr_pstrdup(serf_sess->pool, session_URL);
   serf_sess->using_ssl = (svn_cstring_casecmp(url.scheme, "https") == 0);
 
   serf_sess->supports_deadprop_count = svn_tristate_unknown;
@@ -471,14 +471,16 @@ svn_ra_serf__reparent(svn_ra_session_t *
             "URL '%s'"), url, session->repos_root_str);
     }
 
-  status = apr_uri_parse(session->pool, url, &new_url);
+  status = apr_uri_parse(pool, url, &new_url);
   if (status)
     {
       return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
                                _("Illegal repository URL '%s'"), url);
     }
 
-  session->session_url.path = new_url.path;
+  /* Maybe we should use a string buffer for these strings so we don't
+     allocate memory in the session on every reparent? */
+  session->session_url.path = apr_pstrdup(session->pool, new_url.path);
   session->session_url_str = apr_pstrdup(session->pool, url);
 
   return SVN_NO_ERROR;



Mime
View raw message