svn commit: r1825795 - in /subversion/branches/1.10.x: ./ STATUS subversion/mod_authz_svn/mod_authz_svn.c

2018-03-03 Thread svn-role
Author: svn-role
Date: Sun Mar  4 04:00:06 2018
New Revision: 1825795

URL: http://svn.apache.org/viewvc?rev=1825795=rev
Log:
Merge the r1825736 group from trunk:

 * r1825736, r1825778
   Fix a memory usage problem in mod_authz_svn.
   Justifiation:
 Server uses too much memory if authz is enabled.
 See https://svn.haxx.se/dev/archive-2018-03/0010.shtml
   Votes:
 +1: philip, stsp, brane

Modified:
subversion/branches/1.10.x/   (props changed)
subversion/branches/1.10.x/STATUS
subversion/branches/1.10.x/subversion/mod_authz_svn/mod_authz_svn.c

Propchange: subversion/branches/1.10.x/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Mar  4 04:00:06 2018
@@ -100,4 +100,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1817837,1817856,1818577-1818578,1818584,1818651,1818662,1818727,1818801,1818803,1818807,1818868,1818871,1819036-1819037,1819043,1819049,1819052,1819093,1819146,1819162,1819444,1819556-1819557,1819603,1819804,1819911,1820044,1820046-1820047,1820518,1820627,1820718,1820778,1821183,1821224,1821621,1821678,1822401,1822587,1822591,1822996,1823202-1823203,1823211,1823327,1823791,1823966,1823989,1824033,1825024,1825045,1825215,1825266
+/subversion/trunk:1817837,1817856,1818577-1818578,1818584,1818651,1818662,1818727,1818801,1818803,1818807,1818868,1818871,1819036-1819037,1819043,1819049,1819052,1819093,1819146,1819162,1819444,1819556-1819557,1819603,1819804,1819911,1820044,1820046-1820047,1820518,1820627,1820718,1820778,1821183,1821224,1821621,1821678,1822401,1822587,1822591,1822996,1823202-1823203,1823211,1823327,1823791,1823966,1823989,1824033,1825024,1825045,1825215,1825266,1825736,1825778

Modified: subversion/branches/1.10.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1825795=1825794=1825795=diff
==
--- subversion/branches/1.10.x/STATUS (original)
+++ subversion/branches/1.10.x/STATUS Sun Mar  4 04:00:06 2018
@@ -51,11 +51,3 @@ Veto-blocked changes:
 
 Approved changes:
 =
-
- * r1825736, r1825778
-   Fix a memory usage problem in mod_authz_svn.
-   Justifiation:
- Server uses too much memory if authz is enabled.
- See https://svn.haxx.se/dev/archive-2018-03/0010.shtml
-   Votes:
- +1: philip, stsp, brane

Modified: subversion/branches/1.10.x/subversion/mod_authz_svn/mod_authz_svn.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/subversion/mod_authz_svn/mod_authz_svn.c?rev=1825795=1825794=1825795=diff
==
--- subversion/branches/1.10.x/subversion/mod_authz_svn/mod_authz_svn.c 
(original)
+++ subversion/branches/1.10.x/subversion/mod_authz_svn/mod_authz_svn.c Sun Mar 
 4 04:00:06 2018
@@ -401,10 +401,12 @@ static svn_authz_t *
 get_access_conf(request_rec *r, authz_svn_config_rec *conf,
 apr_pool_t *scratch_pool)
 {
+  const char *cache_key = NULL;
   const char *access_file;
   const char *groups_file;
   const char *repos_path;
   const char *repos_url = NULL;
+  void *user_data = NULL;
   svn_authz_t *access_conf = NULL;
   svn_error_t *svn_err = SVN_NO_ERROR;
   dav_error *dav_err;
@@ -464,19 +466,31 @@ get_access_conf(request_rec *r, authz_sv
 "Path to groups file is %s", groups_file);
 }
 
-  svn_err = svn_repos_authz_read3(_conf,
-  access_file, groups_file,
-  TRUE, NULL,
-  r->connection->pool, scratch_pool);
+  cache_key = apr_pstrcat(scratch_pool, "mod_authz_svn:",
+  access_file, groups_file, SVN_VA_NULL);
+  apr_pool_userdata_get(_data, cache_key, r->connection->pool);
+  access_conf = user_data;
+  if (access_conf == NULL)
+{
+  svn_err = svn_repos_authz_read3(_conf, access_file,
+  groups_file, TRUE, NULL,
+  r->connection->pool,
+  scratch_pool);
 
-  if (svn_err)
-{
-  log_svn_error(APLOG_MARK, r,
-"Failed to load the mod_authz_svn config:",
-svn_err, scratch_pool);
-  access_conf = NULL;
+  if (svn_err)
+{
+  log_svn_error(APLOG_MARK, r,
+"Failed to load the mod_authz_svn config:",
+svn_err, scratch_pool);
+  access_conf = NULL;
+}
+  else
+{
+  /* Cache the open repos for the next request on this connection */
+  apr_pool_userdata_set(access_conf, cache_key,
+NULL, r->connection->pool);
+}
 }
-
   return access_conf;
 }
 




svn commit: r1825789 - /subversion/branches/1.10.x/STATUS

2018-03-03 Thread jamessan
Author: jamessan
Date: Sat Mar  3 21:37:27 2018
New Revision: 1825789

URL: http://svn.apache.org/viewvc?rev=1825789=rev
Log:
* STATUS: Add r1825787, r1825788 to r1825783 group

Modified:
subversion/branches/1.10.x/STATUS

Modified: subversion/branches/1.10.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1825789=1825788=1825789=diff
==
--- subversion/branches/1.10.x/STATUS (original)
+++ subversion/branches/1.10.x/STATUS Sat Mar  3 21:37:27 2018
@@ -38,7 +38,7 @@ Candidate changes:
Votes:
  +1: brane, stsp
 
- * r1825783
+ * r1825783, r1825787, r1825788
Ensure test data is correctly aligned before calling
svn_utf__utf{16,32}_to_utf8
Justification:




svn commit: r1825788 - /subversion/trunk/subversion/tests/libsvn_subr/utf-test.c

2018-03-03 Thread jamessan
Author: jamessan
Date: Sat Mar  3 21:32:52 2018
New Revision: 1825788

URL: http://svn.apache.org/viewvc?rev=1825788=rev
Log:
* subversion/tests/libsvn_subr/utf-test.c:
  (test_utf_conversions): Calculate maxlen before allocating buffers.


Modified:
subversion/trunk/subversion/tests/libsvn_subr/utf-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/utf-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/utf-test.c?rev=1825788=1825787=1825788=diff
==
--- subversion/trunk/subversion/tests/libsvn_subr/utf-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/utf-test.c Sat Mar  3 
21:32:52 2018
@@ -810,14 +810,17 @@ test_utf_conversions(apr_pool_t *pool)
   /* To assure proper alignment of the source string, it needs to be copied
  into an array of the appropriate type before calling
  svn_utf__utf{16,32}_to_utf8. */
-  apr_uint16_t *source16 = apr_pcalloc(pool, maxlen * sizeof(*source16));
-  apr_int32_t *source32 = apr_pcalloc(pool, maxlen * sizeof(*source32));
+  apr_uint16_t *source16;
+  apr_int32_t *source32;
 
   for (tc = tests; tc->source; ++tc)
 if (tc->sourcelen > maxlen)
   maxlen = tc->sourcelen;
   maxlen++;
 
+  source16 = apr_pcalloc(pool, maxlen * sizeof(*source16));
+  source32 = apr_pcalloc(pool, maxlen * sizeof(*source32));
+
   for (tc = tests; tc->source; ++tc)
 {
   if (tc->sixteenbit)




svn commit: r1825787 - /subversion/trunk/subversion/tests/libsvn_subr/utf-test.c

2018-03-03 Thread jamessan
Author: jamessan
Date: Sat Mar  3 21:03:09 2018
New Revision: 1825787

URL: http://svn.apache.org/viewvc?rev=1825787=rev
Log:
* subversion/tests/libsvn_subr/utf-test.c:
  (test_utf_conversions): Move maxlen loop after declarations

Modified:
subversion/trunk/subversion/tests/libsvn_subr/utf-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/utf-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/utf-test.c?rev=1825787=1825786=1825787=diff
==
--- subversion/trunk/subversion/tests/libsvn_subr/utf-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/utf-test.c Sat Mar  3 
21:03:09 2018
@@ -807,11 +807,6 @@ test_utf_conversions(apr_pool_t *pool)
   const svn_string_t *result;
   apr_size_t maxlen = 0;
 
-  for (tc = tests; tc->source; ++tc)
-if (tc->sourcelen > maxlen)
-  maxlen = tc->sourcelen;
-  maxlen++;
-
   /* To assure proper alignment of the source string, it needs to be copied
  into an array of the appropriate type before calling
  svn_utf__utf{16,32}_to_utf8. */
@@ -819,6 +814,11 @@ test_utf_conversions(apr_pool_t *pool)
   apr_int32_t *source32 = apr_pcalloc(pool, maxlen * sizeof(*source32));
 
   for (tc = tests; tc->source; ++tc)
+if (tc->sourcelen > maxlen)
+  maxlen = tc->sourcelen;
+  maxlen++;
+
+  for (tc = tests; tc->source; ++tc)
 {
   if (tc->sixteenbit)
 {




svn commit: r1825784 - /subversion/branches/1.10.x/STATUS

2018-03-03 Thread jamessan
Author: jamessan
Date: Sat Mar  3 20:54:27 2018
New Revision: 1825784

URL: http://svn.apache.org/viewvc?rev=1825784=rev
Log:
* STATUS: Nominate r1825783.

Modified:
subversion/branches/1.10.x/STATUS

Modified: subversion/branches/1.10.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1825784=1825783=1825784=diff
==
--- subversion/branches/1.10.x/STATUS (original)
+++ subversion/branches/1.10.x/STATUS Sat Mar  3 20:54:27 2018
@@ -38,6 +38,14 @@ Candidate changes:
Votes:
  +1: brane, stsp
 
+ * r1825783
+   Ensure test data is correctly aligned before calling
+   svn_utf__utf{16,32}_to_utf8
+   Justification:
+ Fixes test failure
+   Votes:
+ +1: jamessan
+
 Veto-blocked changes:
 =
 




svn commit: r1825783 - /subversion/trunk/subversion/tests/libsvn_subr/utf-test.c

2018-03-03 Thread jamessan
Author: jamessan
Date: Sat Mar  3 20:53:50 2018
New Revision: 1825783

URL: http://svn.apache.org/viewvc?rev=1825783=rev
Log:
Ensure test data is correctly aligned before calling svn_utf__utf{16,32}_to_utf8

On systems with strict alignment requirements (such as alpha), using the char*
tc->source as apr_uint16_t*/apr_int32_t* can cause the tests to fail, as
reported at .

* subversion/tests/libsvn_subr/utf-test.c:
  (test_utf_conversions): Create apr_uint16_t and apr_int32_t arrays to which
   the source string is copied before calling the conversion function, thus
   assuring proper alignment.  Consolidate the handling of conversions where
   length is calculated and where a certain number of codes are converted.

Found by: Michael Cree 


Modified:
subversion/trunk/subversion/tests/libsvn_subr/utf-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/utf-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/utf-test.c?rev=1825783=1825782=1825783=diff
==
--- subversion/trunk/subversion/tests/libsvn_subr/utf-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/utf-test.c Sat Mar  3 
20:53:50 2018
@@ -752,8 +752,10 @@ test_utf_conversions(apr_pool_t *pool)
   {
 svn_boolean_t sixteenbit;
 svn_boolean_t bigendian;
+apr_size_t sourcelen;
 const char *source;
 const char *result;
+svn_boolean_t counted;
   } tests[] = {
 
 #define UTF_32_LE FALSE, FALSE
@@ -762,32 +764,36 @@ test_utf_conversions(apr_pool_t *pool)
 #define UTF_16_BE TRUE, TRUE
 
 /* Normal character conversion */
-{ UTF_32_LE, "t\0\0\0" "e\0\0\0" "s\0\0\0" "t\0\0\0" "\0\0\0\0", "test" },
-{ UTF_32_BE, "\0\0\0t" "\0\0\0e" "\0\0\0s" "\0\0\0t" "\0\0\0\0", "test" },
-{ UTF_16_LE, "t\0" "e\0" "s\0" "t\0" "\0\0", "test" },
-{ UTF_16_BE, "\0t" "\0e" "\0s" "\0t" "\0\0", "test" },
+{ UTF_32_LE, 4, "t\0\0\0" "e\0\0\0" "s\0\0\0" "t\0\0\0" "\0\0\0\0", 
"test", FALSE },
+{ UTF_32_BE, 4, "\0\0\0t" "\0\0\0e" "\0\0\0s" "\0\0\0t" "\0\0\0\0", 
"test", FALSE },
+{ UTF_16_LE, 4, "t\0" "e\0" "s\0" "t\0" "\0\0", "test", FALSE },
+{ UTF_16_BE, 4, "\0t" "\0e" "\0s" "\0t" "\0\0", "test", FALSE },
 
 /* Valid surrogate pairs */
-{ UTF_16_LE, "\x00\xD8" "\x00\xDC" "\0\0", "\xf0\x90\x80\x80" }, /* 
U+01 */
-{ UTF_16_LE, "\x34\xD8" "\x1E\xDD" "\0\0", "\xf0\x9d\x84\x9e" }, /* 
U+01D11E */
-{ UTF_16_LE, "\xFF\xDB" "\xFD\xDF" "\0\0", "\xf4\x8f\xbf\xbd" }, /* 
U+10FFFD */
-
-{ UTF_16_BE, "\xD8\x00" "\xDC\x00" "\0\0", "\xf0\x90\x80\x80" }, /* 
U+01 */
-{ UTF_16_BE, "\xD8\x34" "\xDD\x1E" "\0\0", "\xf0\x9d\x84\x9e" }, /* 
U+01D11E */
-{ UTF_16_BE, "\xDB\xFF" "\xDF\xFD" "\0\0", "\xf4\x8f\xbf\xbd" }, /* 
U+10FFFD */
+{ UTF_16_LE, 2, "\x00\xD8" "\x00\xDC" "\0\0", "\xf0\x90\x80\x80", FALSE }, 
/* U+01 */
+{ UTF_16_LE, 2, "\x34\xD8" "\x1E\xDD" "\0\0", "\xf0\x9d\x84\x9e", FALSE }, 
/* U+01D11E */
+{ UTF_16_LE, 2, "\xFF\xDB" "\xFD\xDF" "\0\0", "\xf4\x8f\xbf\xbd", FALSE }, 
/* U+10FFFD */
+
+{ UTF_16_BE, 2, "\xD8\x00" "\xDC\x00" "\0\0", "\xf0\x90\x80\x80", FALSE }, 
/* U+01 */
+{ UTF_16_BE, 2, "\xD8\x34" "\xDD\x1E" "\0\0", "\xf0\x9d\x84\x9e", FALSE }, 
/* U+01D11E */
+{ UTF_16_BE, 2, "\xDB\xFF" "\xDF\xFD" "\0\0", "\xf4\x8f\xbf\xbd", FALSE }, 
/* U+10FFFD */
 
 /* Swapped, single and trailing surrogate pairs */
-{ UTF_16_LE, "*\0" "\x00\xDC" "\x00\xD8" "*\0\0\0", "*\xed\xb0\x80" 
"\xed\xa0\x80*" },
-{ UTF_16_LE, "*\0" "\x1E\xDD" "*\0\0\0", "*\xed\xb4\x9e*" },
-{ UTF_16_LE, "*\0" "\xFF\xDB" "*\0\0\0", "*\xed\xaf\xbf*" },
-{ UTF_16_LE, "\x1E\xDD" "\0\0", "\xed\xb4\x9e" },
-{ UTF_16_LE, "\xFF\xDB" "\0\0", "\xed\xaf\xbf" },
-
-{ UTF_16_BE, "\0*" "\xDC\x00" "\xD8\x00" "\0*\0\0", "*\xed\xb0\x80" 
"\xed\xa0\x80*" },
-{ UTF_16_BE, "\0*" "\xDD\x1E" "\0*\0\0", "*\xed\xb4\x9e*" },
-{ UTF_16_BE, "\0*" "\xDB\xFF" "\0*\0\0", "*\xed\xaf\xbf*" },
-{ UTF_16_BE, "\xDD\x1E" "\0\0", "\xed\xb4\x9e" },
-{ UTF_16_BE, "\xDB\xFF" "\0\0", "\xed\xaf\xbf" },
+{ UTF_16_LE, 4, "*\0" "\x00\xDC" "\x00\xD8" "*\0\0\0", "*\xed\xb0\x80" 
"\xed\xa0\x80*", FALSE },
+{ UTF_16_LE, 3, "*\0" "\x1E\xDD" "*\0\0\0", "*\xed\xb4\x9e*", FALSE },
+{ UTF_16_LE, 3, "*\0" "\xFF\xDB" "*\0\0\0", "*\xed\xaf\xbf*", FALSE },
+{ UTF_16_LE, 1, "\x1E\xDD" "\0\0", "\xed\xb4\x9e", FALSE },
+{ UTF_16_LE, 1, "\xFF\xDB" "\0\0", "\xed\xaf\xbf", FALSE },
+
+{ UTF_16_BE, 4, "\0*" "\xDC\x00" "\xD8\x00" "\0*\0\0", "*\xed\xb0\x80" 
"\xed\xa0\x80*", FALSE },
+{ UTF_16_BE, 3, "\0*" "\xDD\x1E" "\0*\0\0", "*\xed\xb4\x9e*", FALSE },
+{ UTF_16_BE, 3, "\0*" "\xDB\xFF" "\0*\0\0", "*\xed\xaf\xbf*", FALSE },
+{ UTF_16_BE, 1, "\xDD\x1E" "\0\0", "\xed\xb4\x9e", FALSE },
+{ UTF_16_BE, 1, "\xDB\xFF" "\0\0", "\xed\xaf\xbf", FALSE },
+
+/* 

svn commit: r1825781 - /subversion/branches/1.10.x/STATUS

2018-03-03 Thread brane
Author: brane
Date: Sat Mar  3 18:21:45 2018
New Revision: 1825781

URL: http://svn.apache.org/viewvc?rev=1825781=rev
Log:
* branches/1.10.x/STATUS: Approve the r1825736 group.

Modified:
subversion/branches/1.10.x/STATUS

Modified: subversion/branches/1.10.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1825781=1825780=1825781=diff
==
--- subversion/branches/1.10.x/STATUS (original)
+++ subversion/branches/1.10.x/STATUS Sat Mar  3 18:21:45 2018
@@ -38,16 +38,16 @@ Candidate changes:
Votes:
  +1: brane, stsp
 
+Veto-blocked changes:
+=
+
+Approved changes:
+=
+
  * r1825736, r1825778
Fix a memory usage problem in mod_authz_svn.
Justifiation:
  Server uses too much memory if authz is enabled.
  See https://svn.haxx.se/dev/archive-2018-03/0010.shtml
Votes:
- +1: philip, stsp
-  
-Veto-blocked changes:
-=
-
-Approved changes:
-=
+ +1: philip, stsp, brane




svn commit: r1825780 - /subversion/branches/1.10.x/STATUS

2018-03-03 Thread stsp
Author: stsp
Date: Sat Mar  3 17:24:49 2018
New Revision: 1825780

URL: http://svn.apache.org/viewvc?rev=1825780=rev
Log:
* STATUS: Vote for r1825778.

Modified:
subversion/branches/1.10.x/STATUS

Modified: subversion/branches/1.10.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1825780=1825779=1825780=diff
==
--- subversion/branches/1.10.x/STATUS (original)
+++ subversion/branches/1.10.x/STATUS Sat Mar  3 17:24:49 2018
@@ -44,8 +44,7 @@ Candidate changes:
  Server uses too much memory if authz is enabled.
  See https://svn.haxx.se/dev/archive-2018-03/0010.shtml
Votes:
- +1: philip
- +1: stsp (without r1825778)
+ +1: philip, stsp
   
 Veto-blocked changes:
 =




svn commit: r1825779 - /subversion/branches/1.10.x/STATUS

2018-03-03 Thread philip
Author: philip
Date: Sat Mar  3 17:12:05 2018
New Revision: 1825779

URL: http://svn.apache.org/viewvc?rev=1825779=rev
Log:
* STATUS: Nominate mod_authz_svn revert.

Modified:
subversion/branches/1.10.x/STATUS

Modified: subversion/branches/1.10.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.10.x/STATUS?rev=1825779=1825778=1825779=diff
==
--- subversion/branches/1.10.x/STATUS (original)
+++ subversion/branches/1.10.x/STATUS Sat Mar  3 17:12:05 2018
@@ -38,13 +38,14 @@ Candidate changes:
Votes:
  +1: brane, stsp
 
- * r1825736
+ * r1825736, r1825778
Fix a memory usage problem in mod_authz_svn.
Justifiation:
  Server uses too much memory if authz is enabled.
  See https://svn.haxx.se/dev/archive-2018-03/0010.shtml
Votes:
- +1: stsp
+ +1: philip
+ +1: stsp (without r1825778)
   
 Veto-blocked changes:
 =




svn commit: r1825778 - /subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c

2018-03-03 Thread philip
Author: philip
Date: Sat Mar  3 16:58:13 2018
New Revision: 1825778

URL: http://svn.apache.org/viewvc?rev=1825778=rev
Log:
Revert r1825736, r1779188 and r1778923.  This reverts to
caching the authz file for the duration of the connection
in mod_authz_svn.  This was due to performance issues:

https://mail-archives.apache.org/mod_mbox/subversion-dev/201803.mbox/%3CCAP_GPNii50yPBMNogDYgrgk9%3DpUs802YAjM3to2g5s7R21GX5g%40mail.gmail.com%3E

* subversion/mod_authz_svn/mod_authz_svn.c
  (get_access_conf, req_check_access, subreq_bypass2): Revert.

Modified:
subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c

Modified: subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c?rev=1825778=1825777=1825778=diff
==
--- subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c Sat Mar  3 
16:58:13 2018
@@ -395,17 +395,18 @@ resolve_repos_relative_url(const char **
 }
 
 /*
- * Get the svn_authz_t for this request.
+ * Get the, possibly cached, svn_authz_t for this request.
  */
 static svn_authz_t *
 get_access_conf(request_rec *r, authz_svn_config_rec *conf,
-apr_pool_t *result_pool,
 apr_pool_t *scratch_pool)
 {
+  const char *cache_key = NULL;
   const char *access_file;
   const char *groups_file;
   const char *repos_path;
   const char *repos_url = NULL;
+  void *user_data = NULL;
   svn_authz_t *access_conf = NULL;
   svn_error_t *svn_err = SVN_NO_ERROR;
   dav_error *dav_err;
@@ -465,19 +466,31 @@ get_access_conf(request_rec *r, authz_sv
 "Path to groups file is %s", groups_file);
 }
 
-  svn_err = svn_repos_authz_read3(_conf,
-  access_file, groups_file,
-  TRUE, NULL,
-  result_pool, scratch_pool);
-
-  if (svn_err)
+  cache_key = apr_pstrcat(scratch_pool, "mod_authz_svn:",
+  access_file, groups_file, SVN_VA_NULL);
+  apr_pool_userdata_get(_data, cache_key, r->connection->pool);
+  access_conf = user_data;
+  if (access_conf == NULL)
 {
-  log_svn_error(APLOG_MARK, r,
-"Failed to load the mod_authz_svn config:",
-svn_err, scratch_pool);
-  access_conf = NULL;
-}
+  svn_err = svn_repos_authz_read3(_conf, access_file,
+  groups_file, TRUE, NULL,
+  r->connection->pool,
+  scratch_pool);
 
+  if (svn_err)
+{
+  log_svn_error(APLOG_MARK, r,
+"Failed to load the mod_authz_svn config:",
+svn_err, scratch_pool);
+  access_conf = NULL;
+}
+  else
+{
+  /* Cache the open repos for the next request on this connection */
+  apr_pool_userdata_set(access_conf, cache_key,
+NULL, r->connection->pool);
+}
+}
   return access_conf;
 }
 
@@ -688,7 +701,7 @@ req_check_access(request_rec *r,
 }
 
   /* Retrieve/cache authorization file */
-  access_conf = get_access_conf(r,conf, r->pool, r->pool);
+  access_conf = get_access_conf(r,conf, r->pool);
   if (access_conf == NULL)
 return DECLINED;
 
@@ -805,7 +818,7 @@ subreq_bypass2(request_rec *r,
 }
 
   /* Retrieve authorization file */
-  access_conf = get_access_conf(r, conf, scratch_pool, scratch_pool);
+  access_conf = get_access_conf(r, conf, scratch_pool);
   if (access_conf == NULL)
 return HTTP_FORBIDDEN;