Hi All,

With the below apache configuration(See the trailing slash at the end of '/svn/').

<Location /svn/>
  DAV svn
  SVNParentPath /repositories
  SVNMasterURI http://master/svn/
  SVNAdvertiseV2Protocol Off
</Location>


We get the following error on the client while.

../subversion/svn/commit-cmd.c:142: (apr_err=175002)
../subversion/libsvn_client/commit.c:853: (apr_err=175002)
svn: Commit failed (details follow):
../subversion/libsvn_ra_neon/commit.c:1463: (apr_err=175002)
../subversion/libsvn_ra_neon/commit.c:334: (apr_err=175002)
../subversion/libsvn_ra_neon/util.c:613: (apr_err=175002)
svn: MKACTIVITY of '/svn/demujin/!svn/act/4b6d547c-018d-4e02-9d3f-2b283076cc06': Could not read status line: connection was closed by server (http://localhost)


On the server it is a assertion error on the following code block from subversion/mod_dav_svn/mirror.c:proxy_request_fixup

   assert((uri_segment[0] == '\0')
           || (uri_segment[0] == '/'));

For the above configuration we get the uri_segment with the value 'reponame/some/path/inside/the/repo'.



Attached patch fixes it.


This change came via fix for issue 3275. I believe this assertion is just to clean the uri for double slash and not anything functional to that issue, I may be wrong.



Thoughts?

Thanks
With regards
Kamesh Jayachandran
Index: subversion/mod_dav_svn/mirror.c
===================================================================
--- subversion/mod_dav_svn/mirror.c     (revision 910164)
+++ subversion/mod_dav_svn/mirror.c     (working copy)
@@ -64,6 +64,7 @@
 
     if (root_dir && master_uri) {
         const char *seg;
+        size_t root_dir_len = strlen(root_dir);
 
         /* We know we can always safely handle these. */
         if (r->method_number == M_REPORT ||
@@ -85,7 +86,10 @@
                                                     "/txn/", NULL))
                     || ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
                                                     "/txr/", NULL))) {
-                    seg += strlen(root_dir);
+                    if (root_dir[root_dir_len - 1] == '/')
+                        seg += (root_dir_len - 1);
+                    else
+                        seg += root_dir_len;
                     proxy_request_fixup(r, master_uri, seg);
                 }
             }
@@ -100,7 +104,10 @@
                     r->method_number == M_LOCK ||
                     r->method_number == M_UNLOCK ||
                     ap_strstr_c(seg, special_uri))) {
-            seg += strlen(root_dir);
+            if (root_dir[root_dir_len - 1] == '/')
+                seg += (root_dir_len - 1);
+            else
+                seg += root_dir_len;
             proxy_request_fixup(r, master_uri, seg);
             return OK;
         }

Reply via email to