httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chr...@apache.org
Subject svn commit: r481509 - in /httpd/httpd/trunk: CHANGES modules/database/mod_dbd.c
Date Sat, 02 Dec 2006 06:25:08 GMT
Author: chrisd
Date: Fri Dec  1 22:25:07 2006
New Revision: 481509

URL: http://svn.apache.org/viewvc?view=rev&rev=481509
Log:
Stash DBD connections in request_config of initial request
only, or else sub-requests and internal redirections may cause
entire DBD pool to be stashed in a single HTTP request.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/database/mod_dbd.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?view=diff&rev=481509&r1=481508&r2=481509
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Dec  1 22:25:07 2006
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) mod_dbd: Stash DBD connections in request_config of initial request
+     only, or else sub-requests and internal redirections may cause
+     entire DBD pool to be stashed in a single HTTP request.  [Chris Darroch]
+
   *) mod_cache: Correctly cache objects whose URL query string has been
      modified by mod_rewrite. PR 40805. [Ruediger Pluem]
 

Modified: httpd/httpd/trunk/modules/database/mod_dbd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/database/mod_dbd.c?view=diff&rev=481509&r1=481508&r2=481509
==============================================================================
--- httpd/httpd/trunk/modules/database/mod_dbd.c (original)
+++ httpd/httpd/trunk/modules/database/mod_dbd.c Fri Dec  1 22:25:07 2006
@@ -524,7 +524,18 @@
 DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_acquire(request_rec *r)
 {
     svr_cfg *svr;
-    dbd_pool_rec *req = ap_get_module_config(r->request_config, &dbd_module);
+    dbd_pool_rec *req;
+
+    while (!ap_is_initial_req(r)) {
+        if (r->prev) {
+            r = r->prev;
+        }
+        else if (r->main) {
+            r = r->main;
+        }
+    }
+
+    req = ap_get_module_config(r->request_config, &dbd_module);
     if (!req) {
         req = apr_palloc(r->pool, sizeof(dbd_pool_rec));
         req->conn = ap_dbd_open(r->pool, r->server);
@@ -571,7 +582,18 @@
 DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_acquire(request_rec *r)
 {
     svr_cfg *svr;
-    ap_dbd_t *ret = ap_get_module_config(r->request_config, &dbd_module);
+    ap_dbd_t *ret;
+
+    while (!ap_is_initial_req(r)) {
+        if (r->prev) {
+            r = r->prev;
+        }
+        else if (r->main) {
+            r = r->main;
+        }
+    }
+
+    ret = ap_get_module_config(r->request_config, &dbd_module);
     if (!ret) {
         svr = ap_get_module_config(r->server->module_config, &dbd_module);
         ret = ap_dbd_open(r->pool, r->server);



Mime
View raw message