for (ii=0; ii<headers->nelts; ii++) {
if (strcasecmp(hentryp[ii].key, "Set-Cookie") == 0) {
- DBG(r, "REQ[%X] cookie=[%s:%s]", (unsigned int)(apr_size_t)r, hentryp[ii].key, hentryp[ii].val);
+ DBG(r, "REQ[%X] cookie=[%s:%s]", TO_ADDR(r), hentryp[ii].key, hentryp[ii].val);
char* key;
char* val;
}
for (ii=0; ii<err_headers->nelts; ii++) {
if (strcasecmp(err_hentryp[ii].key, "Set-Cookie") == 0) {
- DBG(r, "REQ[%X] cookie=[%s:%s]", (unsigned int)(apr_size_t)r, err_hentryp[ii].key, err_hentryp[ii].val);
+ DBG(r, "REQ[%X] cookie=[%s:%s]", TO_ADDR(r), err_hentryp[ii].key, err_hentryp[ii].val);
char* key;
char* val;
char *dst;
char *name = "";
- DBG(r, "start chxj_add_cookie_parameter() cookie_id=[%s]", (cookie) ? cookie->cookie_id : NULL);
+ DBG(r, "REQ[%X] start chxj_add_cookie_parameter() cookie_id=[%s]", TO_ADDR(r), (cookie) ? cookie->cookie_id : NULL);
dst = apr_pstrdup(r->pool, value);
goto on_error;
if (chxj_cookie_check_host(r, value) != 0) {
- DBG(r, "end chxj_add_cookie_parameter()(check host)");
+ DBG(r, "REQ[%X] end chxj_add_cookie_parameter()(check host)", TO_ADDR(r));
goto on_error;
}
qs = strchr(dst, '?');
if (qs) {
+ char *sv_qs = qs;
+ qs = chxj_delete_chxj_cc_param(r, ++qs);
+ DBG(r, "REQ[%X] qs:[%s]",TO_ADDR(r), qs);
+ *sv_qs = 0;
+ if (qs && strlen(qs)) {
+ dst = apr_psprintf(r->pool, "%s?%s", dst, qs);
+ }
+ }
+ if (qs) {
dst = apr_psprintf(r->pool, "%s&%s=%s%s", dst, CHXJ_COOKIE_PARAM, cookie->cookie_id, name);
}
else {
dst = apr_psprintf(r->pool, "%s?%s=%s%s", dst, CHXJ_COOKIE_PARAM, cookie->cookie_id, name);
}
- DBG(r, "end chxj_add_cookie_parameter() dst=[%s]", dst);
+ DBG(r, "REQ[%X] end chxj_add_cookie_parameter() dst=[%s]", TO_ADDR(r), dst);
return dst;
on_error:
- DBG(r, "end chxj_add_cookie_parameter() (on_error)");
+ DBG(r, "REQ[%X] end chxj_add_cookie_parameter() (on_error)", TO_ADDR(r));
return dst;
}
#include "chxj_url_encode.h"
#include "chxj_str_util.h"
#include "chxj_jreserved_tag.h"
+#include "mod_chxj.h"
/**
}
return result;
}
+
+
+char *
+chxj_delete_chxj_cc_param(
+ request_rec *r,
+ const char *str)
+{
+ apr_pool_t *pool;
+ char *s;
+ int xmlFlag = 0;
+
+ DBG(r, "REQ[%X] start chxj_delete_chxj_cc_param() str:[%s]", TO_ADDR(r),str);
+
+ apr_pool_create(&pool, r->pool);
+ s = apr_pstrdup(pool, str);
+
+ if (!s) {
+ DBG(r, "REQ[%X] end chxj_delete_chxj_cc_param() Memory Allocation Error", TO_ADDR(r));
+ return NULL;
+ }
+ char *result = NULL;
+
+ char *pstat;
+ char *pstat2;
+ for (;;) {
+ char *pair = apr_strtok(s, "&", &pstat);
+ if (! pair) break;
+ if (strncasecmp(pair, "amp;", 4) == 0) {
+ pair += 4;
+ xmlFlag = 1;
+ }
+ s = NULL;
+ char *key = apr_strtok(pair, "=", &pstat2);
+ char *val = "";
+ if (key) {
+ val = apr_strtok(NULL, "=", &pstat2);
+ if (!val) val = "";
+ }
+ if (strcasecmp(key, "_chxj_cc")) {
+ if (result) {
+ result = apr_pstrcat(pool, result, ((xmlFlag) ? "&" : "&"), key, "=", val, NULL);
+ }
+ else {
+ result = apr_pstrcat(pool, key, "=", val, NULL);
+ }
+ }
+ }
+ DBG(r, "REQ[%X] result:[%s]", TO_ADDR(r), result);
+ DBG(r, "REQ[%X] end chxj_delete_chxj_cc_param() ", TO_ADDR(r));
+ return result;
+}
/*
* vim:ts=2 et
*/