OSDN Git Service

* Added Features.
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Thu, 27 Mar 2008 10:56:51 +0000 (10:56 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Thu, 27 Mar 2008 10:56:51 +0000 (10:56 +0000)
    - cookie lazy mode.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_10_0@1938 1a406e8e-add9-4483-a2c8-d8cac5b7c224

debian/rules
include/mod_chxj.h
src/chxj_cookie.c
src/chxj_memcache.c
src/mod_chxj.c

index fcdb81b..99e172a 100755 (executable)
@@ -35,7 +35,7 @@ major=2
 
 config.status: configure
        dh_testdir
-       CFLAGS="$(CFLAGS)  " ./configure --with-apache-header=/usr/include/apache2 --with-apxs=/usr/bin/apxs2
+       CFLAGS="$(CFLAGS)  " ./configure --enable-mysql-cookie --with-mysql-header=/usr/include/mysql --with-mysql-lib-dir=/usr/lib
 
 
 
index e73d8b3..1f570c2 100644 (file)
@@ -338,6 +338,10 @@ struct mod_chxj_config {
 #define IS_COOKIE_STORE_MEMCACHE(X) ((X) == COOKIE_STORE_TYPE_MEMCACHE)
 #define IS_COOKIE_STORE_NONE(X)     ((X) == COOKIE_STORE_TYPE_NONE)
 
+#define COOKIE_LAZY_ON                (2)
+#define COOKIE_LAZY_OFF               (1)
+#define IS_COOKIE_LAZY(X)             ((X)->cookie_lazy_mode == COOKIE_LAZY_ON)
+
 
 #define CONVRULE_ENGINE_ON_BIT        (0x00000001)
 #define CONVRULE_ENGINE_OFF_BIT       (0x00000002)
index ee0f681..2514413 100644 (file)
@@ -233,7 +233,14 @@ chxj_save_cookie(request_rec* r)
                                NULL);
   }
 
-  cookie->cookie_id = alloc_cookie_id(r);
+  if (old_cookie_id && IS_COOKIE_LAZY(dconf)) {
+    DBG(r, "LAZY COOKIE save");
+    cookie->cookie_id = apr_pstrdup(r->pool, old_cookie_id);
+  }
+  else {
+    DBG(r, "NO LAZY COOKIE save");
+    cookie->cookie_id = alloc_cookie_id(r);
+  }
 
 DBG(r, "TYPE:[%d]", dconf->cookie_store_type);
   {
@@ -318,7 +325,14 @@ chxj_update_cookie(request_rec* r, cookie_t* old_cookie)
   chxj_delete_cookie(r,        old_cookie->cookie_id);
   chxj_delete_cookie_expire(r, old_cookie->cookie_id);
 
-  cookie->cookie_id = alloc_cookie_id(r);
+  if (IS_COOKIE_LAZY(dconf)) {
+    DBG(r, "LAZY MODE");
+    cookie->cookie_id = apr_pstrdup(r->pool, old_cookie->cookie_id);
+  }
+  else {
+    DBG(r, "NO LAZY MODE");
+    cookie->cookie_id = alloc_cookie_id(r);
+  }
 
   cookie->cookie_headers = old_cookie->cookie_headers;
   store_string = apr_palloc(r->pool, 1);
index 4defccd..bb34af0 100644 (file)
@@ -307,7 +307,7 @@ chxj_save_cookie_expire_memcache(request_rec *r, mod_chxj_config *m, const char
 
 
 int
-chxj_delete_cookie_expire_memcache(request_rec *r, mod_chxj_config *m, const char *cookie_id)
+chxj_delete_cookie_expire_memcache(request_rec *r, mod_chxj_config *UNUSED(m), const char *cookie_id)
 {
   DBG(r, "start chxj_delete_cookie_expire_memcache() cookie_id:[%s]", cookie_id);
   /* PASS */
@@ -317,7 +317,7 @@ chxj_delete_cookie_expire_memcache(request_rec *r, mod_chxj_config *m, const cha
 
 
 int
-chxj_cookie_expire_gc_memcache(request_rec *r, mod_chxj_config *m)
+chxj_cookie_expire_gc_memcache(request_rec *r, mod_chxj_config *UNUSED(m))
 {
   DBG(r, "start chxj_cookie_expire_gc_memcache()");
   /* PASS */
index 2ab2bff..db15443 100644 (file)
@@ -2218,10 +2218,10 @@ cmd_set_cookie_lazy_mode(
   dconf = (mod_chxj_config *)mconfig;
 
   if (strcasecmp("TRUE",arg) == 0) {
-    dconf->cookie_lazy_mode = 2;
+    dconf->cookie_lazy_mode = COOKIE_LAZY_ON;
   }
   else {
-    dconf->cookie_lazy_mode = 1;
+    dconf->cookie_lazy_mode = COOKIE_LAZY_OFF;
   }
 
   return NULL;
@@ -2320,7 +2320,7 @@ static const command_rec cmds[] = {
     OR_ALL,
     "It specifies preserving of the cookie ahead. (DBM/MYSQL/MEMCACHE)"),
   AP_INIT_TAKE1(
-    "ChxjCookieLasyMode",
+    "ChxjCookieLazyMode",
     cmd_set_cookie_lazy_mode,
     NULL,
     OR_ALL,