From a6bdfea8c2303145edb174ca5ab3a83575a53ead Mon Sep 17 00:00:00 2001 From: konn Date: Thu, 6 Jul 2006 20:22:37 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/trunk@1711 1a406e8e-add9-4483-a2c8-d8cac5b7c224 --- ChangeLog | 1 + debian/changelog | 1 + include/chxj_cookie.h | 4 ++-- src/chxj_cookie.c | 30 +++++++++++++++++++++--------- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c31bf9a..34ab1749 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ libapache2-mod-chxj (0.8.0-1) unstable; urgency=low * add b tag. * add fieldset tag. * add cookie simulator. + * To use neither SetOutputFilter nor SetInputFilter, it changes. -- Atsushi Konno Mon, 19 Jun 2006 17:29:48 +0900 diff --git a/debian/changelog b/debian/changelog index 641d67b4..94009191 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ libapache2-mod-chxj (0.8.0-1) unstable; urgency=low * add b tag. * add fieldset tag. * add cookie simulator. + * To use neither SetOutputFilter nor SetInputFilter, it changes. -- Atsushi Konno Mon, 19 Jun 2006 17:29:48 +0900 diff --git a/include/chxj_cookie.h b/include/chxj_cookie.h index 55d3cd6a..dd35a323 100644 --- a/include/chxj_cookie.h +++ b/include/chxj_cookie.h @@ -31,9 +31,9 @@ #define COOKIE_EXPIRE_DB_LOCK_NAME "cookie.expire.db.lock" /* - * default cookie timeout is 5 minute + * default cookie timeout is 30 minute */ -#define DEFAULT_COOKIE_TIMEOUT (300) +#define DEFAULT_COOKIE_TIMEOUT (1800) typedef struct cookie_t cookie_t; diff --git a/src/chxj_cookie.c b/src/chxj_cookie.c index 08aa655c..655e2455 100644 --- a/src/chxj_cookie.c +++ b/src/chxj_cookie.c @@ -249,16 +249,18 @@ chxj_update_cookie(request_rec* r, cookie_t* old_cookie) mod_chxj_config* dconf; chxjconvrule_entry* entryp; apr_file_t* file; - int has_cookie = 0; cookie_t* cookie; DBG(r, "start chxj_update_cookie()"); + if (!old_cookie || ! old_cookie->cookie_headers || ! old_cookie->cookie_id) { + DBG(r, "end chxj_update_cookie() (old_cookie is null)"); + return NULL; + } cookie = (cookie_t*)apr_palloc(r->pool, sizeof(cookie_t)); cookie->cookie_id = NULL; - has_cookie = 0; dconf = ap_get_module_config(r->per_dir_config, &chxj_module); entryp = chxj_apply_convrule(r, dconf->convrules); @@ -279,11 +281,6 @@ 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); - if (! has_cookie) { - DBG(r, "no cookie"); - return NULL; - } - file = chxj_cookie_db_lock(r); if (! file) { ERR(r, "mod_chxj: Can't lock cookie db"); @@ -305,6 +302,7 @@ chxj_update_cookie(request_rec* r, cookie_t* old_cookie) chxj_cookie_db_unlock(r, file); return NULL; } + DBG(r, " "); apr_uuid_get(&uuid); uuid_string = apr_palloc(r->pool, APR_UUID_FORMATTED_LENGTH + 1); @@ -321,6 +319,7 @@ chxj_update_cookie(request_rec* r, cookie_t* old_cookie) ERR(r, "md5 failed."); goto on_error; } + DBG(r, " "); cookie->cookie_id = apr_palloc(r->pool, apr_base64_encode_len(APR_MD5_DIGESTSIZE)+1); memset(cookie->cookie_id, 0, APR_MD5_DIGESTSIZE+1); @@ -328,6 +327,7 @@ chxj_update_cookie(request_rec* r, cookie_t* old_cookie) cookie->cookie_id = chxj_url_encode(r,cookie->cookie_id); + DBG(r, " "); /* * create key @@ -350,6 +350,7 @@ chxj_update_cookie(request_rec* r, cookie_t* old_cookie) "\n", NULL); + DBG2(r, "OLD COOKIE VALUE=[%s][%s]", hentryp[ii].key, hentryp[ii].val); store_string = apr_pstrcat(r->pool, store_string, hentryp[ii].key, @@ -406,6 +407,10 @@ chxj_load_cookie(request_rec* r, char* cookie_id) char* val; char* pair; + DBG(r, "========================================================"); + DBG(r, "========================================================"); + DBG(r, "========================================================"); + DBG(r, "========================================================"); DBG1(r, "start chxj_load_cookie() cookie_id=[%s]", cookie_id); chxj_cookie_expire_gc(r); @@ -497,6 +502,10 @@ chxj_load_cookie(request_rec* r, char* cookie_id) apr_dbm_close(f); chxj_cookie_db_unlock(r, file); DBG(r, "end chxj_load_cookie()"); + DBG(r, "========================================================"); + DBG(r, "========================================================"); + DBG(r, "========================================================"); + DBG(r, "========================================================"); return cookie; @@ -510,6 +519,10 @@ on_error1: on_error0: DBG(r, "end chxj_load_cookie()"); + DBG(r, "========================================================"); + DBG(r, "========================================================"); + DBG(r, "========================================================"); + DBG(r, "========================================================"); return NULL; } @@ -522,7 +535,7 @@ chxj_add_cookie_parameter(request_rec* r, char* value, cookie_t* cookie) DBG1(r, "start chxj_add_cookie_parameter() cookie_id=[%s]", (cookie) ? cookie->cookie_id : NULL); - dst = value; + dst = apr_pstrdup(r->pool, value); if (!cookie) goto on_error; @@ -535,7 +548,6 @@ chxj_add_cookie_parameter(request_rec* r, char* value, cookie_t* cookie) goto on_error; } - qs = strchr(dst, '?'); if (qs) { dst = apr_psprintf(r->pool, "%s&%s=%s", dst, CHXJ_COOKIE_PARAM, cookie->cookie_id); -- 2.11.0