]> andersk Git - mod-vhost-ldap.git/commitdiff
Remove mutexes as they cause lockups, set documentroot once more in fixups hook
authorOndřej Surý <ondrej@sury.org>
Mon, 21 Jun 2010 14:43:14 +0000 (16:43 +0200)
committerOndřej Surý <ondrej@sury.org>
Mon, 21 Jun 2010 14:44:33 +0000 (16:44 +0200)
mod_vhost_ldap.c

index ed376bef6d69547659a21eae0a36d2d9673510ad..e62219128e490e2c0c698f13098d64bb6d3005e4 100644 (file)
@@ -33,8 +33,6 @@
 #include "apr_ldap.h"
 #include "apr_reslist.h"
 #include "apr_strings.h"
-#include "apr_thread_mutex.h"
-#include "apr_thread_rwlock.h"
 #include "apr_tables.h"
 #include "util_ldap.h"
 #include "util_script.h"
@@ -85,8 +83,6 @@ typedef struct mod_vhost_ldap_config_t {
 
     char *fallback;                     /* Fallback virtual host */
 
-    apr_thread_mutex_t *mutex;          /* Create per worker mutex to synchronize threads */
-
 } mod_vhost_ldap_config_t;
 
 typedef struct mod_vhost_ldap_request_t {
@@ -185,8 +181,6 @@ mod_vhost_ldap_create_server_config (apr_pool_t *p, server_rec *s)
     conf->deref = always;
     conf->fallback = NULL;
 
-    apr_thread_mutex_create(&conf->mutex, APR_THREAD_MUTEX_DEFAULT, p);
-
     return conf;
 }
 
@@ -661,13 +655,6 @@ null:
        return DECLINED;
     }
 
-#if APR_HAS_THREADS
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r,
-                 "[mod_vhost_ldap.c]: locking ap_document_root mutex for [%s]",
-                 r->hostname);
-    apr_thread_mutex_lock(conf->mutex);
-#endif
-
     top->server->server_hostname = apr_pstrdup (top->pool, reqc->name);
 
     if (reqc->admin) {
@@ -678,6 +665,7 @@ null:
     if (result != OK) {
         return HTTP_INTERNAL_SERVER_ERROR;
     }
+    apr_table_setn(r->notes, "vhost-document-root", reqc->docroot);
 
     /* Hack to allow post-processing by other modules (mod_rewrite, mod_alias) */
     return DECLINED;
@@ -727,16 +715,13 @@ static ap_unix_identity_t *mod_vhost_ldap_get_suexec_id_doer(const request_rec *
 
 static int mod_vhost_ldap_fixups(request_rec *r)
 {
-#if APR_HAS_THREADS
-    mod_vhost_ldap_config_t *conf =
-       (mod_vhost_ldap_config_t *)ap_get_module_config(r->server->module_config, &vhost_ldap_module);
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r,
-                 "[mod_vhost_ldap.c]: unlocking ap_document_root mutex for [%s]",
-                 r->hostname);
+    char *docroot = 
+      apr_table_get(r->notes, "vhost-document-root");
 
-    apr_thread_mutex_unlock(conf->mutex);
-#endif
-    return OK;
+    if (docroot != NULL)
+      return set_document_root(r, );
+    else
+      return DECLINED;
 }
 
 static void
This page took 0.066028 seconds and 5 git commands to generate.