<wp_width>320</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>320</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>320</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>320</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>640</wp_width>
<wp_heigh>960</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>960</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>960</wp_width>
<wp_heigh>640</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>854</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>960</wp_width>
<wp_heigh>854</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>800</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>320</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>480</wp_width>
<wp_heigh>854</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>960</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>480</wp_width>
<wp_heigh>800</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>600</wp_width>
<wp_heigh>1024</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>480</wp_width>
<wp_heigh>800</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>480</wp_width>
<wp_heigh>854</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>320</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>480</wp_width>
<wp_heigh>854</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>480</wp_width>
<wp_heigh>854</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>1280</wp_width>
<wp_heigh>768</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>800</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>800</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>800</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>800</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>800</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>800</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
<wp_width>800</wp_width>
<wp_heigh>480</wp_heigh>
- <cache>300000</cache>
+ <cache>30000000</cache>
<dpi_width>96</dpi_width>
<dpi_heigh>96</dpi_heigh>
<output_encoding>UTF-8</output_encoding>
int head_tag_out; /* 1 if <head> out */
int charset_out; /* 1 if <meta charset> out */
int blink_keyframe_out;
+
+ char *pagetitle;
};
typedef struct _android_flags_t android_flags_t;
cookie_t *cookie;
css_stylesheet_t *style;
css_prop_list_stack_t *css_prop_stack;
+
+ char *pagetitle;
};
typedef struct _chtml10_flags_t chtml10_flags_t;
cookie_t *cookie;
css_stylesheet_t *style;
css_prop_list_stack_t *css_prop_stack;
+
+ char *pagetitle;
};
typedef struct _chtml20_flags_t chtml20_flags_t;
cookie_t *cookie;
css_stylesheet_t *style;
css_prop_list_stack_t *css_prop_stack;
+
+ char *pagetitle;
};
typedef struct _chtml30_flags_t chtml30_flags_t;
cookie_t *cookie;
css_stylesheet_t *style;
css_prop_list_stack_t *css_prop_stack;
+
+ char *pagetitle;
};
typedef struct _chtml40_flags_t chtml40_flags_t;
cookie_t *cookie;
css_stylesheet_t *style;
css_prop_list_stack_t *css_prop_stack;
+
+ char *pagetitle;
};
typedef struct _chtml50_flags_t chtml50_flags_t;
extern cookie_lock_t *__chxj_cookie_lock(request_rec *r, const char *filename, int line);
extern int __chxj_cookie_unlock(request_rec *r, cookie_lock_t *lock, const char *filename, int line);
-extern char *chxj_add_cookie_no_update_parameter(request_rec *r, char *value);
+extern char *chxj_add_cookie_no_update_parameter(request_rec *r, char *value, int xmlflag);
extern char *chxj_cookie_only_mode(request_rec *r, const char *src, apr_size_t *len, cookie_t *cookie);
char * chxj_uniq_id(request_rec *r);
/*----------------------------------------------------------------------------*/
/* Prototype */
/*----------------------------------------------------------------------------*/
-extern char *chxj_google_analytics_get_image_url(request_rec *r);
+extern char *chxj_google_analytics_get_image_url(request_rec *r, const char *pagetitle);
extern int chxj_google_analytics_handler(request_rec *r);
int head_tag_out; /* 1 if <head> out */
int blink_keyframe_out;
+
+ char *pagetitle;
};
typedef struct _iphone_flags_t iphone_flags_t;
css_stylesheet_t *style;
css_prop_list_stack_t *css_prop_stack;
int start_html_flag;
+
+ char *pagetitle;
};
typedef struct _ixhtml10_flags_t ixhtml10_flags_t;
cookie_t *cookie;
css_stylesheet_t *style;
css_prop_list_stack_t *css_prop_stack;
+
+ char *pagetitle;
};
typedef struct _jhtml_flags_t jhtml_flags_t;
cookie_t *cookie;
css_stylesheet_t *style;
css_prop_list_stack_t *css_prop_stack;
+
+ char *pagetitle;
};
typedef struct _jxhtml_flags_t jxhtml_flags_t;
css_prop_list_stack_t *css_prop_stack;
int start_html_flag;
+
+ char *pagetitle;
};
typedef struct _xhtml_flags_t xhtml_flags_t;
* @return The conversion result is returned.
*/
static char *
-s_android_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_android_start_title_tag(void *pdoc, Node *node)
{
android_t *android;
Doc *doc;
r = doc->r;
W_L("<title>");
+ if (android->conf->use_google_analytics) {
+ android->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ android->pagetitle = apr_pstrcat(doc->r->pool, android->pagetitle, textval, NULL);
+ }
+ }
+
return android->out;
}
r = doc->r;
if (android->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(r);
+ char *src = chxj_google_analytics_get_image_url(r, android->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value, 1);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, android->entryp, 1);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 1);
value = chxj_img_rewrite_parameter(r,android->conf,value);
attr_src = value;
#else
value = chxj_img_conv(r, spec, value);
value = chxj_encoding_parameter(r, value, 1);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, android->entryp, 1);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 1);
value = chxj_img_rewrite_parameter(r,android->conf,value);
attr_src = value;
#endif
* @return The conversion result is returned.
*/
static char *
-s_chtml10_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_chtml10_start_title_tag(void *pdoc, Node *node)
{
Doc *doc;
chtml10_t *chtml10;
W_L("<title>");
+ if (chtml10->conf->use_google_analytics) {
+ chtml10->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ chtml10->pagetitle = apr_pstrcat(doc->r->pool, chtml10->pagetitle, textval, NULL);
+ }
+ }
+
return chtml10->out;
}
doc = chtml10->doc;
if (chtml10->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(doc->r);
+ char *src = chxj_google_analytics_get_image_url(doc->r, chtml10->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value, 0);
value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,chtml10->conf,value);
attr_src = value;
#else
* @return The conversion result is returned.
*/
static char *
-s_chtml20_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_chtml20_start_title_tag(void *pdoc, Node *node)
{
chtml20_t *chtml20;
Doc *doc;
W_L("<title>");
+ if (chtml20->conf->use_google_analytics) {
+ chtml20->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ chtml20->pagetitle = apr_pstrcat(doc->r->pool, chtml20->pagetitle, textval, NULL);
+ }
+ }
+
return chtml20->out;
}
r = doc->r;
if (chtml20->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(r);
+ char *src = chxj_google_analytics_get_image_url(r, chtml20->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value, 0);
value = chxj_add_cookie_parameter(r, value, chtml20->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,chtml20->conf,value);
attr_src = value;
#else
* @return The conversion result is returned.
*/
static char *
-s_chtml30_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_chtml30_start_title_tag(void *pdoc, Node *node)
{
chtml30_t *chtml30 = GET_CHTML30(pdoc);
Doc *doc = chtml30->doc;
W_L("<title>");
+ if (chtml30->conf->use_google_analytics) {
+ chtml30->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ chtml30->pagetitle = apr_pstrcat(doc->r->pool, chtml30->pagetitle, textval, NULL);
+ }
+ }
+
return chtml30->out;
}
doc = chtml30->doc;
if (chtml30->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(doc->r);
+ char *src = chxj_google_analytics_get_image_url(doc->r, chtml30->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value, 0);
value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,chtml30->conf,value);
attr_src = value;
#else
value = chxj_img_conv(r,spec,value);
value = chxj_encoding_parameter(r, value, 0);
value = chxj_add_cookie_parameter(r, value, chtml30->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,chtml30->conf,value);
attr_src = value;
#endif
* @return The conversion result is returned.
*/
static char *
-s_chtml40_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_chtml40_start_title_tag(void *pdoc, Node *node)
{
chtml40_t *chtml40 = GET_CHTML40(pdoc);
Doc *doc = chtml40->doc;
W_L("<title>");
+ if (chtml40->conf->use_google_analytics) {
+ chtml40->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ chtml40->pagetitle = apr_pstrcat(doc->r->pool, chtml40->pagetitle, textval, NULL);
+ }
+ }
+
return chtml40->out;
}
doc = chtml40->doc;
if (chtml40->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(doc->r);
+ char *src = chxj_google_analytics_get_image_url(doc->r, chtml40->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value, 0);
value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,chtml40->conf,value);
attr_src = value;
#else
value = chxj_img_conv(r,spec,value);
value = chxj_encoding_parameter(r, value, 0);
value = chxj_add_cookie_parameter(r, value, chtml40->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,chtml40->conf,value);
attr_src = value;
#endif
* @return The conversion result is returned.
*/
static char *
-s_chtml50_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_chtml50_start_title_tag(void *pdoc, Node *node)
{
chtml50_t *chtml50 = GET_CHTML50(pdoc);
Doc *doc = chtml50->doc;
W_L("<title>");
+ if (chtml50->conf->use_google_analytics) {
+ chtml50->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ chtml50->pagetitle = apr_pstrcat(doc->r->pool, chtml50->pagetitle, textval, NULL);
+ }
+ }
+
return chtml50->out;
}
doc = chtml50->doc;
if (chtml50->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(doc->r);
+ char *src = chxj_google_analytics_get_image_url(doc->r, chtml50->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value, 0);
value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,chtml50->conf,value);
attr_src = value;
#else
value = chxj_img_conv(r,spec,value);
value = chxj_encoding_parameter(r, value, 0);
value = chxj_add_cookie_parameter(r, value, chtml50->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,chtml50->conf,value);
attr_src = value;
#endif
char *
-chxj_add_cookie_no_update_parameter(request_rec *r, char *value)
+chxj_add_cookie_no_update_parameter(request_rec *r, char *value, int xmlflag)
{
char *qs;
char *dst;
name = apr_pstrdup(r->pool, qs);
*qs = 0;
}
- dst = apr_psprintf(r->pool, "%s%c%s=true%s", dst, (strchr(dst,'?')) ? '&' : '?',CHXJ_COOKIE_NOUPDATE_PARAM, name);
+ char *amp = "&";
+ if (xmlflag) {
+ amp = "&";
+ }
+ dst = apr_psprintf(r->pool, "%s%s%s=true%s", dst, (strchr(dst,'?')) ? amp : "?",CHXJ_COOKIE_NOUPDATE_PARAM, name);
DBG(r,"REQ[%X] dst=[%s]", TO_ADDR(r), dst);
DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
return dst;
#include "chxj_preg_replace.h"
#include "chxj_serf.h"
#include "chxj_url_encode.h"
+#include "chxj_encoding.h"
#include "apr_uuid.h"
#include "apr_md5.h"
char *
-chxj_google_analytics_get_image_url(request_rec *r)
+chxj_google_analytics_get_image_url(request_rec *r, const char *pagetitle)
{
char *url;
char *referer;
char *query;
char *path;
+ char *ptitle;
mod_chxj_config *conf;
int rdm;
apr_pool_t *pool;
+ apr_size_t plen;
DBG(r, "REQ[%X] start %s()", TO_ADDR(r),__func__);
rdm = rand();
apr_pool_create(&pool, r->pool);
+
+
+ plen = 0;
+ ptitle = "";
+ if (pagetitle) {
+ plen = strlen(pagetitle);
+ ptitle = chxj_iconv(r,pool,apr_pstrdup(pool, pagetitle),&plen,"CP932","UTF-8");
+ }
+ else {
+ ptitle = "(no name)";
+ }
url = apr_pstrdup(pool, conf->google_analytics_target);
url = apr_pstrcat(pool, url, "?", NULL);
url = apr_pstrcat(pool, url, "utmac=", conf->google_analytics_account, NULL);
url = apr_pstrcat(pool, url, "&utmn=", apr_psprintf(pool, "%d",rdm), NULL);
+ url = apr_pstrcat(pool, url, "&utmdt=", chxj_url_encode(pool, ptitle), NULL);
referer = (char *)apr_table_get(r->headers_in, "Referer");
DBG(r, "REQ[%X] referer:[%s]", TO_ADDR(r), referer);
}
char *nowFormat = MagickGetImageFormat(magick_wand);
DestroyMagickWand(magick_wand);
+ char *fname = apr_pstrdup(r->pool, r->filename);
+ char *ext = strrchr(fname, '.');
if (nowFormat) {
if (STRCASEEQ('j','J',"jpeg",nowFormat) || STRCASEEQ('j','J',"jpg",nowFormat)) {
DBG(r,"REQ[%X] detect cache file => jpg.",TO_ADDR(r));
ap_set_content_type(r, "image/jpeg");
+
+ if (!ext) {
+ fname = apr_pstrcat(r->pool, fname, ".jpg");
+ }
+ else if (ext && strcasecmp(".jpeg", ext) != 0 && strcasecmp(".jpg", ext) != 0) {
+ *ext = 0;
+ fname = apr_pstrcat(r->pool, fname, ".jpg");
+ }
}
else if (STRCASEEQ('p','P',"png", nowFormat)) {
DBG(r,"REQ[%X] detect cache file => png.",TO_ADDR(r));
ap_set_content_type(r, "image/png");
+
+ if (!ext) {
+ fname = apr_pstrcat(r->pool, fname, ".png");
+ }
+ else if (ext && strcasecmp(".png", ext) != 0) {
+ *ext = 0;
+ fname = apr_pstrcat(r->pool, fname, ".png");
+ }
+
}
else if (STRCASEEQ('g','G',"gif", nowFormat)) {
DBG(r,"REQ[%X] detect cache file => gif.",TO_ADDR(r));
ap_set_content_type(r, "image/gif");
+
+ if (!ext) {
+ fname = apr_pstrcat(r->pool, fname, ".gif");
+ }
+ else if (ext && strcasecmp(".gif", ext) != 0) {
+ *ext = 0;
+ fname = apr_pstrcat(r->pool, fname, ".gif");
+ }
}
else if (STRCASEEQ('b','B',"bmp", nowFormat)) {
DBG(r,"REQ[%X] detect cache file => bmp.",TO_ADDR(r));
ap_set_content_type(r, "image/bmp");
+
+ if (!ext) {
+ fname = apr_pstrcat(r->pool, fname, ".bmp");
+ }
+ else if (ext && strcasecmp(".bmp", ext) != 0) {
+ *ext = 0;
+ fname = apr_pstrcat(r->pool, fname, ".bmp");
+ }
}
else {
ERR(r,"REQ[%X] detect unknown file",TO_ADDR(r));
return HTTP_NOT_FOUND;
}
}
+ if (query_string->mode == IMG_CONV_MODE_WALLPAPER && (IS_IPHONE(spec)||IS_ANDROID(spec))) {
+ ap_set_content_type(r, "application/octet-stream");
+ apr_table_setn(r->headers_out, "Content-Disposition", apr_psprintf(r->pool, "attachment; filename=%s", fname));
+ DBG(r,"REQ[%X] detect cache file => iphone/android",TO_ADDR(r));
+ }
if (conf->image_copyright) {
DBG(r,"REQ[%X] Add COPYRIGHT Header for SoftBank [%s]", TO_ADDR(r), conf->image_copyright);
if (spec->html_spec_type == CHXJ_SPEC_Jhtml || spec->html_spec_type == CHXJ_SPEC_Jxhtml) {
* @return The conversion result is returned.
*/
static char *
-s_iphone_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_iphone_start_title_tag(void *pdoc, Node *node)
{
iphone_t *iphone;
Doc *doc;
r = doc->r;
W_L("<title>");
+ if (iphone->conf->use_google_analytics) {
+ iphone->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ iphone->pagetitle = apr_pstrcat(doc->r->pool, iphone->pagetitle, textval, NULL);
+ }
+ }
return iphone->out;
}
r = doc->r;
if (iphone->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(r);
+ char *src = chxj_google_analytics_get_image_url(r, iphone->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value, 1);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, iphone->entryp, 1);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 1);
value = chxj_img_rewrite_parameter(r,iphone->conf,value);
attr_src = value;
#else
value = chxj_img_conv(r, spec, value);
value = chxj_encoding_parameter(r, value, 1);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, iphone->entryp, 1);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 1);
value = chxj_img_rewrite_parameter(r,iphone->conf,value);
attr_src = value;
#endif
* @return The conversion result is returned.
*/
static char *
-s_ixhtml10_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_ixhtml10_start_title_tag(void *pdoc, Node *node)
{
ixhtml10_t *ixhtml10;
Doc *doc;
r = doc->r;
W_L("<title>");
+
+ if (ixhtml10->conf->use_google_analytics) {
+ ixhtml10->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ ixhtml10->pagetitle = apr_pstrcat(doc->r->pool, ixhtml10->pagetitle, textval, NULL);
+ }
+ }
+
return ixhtml10->out;
}
r = doc->r;
if (ixhtml10->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(r);
+ char *src = chxj_google_analytics_get_image_url(r, ixhtml10->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value, 1);
value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 1);
value = chxj_img_rewrite_parameter(r,ixhtml10->conf,value);
attr_src = value;
#else
value = chxj_img_conv(r, spec, value);
value = chxj_encoding_parameter(r, value, 1);
value = chxj_add_cookie_parameter(r, value, ixhtml10->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 1);
value = chxj_img_rewrite_parameter(r,ixhtml10->conf,value);
attr_src = value;
#endif
* @return The conversion result is returned.
*/
static char *
-s_jhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_jhtml_start_title_tag(void *pdoc, Node *node)
{
jhtml_t *jhtml;
Doc *doc;
r = doc->r;
W_L("<title>");
+
+ if (jhtml->conf->use_google_analytics) {
+ jhtml->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ jhtml->pagetitle = apr_pstrcat(doc->r->pool, jhtml->pagetitle, textval, NULL);
+ }
+ }
return jhtml->out;
}
r = doc->r;
if (jhtml->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(r);
+ char *src = chxj_google_analytics_get_image_url(r, jhtml->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
value = chxj_encoding_parameter(r, value, 0);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp, 0);
value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,jhtml->conf,value);
value = s_add_copyright_parameter(r, value);
attr_src = value;
value = chxj_encoding_parameter(r, value, 0);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp, 0);
value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 0);
value = chxj_img_rewrite_parameter(r,jhtml->conf,value);
value = s_add_copyright_parameter(r, value);
attr_src = value;
* @return The conversion result is returned.
*/
static char *
-s_jxhtml_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_jxhtml_start_title_tag(void *pdoc, Node *node)
{
jxhtml_t *jxhtml;
Doc *doc;
r = doc->r;
W_L("<title>");
+
+ if (jxhtml->conf->use_google_analytics) {
+ jxhtml->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ jxhtml->pagetitle = apr_pstrcat(doc->r->pool, jxhtml->pagetitle, textval, NULL);
+ }
+ }
return jxhtml->out;
}
r = doc->r;
if (jxhtml->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(r);
+ char *src = chxj_google_analytics_get_image_url(r, jxhtml->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value, 1);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 1);
value = chxj_img_rewrite_parameter(r,jxhtml->conf,value);
attr_src = value;
#else
value = chxj_img_conv(r, spec, value);
value = chxj_encoding_parameter(r, value, 1);
value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jxhtml->entryp, 1);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 1);
value = chxj_img_rewrite_parameter(r,jxhtml->conf,value);
attr_src = value;
#endif
* @return The conversion result is returned.
*/
static char *
-s_xhtml_1_0_start_title_tag(void *pdoc, Node *UNUSED(node))
+s_xhtml_1_0_start_title_tag(void *pdoc, Node *node)
{
xhtml_t *xhtml = GET_XHTML(pdoc);
Doc *doc = xhtml->doc;
W_L("<title>");
+ if (xhtml->conf->use_google_analytics) {
+ xhtml->pagetitle = "";
+ Node *child;
+ for (child = qs_get_child_node(doc,node);
+ child;
+ child = qs_get_next_node(doc,child)) {
+ char *textval = qs_get_node_value(doc,child);
+ xhtml->pagetitle = apr_pstrcat(doc->r->pool, xhtml->pagetitle, textval, NULL);
+ }
+ }
return xhtml->out;
}
if (xhtml->conf->use_google_analytics) {
- char *src = chxj_google_analytics_get_image_url(xhtml->doc->r);
+ char *src = chxj_google_analytics_get_image_url(xhtml->doc->r, xhtml->pagetitle);
W_L("<img src=\"");
W_V(src);
W_L("\" />");
if (STRCASEEQ('s','S',"src",name)) {
value = chxj_encoding_parameter(r, value, 1);
value = chxj_add_cookie_parameter(r, value, xhtml->cookie);
- value = chxj_add_cookie_no_update_parameter(r, value);
+ value = chxj_add_cookie_no_update_parameter(r, value, 1);
value = chxj_img_rewrite_parameter(r,xhtml->conf,value);
#ifdef IMG_NOT_CONVERT_FILENAME
attr_src = value;