ASF Bugzilla – Attachment 35913 Details for
Bug 62311
only create the rewritelock when needed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch for trunk
mod_rewrite.diff (text/plain), 2.02 KB, created by
Hank Ibell
on 2018-05-07 14:56:02 UTC
(
hide
)
Description:
Proposed patch for trunk
Filename:
MIME Type:
Creator:
Hank Ibell
Created:
2018-05-07 14:56:02 UTC
Size:
2.02 KB
patch
obsolete
>Index: modules/mappers/mod_rewrite.c >=================================================================== >--- modules/mappers/mod_rewrite.c (revision 1831104) >+++ modules/mappers/mod_rewrite.c (working copy) >@@ -422,6 +422,7 @@ > static int proxy_available; > > /* Locks/Mutexes */ >+static int rewrite_lock_needed = 0; > static apr_global_mutex_t *rewrite_mapr_lock_acquire = NULL; > static const char *rewritemap_mutex_type = "rewrite-map"; > >@@ -1778,6 +1779,7 @@ > return NULL; > } > >+ rewrite_lock_needed = 1; > rewritelog((r, 5, NULL, "map lookup OK: map=%s key=%s -> val=%s", > name, key, value)); > return value; >@@ -2691,9 +2693,6 @@ > apr_status_t rc; > > /* create the lockfile */ >- /* XXX See if there are any rewrite map programs before creating >- * the mutex. >- */ > rc = ap_global_mutex_create(&rewrite_mapr_lock_acquire, NULL, > rewritemap_mutex_type, NULL, s, p, 0); > if (rc != APR_SUCCESS) { >@@ -4502,6 +4501,7 @@ > { > APR_OPTIONAL_FN_TYPE(ap_register_rewrite_mapfunc) *map_pfn_register; > >+ rewrite_lock_needed = 0; > ap_mutex_register(pconf, rewritemap_mutex_type, NULL, APR_LOCK_DEFAULT, 0); > > /* register int: rewritemap handlers */ >@@ -4527,14 +4527,16 @@ > /* check if proxy module is available */ > proxy_available = (ap_find_linked_module("mod_proxy.c") != NULL); > >- rv = rewritelock_create(s, p); >- if (rv != APR_SUCCESS) { >- return HTTP_INTERNAL_SERVER_ERROR; >+ if (rewrite_lock_needed) { >+ rv = rewritelock_create(s, p); >+ if (rv != APR_SUCCESS) { >+ return HTTP_INTERNAL_SERVER_ERROR; >+ } >+ >+ apr_pool_cleanup_register(p, (void *)s, rewritelock_remove, >+ apr_pool_cleanup_null); > } > >- apr_pool_cleanup_register(p, (void *)s, rewritelock_remove, >- apr_pool_cleanup_null); >- > /* if we are not doing the initial config, step through the servers and > * open the RewriteMap prg:xxx programs, > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 62311
:
35913
|
35915