withval=$with_apache_header;
fi
-#[, ACTION-IF-GIVEN[, ACTION-IF-NOT-GIVEN]])
-if test "x$with_apache_header" = "x"; then
- { { echo "$as_me:$LINENO: error:
-Please specify the --with-apache-header option.
-" >&5
-echo "$as_me: error:
-Please specify the --with-apache-header option.
-" >&2;}
- { (exit 1); exit 1; }; }
-fi
if test "x$with_apache_header" = "xyes"; then
{ { echo "$as_me:$LINENO: error:
Please specify the --with-apache-header option. And, please specify the place of the header file.
;;
esac
+if test "x${with_apache_header}" = "x" ; then
+ with_apache_header=`${APXS} -q includedir`
+fi
LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` "
LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
AC_CHECK_LIB([apr-1], [main])
AC_ARG_WITH(apache-header, [ --with-apache-header=ARG The directory with the header file of apache2.0 is specified. ])
-#[, ACTION-IF-GIVEN[, ACTION-IF-NOT-GIVEN]])
-if test "x$with_apache_header" = "x"; then
- AC_MSG_ERROR([
-Please specify the --with-apache-header option.
-])
-fi
if test "x$with_apache_header" = "xyes"; then
AC_MSG_ERROR([
Please specify the --with-apache-header option. And, please specify the place of the header file.
;;
esac
+if test "x${with_apache_header}" = "x" ; then
+ with_apache_header=`${APXS} -q includedir`
+fi
LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` "
LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
/* default: 10MByte */
#define DEFAULT_IMAGE_CACHE_LIMIT (10*1024*1024)
+/* micro second */
+#define CACHE_RECHECK_WAIT (200000)
+#define CACHE_RETRY_COUNT (5)
+
extern int chxj_img_conv_format_handler(
request_rec* r);
#define CHXJ_IMG_OFF (0)
-#define DBG(X,Y) ap_log_rerror(APLOG_MARK,APLOG_DEBUG,0,(request_rec*)(X),(Y))
-#define DBG1(X,Y,Za) ap_log_rerror(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za))
-#define DBG2(X,Y,Za,Zb) ap_log_rerror(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za),(Zb))
-#define DBG3(X,Y,Za,Zb,Zc) ap_log_rerror(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za),(Zb),(Zc))
-#define DBG4(X,Y,Za,Zb,Zc,Zd) ap_log_rerror(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za),(Zb),(Zc),(Zd))
-#define DBG5(X,Y,Za,Zb,Zc,Zd,Ze) ap_log_rerror(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za),(Zb),(Zc),(Zd),(Ze))
+#define DBG(X,args...) ap_log_rerror(APLOG_MARK,APLOG_DEBUG,0,(request_rec*)(X),##args)
#define SDBG(X,Y) ap_log_error(APLOG_MARK,APLOG_DEBUG,0,(X),(Y))
-#define SDBG1(X,Y,Za) ap_log_error(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za))
-#define SDBG2(X,Y,Za,Zb) ap_log_error(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za),(Zb))
-#define SDBG3(X,Y,Za,Zb,Zc) ap_log_error(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za),(Zb),(Zc))
-#define SDBG4(X,Y,Za,Zb,Zc,Zd) ap_log_error(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za),(Zb),(Zc),(Zd))
-#define SDBG5(X,Y,Za,Zb,Zc,Zd,Ze) ap_log_error(APLOG_MARK,APLOG_DEBUG,0,(X),(Y),(Za),(Zb),(Zc),(Zd),(Ze))
-#define ERR(X,Y) ap_log_rerror(APLOG_MARK,APLOG_ERR,0,(X),(Y))
-#define ERR1(X,Y,Za) ap_log_rerror(APLOG_MARK,APLOG_ERR,0,(X),(Y),(Za))
-#define ERR2(X,Y,Za,Zb) ap_log_rerror(APLOG_MARK,APLOG_ERR,0,(X),(Y),(Za),(Zb))
+#define ERR(X,args...) ap_log_rerror(APLOG_MARK,APLOG_ERR,0,(X), ##args)
#define SERR(X,Y) ap_log_error(APLOG_MARK,APLOG_ERR,0,(X),(Y))
-#define SERR1(X,Y,Za) ap_log_error(APLOG_MARK,APLOG_ERR,0,(X),(Y),(Za))
-#define SERR2(X,Y,Za,Zb) ap_log_error(APLOG_MARK,APLOG_ERR,0,(X),(Y),(Za),(Zb))
+#define WRN(rec,format,args...) ap_log_rerror(APLOG_MARK,APLOG_WARNING,0,(rec),(format), ##args)
extern tag_handlers chxj_tag_handlers[];
extern tag_handler chtml10_handler[];
uri = r->uri;
- DBG2(r,"convert rule pattern=[%s] uri=[%s]", pp->pattern, uri);
+ DBG(r,"convert rule pattern=[%s] uri=[%s]", pp->pattern, uri);
rtn = ap_regexec((const ap_regex_t*)pp->regexp, uri, AP_MAX_REG_MATCH, (ap_regmatch_t*)regmatch, 0);
if (rtn == 0) {
ecc_count = v_ecc_spec_table[qrcode->version*4+qrcode->level].rs[rs_pos].total_code_count - data_count;
#ifdef QR_CODE_DEBUG
- DBG2(r,"data_count[%d] ecc_count[%d]", data_count, ecc_count);
+ DBG(r,"data_count[%d] ecc_count[%d]", data_count, ecc_count);
#endif
rs_block[now_rs_num] = (unsigned char*)apr_palloc(qrcode->r->pool, data_count + ecc_count + 1);
for (jj=ecc_count + data_count - 1; jj>=0; jj--)
debug_rows = apr_pstrcat(r->pool, debug_rows, apr_psprintf(r->pool, "[%d]", tmp[jj]), NULL);
- DBG1(r,"rows [%s]", debug_rows);
+ DBG(r,"rows [%s]", debug_rows);
} while(0);
/* for DEBUG END */
#endif
int tgt = tmp[ii--];
int shisu = v_galois_int_to_log[tgt];
#ifdef QR_CODE_DEBUG
- DBG2(r,"tgt[%d] shisu[%d]", tgt, shisu);
+ DBG(r,"tgt[%d] shisu[%d]", tgt, shisu);
#endif
if (tgt == 0)
continue;
for (jj=ecc_count + data_count - 1; jj>=0; jj--)
debug_rows = apr_pstrcat(r->pool, debug_rows, apr_psprintf(r->pool, "[%d]", tmp[jj]), NULL);
- DBG1(r,"rows [%s]", debug_rows);
+ DBG(r,"rows [%s]", debug_rows);
} while(0);
/* for DEBUG END */
#endif
do {
DBG(r,"######### AFTER BLOCK DUMP ###############");
for (ii=0; ii<rslt_pos; ii++) {
- DBG1(r,"[%d]", dst[ii]);
+ DBG(r,"[%d]", dst[ii]);
}
} while(0);
#endif
dst = NULL;
- DBG1(r, "start chxj_exchange_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
+ DBG(r, "start chxj_exchange_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
/*--------------------------------------------------------------------------*/
/* If qrcode xml */
chxj_dump_out("[dst] CHTML -> CHTML1.0", dst, *dstlen);
#endif
- DBG1(r, "end chxj_exchange_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
+ DBG(r, "end chxj_exchange_chtml10() cookie_id=[%s]", (cookie) ? cookie->cookie_id : "");
return dst;
}
for (ii=0; ii<headers->nelts; ii++) {
if (strcasecmp(hentryp[ii].key, "Set-Cookie") == 0) {
DBG(r, "=====================================");
- DBG2(r, "cookie=[%s:%s]", hentryp[ii].key, hentryp[ii].val);
+ DBG(r, "cookie=[%s:%s]", hentryp[ii].key, hentryp[ii].val);
char* key;
char* val;
refer_string = apr_pstrcat(r->pool, refer_string, "?", r->args, NULL);
}
apr_table_setn(new_cookie_table, REFERER_COOKIE_KEY, refer_string);
- DBG1(r, "ADD REFER[%s]", refer_string);
+ DBG(r, "ADD REFER[%s]", refer_string);
has_cookie++;
}
r->pool);
if (retval != APR_SUCCESS) {
DBG(r, "end chxj_save_cookie()");
- ERR2(r, "could not open dbm (type %s) auth file: %s",
+ ERR(r, "could not open dbm (type %s) auth file: %s",
"default",
chxj_cookie_db_name_create(r,dconf->cookie_db_dir));
chxj_cookie_db_unlock(r, file);
memset(cookie->cookie_id, 0, APR_MD5_DIGESTSIZE+1);
apr_base64_encode(cookie->cookie_id, (char*)md5_value, APR_MD5_DIGESTSIZE);
- DBG1(r, "cookie->cookie_id=[%s]", cookie->cookie_id);
+ DBG(r, "cookie->cookie_id=[%s]", cookie->cookie_id);
cookie->cookie_id = chxj_url_encode(r,cookie->cookie_id);
- DBG1(r, "cookie->cookie_id=[%s]", cookie->cookie_id);
+ DBG(r, "cookie->cookie_id=[%s]", cookie->cookie_id);
/*
* create key
*/
retval = apr_dbm_store(f, dbmkey, dbmval);
if (retval != APR_SUCCESS) {
- ERR1(r, "Cannot store Cookie data to DBM file `%s'",
+ ERR(r, "Cannot store Cookie data to DBM file `%s'",
chxj_cookie_db_name_create(r, dconf->cookie_db_dir));
goto on_error;
}
APR_OS_DEFAULT,
r->pool);
if (retval != APR_SUCCESS) {
- ERR2(r, "could not open dbm (type %s) auth file: %s",
+ ERR(r, "could not open dbm (type %s) auth file: %s",
"default",
chxj_cookie_db_name_create(r,dconf->cookie_db_dir));
chxj_cookie_db_unlock(r, file);
"\n",
NULL);
- DBG2(r, "OLD COOKIE VALUE=[%s][%s]", hentryp[ii].key, hentryp[ii].val);
+ DBG(r, "OLD COOKIE VALUE=[%s][%s]", hentryp[ii].key, hentryp[ii].val);
store_string = apr_pstrcat(r->pool,
store_string,
hentryp[ii].key,
*/
retval = apr_dbm_store(f, dbmkey, dbmval);
if (retval != APR_SUCCESS) {
- ERR1(r, "Cannot store Cookie data to DBM file `%s'",
+ ERR(r, "Cannot store Cookie data to DBM file `%s'",
chxj_cookie_db_name_create(r, dconf->cookie_db_dir));
goto on_error;
}
DBG(r, "========================================================");
DBG(r, "========================================================");
DBG(r, "========================================================");
- DBG1(r, "start chxj_load_cookie() cookie_id=[%s]", cookie_id);
+ DBG(r, "start chxj_load_cookie() cookie_id=[%s]", cookie_id);
chxj_cookie_expire_gc(r);
cookie = (cookie_t*)apr_palloc(r->pool, sizeof(cookie_t));
APR_OS_DEFAULT,
r->pool);
if (retval != APR_SUCCESS) {
- ERR2(r,
+ ERR(r,
"could not open dbm (type %s) auth file: %s",
"default",
chxj_cookie_db_name_create(r, dconf->cookie_db_dir));
retval = apr_dbm_fetch(f, dbmkey, &dbmval);
if (retval != APR_SUCCESS) {
- ERR2(r,
+ ERR(r,
"could not fetch dbm (type %s) auth file: %s", "default",
chxj_cookie_db_name_create(r, dconf->cookie_db_dir));
goto on_error2;
load_string = NULL;
if (!pair) break;
- DBG1(r, "Cookie:[%s]", pair);
+ DBG(r, "Cookie:[%s]", pair);
char* tmp_pair;
tmp_pair = apr_pstrdup(r->pool, pair);
char* qs;
char* dst;
- DBG1(r, "start chxj_add_cookie_parameter() cookie_id=[%s]", (cookie) ? cookie->cookie_id : NULL);
+ DBG(r, "start chxj_add_cookie_parameter() cookie_id=[%s]", (cookie) ? cookie->cookie_id : NULL);
dst = apr_pstrdup(r->pool, value);
dst = apr_psprintf(r->pool, "%s?%s=%s", dst, CHXJ_COOKIE_PARAM, cookie->cookie_id);
}
- DBG1(r, "end chxj_add_cookie_parameter() dst=[%s]", dst);
+ DBG(r, "end chxj_add_cookie_parameter() dst=[%s]", dst);
return dst;
{
char* hostnm;
- DBG1(r, "hostname=[%s]", r->hostname);
+ DBG(r, "hostname=[%s]", r->hostname);
hostnm = s_get_hostname_from_url(r, value);
if (hostnm) {
APR_OS_DEFAULT,
r->pool);
if (retval != APR_SUCCESS) {
- ERR2(r,
+ ERR(r,
"could not open dbm (type %s) auth file: %s",
"default",
chxj_cookie_db_name_create(r,dconf->cookie_db_dir));
dst = apr_pstrdup(r->pool, dir);
DBG(r, " ");
}
- DBG1(r, "dst[strlen(dst)-1]=[%c]", dst[strlen(dst)-1]);
+ DBG(r, "dst[strlen(dst)-1]=[%c]", dst[strlen(dst)-1]);
if (dst[strlen(dst)-1] != '/') {
dst = apr_pstrcat(r->pool, dst, "/", COOKIE_DB_LOCK_NAME, NULL);
}
APR_OS_DEFAULT,
r->pool);
if (retval != APR_SUCCESS) {
- ERR2(r, "could not open dbm (type %s) auth file: %s",
+ ERR(r, "could not open dbm (type %s) auth file: %s",
"default",
chxj_cookie_expire_db_name_create(r,dconf->cookie_db_dir));
chxj_cookie_expire_db_unlock(r, file);
*/
retval = apr_dbm_store(f, dbmkey, dbmval);
if (retval != APR_SUCCESS) {
- ERR1(r, "Cannot store Cookie data to DBM file `%s'",
+ ERR(r, "Cannot store Cookie data to DBM file `%s'",
chxj_cookie_db_name_create(r, dconf->cookie_db_dir));
}
APR_OS_DEFAULT,
r->pool);
if (retval != APR_SUCCESS) {
- ERR2(r,
+ ERR(r,
"could not open dbm (type %s) auth file: %s",
"default",
chxj_cookie_expire_db_name_create(r,dconf->cookie_db_dir));
APR_OS_DEFAULT,
r->pool);
if (retval != APR_SUCCESS) {
- ERR2(r,
+ ERR(r,
"could not open dbm (type %s) auth file: %s",
"default",
chxj_cookie_expire_db_name_create(r,dconf->cookie_db_dir));
retval = apr_dbm_firstkey(f, &dbmkey);
if (retval == APR_SUCCESS) {
- DBG2(r, "firstkey=[%.*s]", (int)dbmkey.dsize, dbmkey.dptr);
+ DBG(r, "firstkey=[%.*s]", (int)dbmkey.dsize, dbmkey.dptr);
do {
char* tmp;
char* old_cookie_id;
else
cmp_time = now_time - dconf->cookie_timeout;
- DBG1(r, "dconf->cookie_timeout=[%d]", (int)dconf->cookie_timeout);
- DBG4(r, "key=[%.*s] cmp_time=[%d] val_time=[%d]", (int)dbmkey.dsize, dbmkey.dptr, cmp_time, val_time);
+ DBG(r, "dconf->cookie_timeout=[%d]", (int)dconf->cookie_timeout);
+ DBG(r, "key=[%.*s] cmp_time=[%d] val_time=[%d]", (int)dbmkey.dsize, dbmkey.dptr, cmp_time, val_time);
if (cmp_time >= val_time) {
apr_dbm_delete(f, dbmkey);
memcpy(old_cookie_id, dbmkey.dptr, dbmkey.dsize);
chxj_delete_cookie(r,old_cookie_id);
- DBG1(r, "detect timeout cookie [%s]", old_cookie_id);
+ DBG(r, "detect timeout cookie [%s]", old_cookie_id);
}
retval = apr_dbm_nextkey(f, &dbmkey);
DBG(r,"end chxj_encoding()");
return ibuf;
}
- DBG2(r,"encode convert [%s] -> [%s]", entryp->encoding, "CP932");
+ DBG(r,"encode convert [%s] -> [%s]", entryp->encoding, "CP932");
memset(obuf, 0, olen);
cd = iconv_open("CP932", entryp->encoding);
*len = olen;
iconv_close(cd);
- DBG3(r,"end chxj_encoding() len=[%d] obuf=[%.*s]", (int)*len, (int)*len, spos);
+ DBG(r,"end chxj_encoding() len=[%d] obuf=[%.*s]", (int)*len, (int)*len, spos);
return spos;
}
DBG(r,"end chxj_rencoding()");
return ibuf;
}
- DBG2(r,"encode convert [%s] -> [%s]", "CP932", entryp->encoding);
+ DBG(r,"encode convert [%s] -> [%s]", "CP932", entryp->encoding);
memset(obuf, 0, olen);
*len = olen;
iconv_close(cd);
- DBG3(r,"end chxj_rencoding() len=[%d] obuf=[%.*s]", (int)*len, (int)*len, spos);
+ DBG(r,"end chxj_rencoding() len=[%d] obuf=[%.*s]", (int)*len, (int)*len, spos);
return spos;
}
/* The Location header generates tag in an initial HDML machine for the */
/* uncorrespon dence. */
/*------------------------------------------------------------------------*/
- DBG1(r, "Location is not null[Location:%s]", buf);
+ DBG(r, "Location is not null[Location:%s]", buf);
s_output_to_hdml_out(&hdml,
"<HDML VERSION=3.0 MARKABLE=TRUE PUBLIC=TRUE>\n"
"<NODISPLAY MARKABLE=TRUE PUBLIC=TRUE TITLE=\" \">\n"
memset(ss, 0, srclen + 1);
memcpy(ss, src, srclen);
- DBG1(r, "input strlen(src)=[%d]\n", (int)srclen);
- DBG1(r, "[[[[%s]]]\n", src);
+ DBG(r, "input strlen(src)=[%d]\n", (int)srclen);
+ DBG(r, "[[[[%s]]]\n", src);
qs_init_malloc(&doc);
qs_init_root_node(&doc);
chxj_node_exchange(spec,r,(void*)&hdml, &doc, qs_get_root(&doc), 0);
dst = hdml.out;
- DBG1(r,"tmp=[%s]", dst);
+ DBG(r,"tmp=[%s]", dst);
qs_all_free(&doc,QX_LOGMARK);
}
for (ii=0; ii<MAX_RADIO_COUNT; ii++) {
if (! hdml->radio_name_list[ii]) {
/* @todo Oops.. */
- DBG1(r, "Oops... radio list is null[%d]", ii);
+ DBG(r, "Oops... radio list is null[%d]", ii);
/*----------------------------------------------------------------------*/
/* Processing is ended because it doesn't happen off the fly. */
/*----------------------------------------------------------------------*/
}
if (hdml->radio_checked_value[ii]) {
- DBG1(r,"radio button is checked. checked value is [%s]",
+ DBG(r,"radio button is checked. checked value is [%s]",
hdml->radio_checked_value[ii]);
s_output_to_init_vars(hdml,
apr_psprintf(r->pool,
selval = qs_alloc_zero_byte_string(r);
}
else {
- DBG1(r, "selected value found[%s]" , selval);
+ DBG(r, "selected value found[%s]" , selval);
}
selvaltxt = qs_get_selected_value_text(doc, node, r);
if (!selvaltxt)
selvaltxt = qs_alloc_zero_byte_string(r);
- DBG1(r, "selvaltxt:[%s]" ,selvaltxt);
+ DBG(r, "selvaltxt:[%s]" ,selvaltxt);
s_output_to_init_vars(hdml,
apr_psprintf(r->pool,
else
txtval = qs_get_node_value(doc, child);
- DBG1(r, "txtval:[%s]" , txtval);
+ DBG(r, "txtval:[%s]" , txtval);
if (val && txtval) {
s_output_to_hdml_card(hdml,
/*------------------------------------------------------------------------*/
for (ii=0; ii<MAX_RADIO_COUNT; ii++) {
if (! hdml->radio_name_list[ii]) {
- DBG1(r, "new name:[%s]", rname);
+ DBG(r, "new name:[%s]", rname);
break;
}
if (strcasecmp(hdml->radio_name_list[ii], rname) == 0) {
- DBG1(r, "already registered name:[%s]", rname);
+ DBG(r, "already registered name:[%s]", rname);
break;
}
}
continue;
}
- DBG1(r,"add radio name:[%s]" ,rname);
+ DBG(r,"add radio name:[%s]" ,rname);
hdml->radio_name_list[ii] = apr_pstrdup(r->pool, rname);
qs_trim_string(r, s),
NULL);
- DBG1(r, "POSTDATA:[%s]", hdml->postdata[hdml->pure_form_cnt] );
+ DBG(r, "POSTDATA:[%s]", hdml->postdata[hdml->pure_form_cnt] );
}
hdml->init_vars = apr_pstrcat(r->pool, hdml->init_vars, qs_trim_string(r,s), NULL);
- DBG1(r, "INIT_VARS:[%s]", hdml->init_vars);
+ DBG(r, "INIT_VARS:[%s]", hdml->init_vars);
}
else
spec = chxj_specified_device(r, user_agent);
- DBG1(r,"found device_name=[%s]", spec->device_name);
- DBG1(r,"User-Agent=[%s]", user_agent);
+ DBG(r,"found device_name=[%s]", spec->device_name);
+ DBG(r,"User-Agent=[%s]", user_agent);
return s_img_conv_format_from_file(r, conf, user_agent, qsp, spec);
else
spec = chxj_specified_device(r, user_agent);
- DBG1(r,"found device_name=[%s]", spec->device_name);
- DBG1(r, "User-Agent=[%s]", user_agent);
+ DBG(r,"found device_name=[%s]", spec->device_name);
+ DBG(r, "User-Agent=[%s]", user_agent);
if (spec->width == 0 || spec->heigh == 0)
return NULL;
apr_finfo_t st;
apr_finfo_t cache_st;
char* tmpfile;
+ int try_count;
if (spec->html_spec_type == CHXJ_SPEC_UNKNOWN) {
/*
/* Create Workfile Name */
/*--------------------------------------------------------------------------*/
tmpfile = s_create_workfile(r, conf, user_agent, qsp);
- DBG1(r,"workfile=[%s]", tmpfile);
+ DBG(r,"workfile=[%s]", tmpfile);
rv = apr_stat(&st, r->filename, APR_FINFO_MIN, r->pool);
if (rv != APR_SUCCESS)
return HTTP_NOT_FOUND;
-
- DBG1(r,"found [%s]", r->filename);
- rv = apr_stat(&cache_st, tmpfile, APR_FINFO_MIN, r->pool);
- DBG1(r,"found [%s]", r->filename);
-
- if (rv != APR_SUCCESS || cache_st.ctime < st.mtime) {
- /*------------------------------------------------------------------------*/
- /* It tries to make the cash file when it doesn't exist or there is */
- /* change time later since the making time of the cash file. */
- /*------------------------------------------------------------------------*/
- rv = s_create_cache_file(r,tmpfile, spec, &st, qsp, conf);
- if (rv != OK)
- return rv;
- }
-
- DBG1(r,"color=[%d]", spec->color);
- if (! r->header_only) {
- rv = s_send_cache_file(spec, qsp,r, tmpfile);
- if (rv != OK)
- return rv;
- }
- else {
- rv = s_header_only_cache_file(spec, qsp, r, tmpfile);
- if (rv != OK)
- return rv;
+ try_count = CACHE_RETRY_COUNT;
+ do {
+ rv = apr_stat(&cache_st, tmpfile, APR_FINFO_MIN, r->pool);
+
+ if (rv != APR_SUCCESS || cache_st.ctime < st.mtime) {
+ /*------------------------------------------------------------------------*/
+ /* It tries to make the cash file when it doesn't exist or there is */
+ /* change time later since the making time of the cash file. */
+ /*------------------------------------------------------------------------*/
+ rv = s_create_cache_file(r,tmpfile, spec, &st, qsp, conf);
+ if (rv != OK)
+ return rv;
+ }
+
+ DBG(r,"color=[%d]", spec->color);
+ if (! r->header_only) {
+ rv = s_send_cache_file(spec, qsp,r, tmpfile);
+ }
+ else {
+ rv = s_header_only_cache_file(spec, qsp, r, tmpfile);
+ }
+ if (rv == OK) break;
+ if (rv == HTTP_NOT_FOUND) {
+ DBG(r, "recheck wait... try_count[%d]", try_count);
+ apr_sleep(CACHE_RECHECK_WAIT);
+ }
+ } while (try_count--);
+ if (try_count <= 0) {
+ WRN(r, "cache retry failure....");
+ WRN(r, "cache file was deleted...");
}
apr_table_setn(r->headers_in, "CHXJ_IMG_CONV", "done");
DBG(r,"end chxj_img_conv_format");
- return OK;
+ return rv;
}
static apr_status_t
s_create_cache_file(request_rec* r,
- const char* tmpfile,
- device_table* spec,
- apr_finfo_t* st,
- query_string_param_t *qsp,
- mod_chxj_config *conf)
+ const char* tmpfile,
+ device_table* spec,
+ apr_finfo_t* st,
+ query_string_param_t *qsp,
+ mod_chxj_config *conf)
{
apr_status_t rv;
apr_size_t readbyte;
APR_OS_DEFAULT,
r->pool);
if (rv != APR_SUCCESS) {
- DBG1(r,"file open failed.[%s]", r->filename);
+ DBG(r,"file open failed.[%s]", r->filename);
return HTTP_NOT_FOUND;
}
readdata = apr_palloc(r->pool, st->size);
rv = apr_file_read_full(fin, (void*)readdata, st->size, &readbyte);
if (rv != APR_SUCCESS || readbyte != st->size) {
- DBG1(r,"file read failed.[%s]", r->filename);
+ DBG(r,"file read failed.[%s]", r->filename);
apr_file_close(fin);
return HTTP_NOT_FOUND;
if (! writebyte) {
DestroyMagickWand(magick_wand);
- ERR1(r,"convert failure to Jpeg [%s]", tmpfile);
+ ERR(r,"convert failure to Jpeg [%s]", tmpfile);
return HTTP_INTERNAL_SERVER_ERROR;
}
rv = apr_stat(&cache_dir_st, conf->image_cache_dir, APR_FINFO_MIN, r->pool);
if (rv != APR_SUCCESS) {
DestroyMagickWand(magick_wand);
- ERR1(r,"dir stat error.[%s]", conf->image_cache_dir);
+ ERR(r,"dir stat error.[%s]", conf->image_cache_dir);
return HTTP_INTERNAL_SERVER_ERROR;
}
rv = apr_dir_open(&dir, conf->image_cache_dir, r->pool);
if (rv != APR_SUCCESS) {
DestroyMagickWand(magick_wand);
- ERR1(r,"dir open error.[%s]", conf->image_cache_dir);
+ ERR(r,"dir open error.[%s]", conf->image_cache_dir);
return HTTP_INTERNAL_SERVER_ERROR;
}
memset(&dcf, 0, sizeof(apr_finfo_t));
}
if (dirf.name && strcmp(dirf.name, ".") != 0 && strcmp(dirf.name, "..") != 0) {
total_size += (unsigned long)dirf.size;
- DBG3(r, "dirf.name=[%s] dirf.size=[%ld] dirf.atime=[%lld]", dirf.name, (long)dirf.size, (long long int)dirf.atime);
+ DBG(r, "dirf.name=[%s] dirf.size=[%ld] dirf.atime=[%lld]", dirf.name, (long)dirf.size, (long long int)dirf.atime);
if (dcf.atime >= dirf.atime) {
memcpy(&dcf, &dirf, sizeof(apr_finfo_t));
}
}
apr_dir_close(dir);
if (total_size + writebyte < max_size) {
- DBG4(r, "There is an enough size in cache. total_size:[%lu] max_size:[%lu] found_file=[%d] max_size=[%lu]", total_size, max_size, found_file, max_size);
+ DBG(r, "There is an enough size in cache. total_size:[%lu] max_size:[%lu] found_file=[%d] max_size=[%lu]", total_size, max_size, found_file, max_size);
break;
}
if (found_file == 0 && writebyte >= max_size) {
+ ERR(r, "==========================================");
ERR(r, "cache space is too small...");
- ERR1(r, "At least the same size as %luByte is necessary for me.", (unsigned long)writebyte);
+ ERR(r, "At least the same size as %luByte is necessary for me.", (unsigned long)writebyte);
ERR(r, "Please specify the ChxjImageCacheLimit that is larger than now value. ");
+ ERR(r, "==========================================");
return HTTP_INTERNAL_SERVER_ERROR;
}
- DBG2(r, "Image Cache dir is full. total_size:[%lu] max_size:[%lu]", total_size + writebyte, max_size);
+ DBG(r, "Image Cache dir is full. total_size:[%lu] max_size:[%lu]", total_size + writebyte, max_size);
/* search delete candidate */
delete_file_name = apr_psprintf(r->pool, "%s/%s", conf->image_cache_dir, dcf.name);
- DBG2(r, "delete image cache target:[%s] atime:[%lld]", delete_file_name, dcf.atime);
+ DBG(r, "delete image cache target:[%s] atime:[%lld]", delete_file_name, dcf.atime);
rv = apr_file_remove(delete_file_name, r->pool);
if (rv != APR_SUCCESS) {
- ERR1(r, "cache file delete failure.[%s]", delete_file_name);
+ ERR(r, "cache file delete failure.[%s]", delete_file_name);
return HTTP_INTERNAL_SERVER_ERROR;
}
- DBG1(r, "deleted image cache target:[%s]", delete_file_name);
+ DBG(r, "deleted image cache target:[%s]", delete_file_name);
if (total_size + writebyte - dcf.size < max_size) {
DBG(r, "OK, there is an enough size in cache.");
break;
r->pool);
if (rv != APR_SUCCESS) {
DestroyMagickWand(magick_wand);
- ERR1(r,"file open error.[%s]", tmpfile);
+ ERR(r,"file open error.[%s]", tmpfile);
return HTTP_INTERNAL_SERVER_ERROR;
}
rv = apr_file_close(fout);
if (rv != APR_SUCCESS) {
- DBG1(r,"file write error.[%s]", tmpfile);
+ DBG(r,"file write error.[%s]", tmpfile);
return HTTP_INTERNAL_SERVER_ERROR;
}
oldw = MagickGetImageWidth(magick_wand);
oldh = MagickGetImageHeight(magick_wand);
- DBG1(r,"detect width=[%d]", oldw);
- DBG1(r,"detect heigh=[%d]", oldh);
+ DBG(r,"detect width=[%d]", oldw);
+ DBG(r,"detect heigh=[%d]", oldh);
neww = oldw;
newh = oldh;
- DBG1(r,"detect spec width=[%d]", spec->width);
- DBG1(r,"detect spec heigh=[%d]", spec->heigh);
+ DBG(r,"detect spec width=[%d]", spec->width);
+ DBG(r,"detect spec heigh=[%d]", spec->heigh);
c_width = spec->width;
c_heigh = spec->heigh;
neww = (int)((double)neww * (double)((double)c_heigh / (double)newh));
newh = (int)((double)newh * (double)((double)c_heigh / (double)newh));
- DBG2(r,"newh = [%d] neww = [%d]", newh, neww);
+ DBG(r,"newh = [%d] neww = [%d]", newh, neww);
break;
default:
}
if (spec->html_spec_type != CHXJ_SPEC_UNKNOWN) {
- DBG2(r,"convert width=[%d --> %d]", oldw, neww);
- DBG2(r,"convert heigh=[%d --> %d]", oldh, newh);
+ DBG(r,"convert width=[%d --> %d]", oldw, neww);
+ DBG(r,"convert heigh=[%d --> %d]", oldh, newh);
MagickResetIterator(magick_wand);
case IMG_CONV_MODE_NORMAL:
if (qsp->width) {
- DBG2(r,"convert width=[%d --> %d]", neww, qsp->width);
+ DBG(r,"convert width=[%d --> %d]", neww, qsp->width);
neww = qsp->width;
}
if (qsp->height) {
- DBG2(r,"convert heigh=[%d --> %d]", newh, qsp->height);
+ DBG(r,"convert heigh=[%d --> %d]", newh, qsp->height);
newh = qsp->height;
}
if (spec->color >= 256) {
- DBG1(r,"call MagickQuantizeImage() spec->color=[%d]",spec->color);
+ DBG(r,"call MagickQuantizeImage() spec->color=[%d]",spec->color);
if (MagickQuantizeImage(magick_wand,
spec->color,
return NULL;
}
- DBG1(r,"call end MagickQuantizeImage() spec->color=[%d]",spec->color);
+ DBG(r,"call end MagickQuantizeImage() spec->color=[%d]",spec->color);
}
else {
- DBG1(r,"call MagickQuantizeImage() spec->color=[%d]",spec->color);
+ DBG(r,"call MagickQuantizeImage() spec->color=[%d]",spec->color);
if (MagickQuantizeImage(magick_wand,
spec->color,
return NULL;
}
- DBG1(r,"call end MagickQuantizeImage() spec->color=[%d]",spec->color);
+ DBG(r,"call end MagickQuantizeImage() spec->color=[%d]",spec->color);
}
if (conf->image_copyright) {
- DBG1(r, "Add COPYRIGHT [%s]", conf->image_copyright);
+ DBG(r, "Add COPYRIGHT [%s]", conf->image_copyright);
if (spec->html_spec_type == CHXJ_SPEC_Jhtml) {
apr_table_setn(r->headers_out, "x-jphone-copyright", "no-transfer");
writedata = (char*)MagickGetImageBlob(magick_wand, &writebyte);
if (writebyte >= prev_size || revers_flag) {
- DBG2(r, "quality=[%ld] size=[%d]", (long)quality, (int)writebyte);
+ DBG(r, "quality=[%ld] size=[%d]", (long)quality, (int)writebyte);
revers_flag = 1;
quality += 10;
if (quality > 100) {
continue;
}
- DBG2(r, "quality=[%ld] size=[%d]", (long)quality, (int)writebyte);
+ DBG(r, "quality=[%ld] size=[%d]", (long)quality, (int)writebyte);
if (spec->cache == 0)
break;
writedata = (char*)MagickGetImageBlob(magick_wand, &writebyte);
- DBG2(r,"now_color=[%ld] size=[%d]", (long)now_color, (int)writebyte);
+ DBG(r,"now_color=[%ld] size=[%d]", (long)now_color, (int)writebyte);
/* Once per request */
break;
if (rv != APR_SUCCESS)
return HTTP_NOT_FOUND;
- DBG1(r, "mode:[%d]", query_string->mode);
- DBG1(r, "name:[%s]", query_string->name);
- DBG1(r, "offset:[%ld]", query_string->offset);
- DBG1(r, "count:[%ld]", query_string->count);
+ DBG(r, "mode:[%d]", query_string->mode);
+ DBG(r, "name:[%s]", query_string->name);
+ DBG(r, "offset:[%ld]", query_string->offset);
+ DBG(r, "count:[%ld]", query_string->count);
if (spec->available_jpeg) {
r->content_type = apr_psprintf(r->pool, "image/jpeg");
contentLength = apr_psprintf(r->pool, "%d", (int)st.size);
apr_table_setn(r->headers_out, "Content-Length", (const char*)contentLength);
- DBG1(r,"Content-Length:[%d]", (int)st.size);
+ DBG(r,"Content-Length:[%d]", (int)st.size);
rv = apr_file_open(&fout, tmpfile,
APR_READ | APR_BINARY, APR_OS_DEFAULT, r->pool);
if (rv != APR_SUCCESS) {
- DBG1(r, "tmpfile open failed[%s]", tmpfile);
+ DBG(r, "cache file open failed[%s]", tmpfile);
return HTTP_NOT_FOUND;
}
ap_send_fd(fout, r, 0, st.size, &sendbyte);
apr_file_close(fout);
ap_rflush(r);
- DBG1(r, "send file data[%d]byte", (int)sendbyte);
+ DBG(r, "send file data[%d]byte", (int)sendbyte);
}
else
if (query_string->mode == IMG_CONV_MODE_EZGET) {
contentLength = apr_psprintf(r->pool, "%ld", query_string->count);
apr_table_setn(r->headers_out, "Content-Length", (const char*)contentLength);
- DBG1(r, "Content-Length:[%d]", (int)st.size);
+ DBG(r, "Content-Length:[%d]", (int)st.size);
rv = apr_file_open(&fout, tmpfile,
APR_READ | APR_BINARY, APR_OS_DEFAULT, r->pool);
if (rv != APR_SUCCESS) {
- DBG1(r,"tmpfile open failed[%s]", tmpfile);
+ DBG(r,"tmpfile open failed[%s]", tmpfile);
return HTTP_NOT_FOUND;
}
ap_send_fd(fout, r, query_string->offset, query_string->count, &sendbyte);
apr_file_close(fout);
ap_rflush(r);
- DBG1(r, "send file data[%d]byte", (int)sendbyte);
+ DBG(r, "send file data[%d]byte", (int)sendbyte);
}
}
rv = apr_file_open(&fout, originalfile,
APR_READ | APR_BINARY, APR_OS_DEFAULT, r->pool);
if (rv != APR_SUCCESS) {
- DBG1(r, "originalfile open failed[%s]", originalfile);
+ DBG(r, "originalfile open failed[%s]", originalfile);
return HTTP_NOT_FOUND;
}
ap_send_fd(fout, r, 0, st.size, &sendbyte);
apr_file_close(fout);
ap_rflush(r);
- DBG1(r, "send file data[%d]byte", (int)sendbyte);
+ DBG(r, "send file data[%d]byte", (int)sendbyte);
return OK;
}
if (rv != APR_SUCCESS)
return HTTP_NOT_FOUND;
- DBG1(r, "mode:[%d]", query_string->mode);
- DBG1(r, "name:[%s]", query_string->name);
- DBG1(r, "offset:[%ld]", query_string->offset);
- DBG1(r, "count:[%ld]", query_string->count);
+ DBG(r, "mode:[%d]", query_string->mode);
+ DBG(r, "name:[%s]", query_string->name);
+ DBG(r, "offset:[%ld]", query_string->offset);
+ DBG(r, "count:[%ld]", query_string->count);
if (spec->available_jpeg) {
r->content_type = apr_psprintf(r->pool, "image/jpeg");
contentLength = apr_psprintf(r->pool, "%d", (int)st.size);
apr_table_setn(r->headers_out, "Content-Length", (const char*)contentLength);
- DBG1(r,"Content-Length:[%d]", (int)st.size);
+ DBG(r,"Content-Length:[%d]", (int)st.size);
}
else
if (query_string->mode == IMG_CONV_MODE_EZGET) {
contentLength = apr_psprintf(r->pool, "%ld", query_string->count);
apr_table_setn(r->headers_out, "Content-Length", (const char*)contentLength);
- DBG1(r, "Content-Length:[%d]", (int)st.size);
+ DBG(r, "Content-Length:[%d]", (int)st.size);
}
}
switch (qsp->mode) {
case IMG_CONV_MODE_THUMBNAIL:
fname = apr_psprintf(r->pool, "%s.%s.thumbnail", r->filename, user_agent);
- DBG1(r, "mode=thumbnail [%s]", fname);
+ DBG(r, "mode=thumbnail [%s]", fname);
break;
case IMG_CONV_MODE_WALLPAPER:
case IMG_CONV_MODE_EZGET:
fname = apr_psprintf(r->pool, "%s.%s.wallpaper", r->filename, user_agent);
- DBG1(r, "mode=WallPaper [%s]", fname);
+ DBG(r, "mode=WallPaper [%s]", fname);
break;
case IMG_CONV_MODE_NORMAL:
default:
if (qsp->height)
fname = apr_psprintf(r->pool, "%s.h%d", fname, qsp->height);
- DBG1(r,"mode=normal [%s]", fname);
+ DBG(r,"mode=normal [%s]", fname);
break;
}
if (qsp->ua_flag == UA_IGN) {
conf = ap_get_module_config(r->per_dir_config, &chxj_module);
if (conf == NULL) {
- DBG1(r, "end chxj_trans_name() conf is null[%s]", r->uri);
+ DBG(r, "end chxj_trans_name() conf is null[%s]", r->uri);
return DECLINED;
}
}
- DBG1(r,"Match URI[%s]", r->uri);
+ DBG(r,"Match URI[%s]", r->uri);
if (r->filename == NULL)
else
filename_sv = r->filename;
- DBG1(r,"r->filename[%s]", filename_sv);
+ DBG(r,"r->filename[%s]", filename_sv);
ccp = ap_document_root(r);
if (ccp == NULL)
else
filename_sv = apr_pstrcat(r->pool, docroot, filename_sv, NULL);
- DBG1(r,"URI[%s]", filename_sv);
+ DBG(r,"URI[%s]", filename_sv);
do_ext_check = TRUE;
for (ii=0; ii<7-1; ii++) {
else
fname = apr_psprintf(r->pool, "%s.%s", filename_sv, ext[ii]);
- DBG1(r,"search [%s]", fname);
+ DBG(r,"search [%s]", fname);
rv = apr_stat(&st, fname, APR_FINFO_MIN, r->pool);
if (rv == APR_SUCCESS) {
}
}
if (fname == NULL) {
- DBG1(r,"NotFound [%s]", r->filename);
+ DBG(r,"NotFound [%s]", r->filename);
return DECLINED;
}
for (ii=0; ii<7-1; ii++) {
}
if (! next_ok) {
- DBG1(r,"NotFound [%s]", r->filename);
+ DBG(r,"NotFound [%s]", r->filename);
return DECLINED;
}
if (r->handler == NULL || strcasecmp(r->handler, "chxj-qrcode") != 0) {
- DBG1(r,"Found [%s]", fname);
+ DBG(r,"Found [%s]", fname);
r->filename = apr_psprintf(r->pool, "%s", fname);
binstr = apr_pstrcat(r->pool, binstr,
s_get_char_bit_count(qrcode, strlen(qrcode->indata)), NULL);
#ifdef QR_CODE_DEBUG
- DBG1(r, "s_get_char_bit_count()[%s]", binstr);
+ DBG(r, "s_get_char_bit_count()[%s]", binstr);
#endif
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
data_code_count = v_data_code_count[qrcode->version][qrcode->level];
#ifdef QR_CODE_DEBUG
- DBG1(r,"data_code_count=[%d]", data_code_count);
+ DBG(r,"data_code_count=[%d]", data_code_count);
#endif
/*------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
binstr = apr_pstrcat(r->pool, binstr, real_data, NULL);
#ifdef QR_CODE_DEBUG
- DBG1(r,"Before TERM BIT[%s]", binstr);
+ DBG(r,"Before TERM BIT[%s]", binstr);
#endif
if ((size_t)(data_code_count * 8) > strlen(binstr)) {
int binstr_len = strlen(binstr);
}
}
#ifdef QR_CODE_DEBUG
- DBG3(r, "After TERM BIT[%s] len[%d]bit [%f]byte", binstr, strlen(binstr), (float)(((float)strlen(binstr))/8.0));
+ DBG(r, "After TERM BIT[%s] len[%d]bit [%f]byte", binstr, strlen(binstr), (float)(((float)strlen(binstr))/8.0));
DBG(r,"add term data");
#endif
/*--------------------------------------------------------------------------*/
binstr = s_tidy_8bit_code(qrcode, binstr, data_code_count);
#ifdef QR_CODE_DEBUG
- DBG1(r,"After Tidy 8 BIT[%s]", binstr);
+ DBG(r,"After Tidy 8 BIT[%s]", binstr);
DBG(r,"s_tidy_8bit_code()");
#endif
for (ii=0; ii<data_code_count; ii++) {
rows = apr_pstrcat(r->pool, rows, apr_psprintf(r->pool, "[%02x]\n", (unsigned char)decstr[ii]), NULL);
}
- DBG1(r,"decstr[%s]", rows);
+ DBG(r,"decstr[%s]", rows);
}while(0);
#endif
eccstr = apr_palloc(r->pool, module_count* module_count);
data_total_count = chxj_calc_ecc(qrcode, (unsigned char*)decstr, eccstr);
#ifdef QR_CODE_DEBUG
- DBG1(r,"chxj_calc_ecc() total_count[%d]", data_total_count);
+ DBG(r,"chxj_calc_ecc() total_count[%d]", data_total_count);
#endif
/*--------------------------------------------------------------------------*/
/* ºÇŬ¥Þ¥¹¥¯¤ÇºÆÅÙºî¤ê¤Ê¤ª¤· */
/*--------------------------------------------------------------------------*/
#ifdef QR_CODE_DEBUG
- DBG1(r, "selected mask[%d]", min_mask_pattern);
+ DBG(r, "selected mask[%d]", min_mask_pattern);
#endif
s_init_modules(qrcode, min_mask_pattern, module);
do {
int xx, yy;
int module_count = v_module_count_table[qrcode->version];
- DBG1(r,"loop to [%d]", module_count);
+ DBG(r,"loop to [%d]", module_count);
for (yy=0; yy<module_count; yy++) {
char *rows ;
for (xx=0; xx<module_count; xx++)
rows = apr_pstrcat(r->pool, rows, "[", apr_psprintf(r->pool, "%c", module[yy][xx]), "]", NULL);
- DBG2(r,"%d:%s", yy,rows);
+ DBG(r,"%d:%s", yy,rows);
}
} while(0);
/* DEBUG END */
}
}
#ifdef QR_CODE_DEBUG
- DBG1(r,"qrcode->version[%d]", qrcode->version);
- DBG1(r,"qrcode->level[%d]", qrcode->level);
- DBG1(r,"qrcode->mode[%d]", qrcode->mode);
- DBG1(r,"qrcode->indata[%s]", qrcode->indata);
+ DBG(r,"qrcode->version[%d]", qrcode->version);
+ DBG(r,"qrcode->level[%d]", qrcode->level);
+ DBG(r,"qrcode->mode[%d]", qrcode->mode);
+ DBG(r,"qrcode->indata[%s]", qrcode->indata);
#endif
}
memset(result, 0, 5);
memcpy(result, v_mode_table[qrcode->mode], 4);
#ifdef QR_CODE_DEBUG
- DBG1(r,"Mode Spec[%s]", result);
+ DBG(r,"Mode Spec[%s]", result);
#endif
return result;
char* result;
int data_capacity = v_capacity_table[qrcode->version*4+qrcode->level].size[qrcode->mode];
- DBG1(qrcode->r, "len [%d]", len);
+ DBG(qrcode->r, "len [%d]", len);
if (qrcode->mode == QR_KANJI_MODE && data_capacity * 2 < len) {
len = data_capacity * 2;
}
len /= 2;
}
- DBG1(qrcode->r, "len [%d]", len);
+ DBG(qrcode->r, "len [%d]", len);
tmp = (char*)apr_palloc(qrcode->r->pool, bit_count + 1);
for (ii=0; ii<bit_count; ii++) {
result[bit_count] = '\0';
#ifdef QR_CODE_DEBUG
- DBG1(qrcode->r, "Character Count bit [%s]", result);
+ DBG(qrcode->r, "Character Count bit [%s]", result);
#endif
return result;
result[kk] = 0;
#ifdef QR_CODE_DEBUG
- DBG2(qrcode->r, "input data --> 2bin result[%s] len:[%d]", result, strlen(result));
+ DBG(qrcode->r, "input data --> 2bin result[%s] len:[%d]", result, strlen(result));
#endif
return result;
result[kk] = 0;
#ifdef QR_CODE_DEBUG
- DBG2(qrcode->r, "input data --> 2bin result[%s] len:[%d]", result, strlen(result));
+ DBG(qrcode->r, "input data --> 2bin result[%s] len:[%d]", result, strlen(result));
#endif
return result;
char* result;
#ifdef QR_CODE_DEBUG
- DBG2(qrcode->r, "len[%d] data_code_count * 8 [%d]", len, data_code_count * 8);
+ DBG(qrcode->r, "len[%d] data_code_count * 8 [%d]", len, data_code_count * 8);
#endif
assert (len <= data_code_count * 8);
}
#ifdef QR_CODE_DEBUG
- DBG2(qrcode->r, "tidy len[%d] data_code_count[%d]", strlen(result)/8, data_code_count);
+ DBG(qrcode->r, "tidy len[%d] data_code_count[%d]", strlen(result)/8, data_code_count);
#endif
return result;
int xx, yy;
#ifdef QR_CODE_DEBUG
DBG(qrcode->r, "start s_setup_timing_pattern()");
- DBG1(qrcode->r, "module_count[%d]", module_count);
+ DBG(qrcode->r, "module_count[%d]", module_count);
#endif
yy=6;
#ifdef QR_CODE_DEBUG
DBG(qrcode->r, "start s_setup_type_info()");
- DBG1(qrcode->r, "module_count[%d]", module_count);
+ DBG(qrcode->r, "module_count[%d]", module_count);
#endif
/* ·Á¼°¾ðÊó¥Ç¡¼¥¿¤ÎÀ¸À® */
#ifdef QR_CODE_DEBUG
DBG(qrcode->r, "start s_map_data()");
- DBG1(qrcode->r, "module_count[%d]", module_count);
- DBG1(qrcode->r, "data_count[%d]", data_count);
+ DBG(qrcode->r, "module_count[%d]", module_count);
+ DBG(qrcode->r, "data_count[%d]", data_count);
#endif
in_pos = 0;
now_bit = 7;
continue;
}
- DBG1(r, "pattern is [%s]", dtl->pattern);
+ DBG(r, "pattern is [%s]", dtl->pattern);
if (! dtl->regexp) {
DBG(r,"compile failed.");
return returnType;
if (ap_regexec((const ap_regex_t *)dtl->regexp, user_agent, (apr_size_t)dtl->regexp->re_nsub + 1, match, 0) == 0) {
device_id = ap_pregsub(r->pool, "$1", user_agent, dtl->regexp->re_nsub + 1, match);
- DBG1(r, "device_id:[%s]", device_id);
+ DBG(r, "device_id:[%s]", device_id);
for (dt = dtl->table; dt; dt = dt->next) {
if (strcasecmp(device_id, dt->device_id) == 0) {
- DBG1(r, "device_name:[%s]", dt->device_name);
+ DBG(r, "device_name:[%s]", dt->device_name);
returnType = dt;
break;
}
char* name = qs_get_attr_name(doc,attr);
- DBG1(r, "qs_get_selected_value name::[%s]" , name);
+ DBG(r, "qs_get_selected_value name::[%s]" , name);
if ((*name == 's'|| *name == 'S') && strcasecmp(name, "selected") == 0) {
/*------------------------------------------------------------------*/
char* name = qs_get_attr_name(doc,attr);
- DBG1(r, "qs_get_selected_value name::[%s]" , name);
+ DBG(r, "qs_get_selected_value name::[%s]" , name);
if ((*name == 's' || *name == 'S') && strcasecmp(name, "selected") == 0)
/*------------------------------------------------------------------*/
if ((*name == 'l' || *name == 'L') && strcasecmp(name, "lang") == 0) {
- DBG2(r, "lang found [%s] spec [%d]", value, spec->html_spec_type);
+ DBG(r, "lang found [%s] spec [%d]", value, spec->html_spec_type);
if ((*value == 'x' || *value == 'X') && strcasecmp(value, "xhtml") == 0) {
if (spec->html_spec_type == CHXJ_SPEC_XHtml_Mobile_1_0) {
char* out;
int rtn = s_xhtml_search_emoji(xhtml, &textval[ii], &out);
if (rtn != 0) {
- DBG2(r,"[%s][%d]", out, rtn);
+ DBG(r,"[%s][%d]", out, rtn);
tdst = qs_out_apr_pstrcat(r, tdst, out, &tdst_len);
ii+=(rtn - 1);
continue;
else
user_agent = (char*)apr_table_get(r->headers_in, HTTP_USER_AGENT);
- DBG1(r,"User-Agent:[%s]", user_agent);
+ DBG(r,"User-Agent:[%s]", user_agent);
DBG(r, "start chxj_exchange()");
- DBG1(r,"content type is %s", r->content_type);
+ DBG(r,"content type is %s", r->content_type);
if (*(char*)r->content_type == 't'
&& strncmp(r->content_type, "text/html", 9) != 0) {
- DBG1(r,"content type is %s", r->content_type);
+ DBG(r,"content type is %s", r->content_type);
return (char*)*src;
}
}
buff = apr_pstrdup(r->pool, r->args);
- DBG1(r, "r->args=[%s]", buff);
+ DBG(r, "r->args=[%s]", buff);
/* _chxj_dmy */
/* _chxj_c_ */
dlen = strlen(value);
value = chxj_url_decode(r, value);
- DBG1(r, "************ before encoding[%s]", value);
+ DBG(r, "************ before encoding[%s]", value);
dvalue = chxj_rencoding(r, value, &dlen);
dvalue = chxj_url_encode(r, dvalue);
- DBG1(r, "************ after encoding[%s]", dvalue);
+ DBG(r, "************ after encoding[%s]", dvalue);
result = apr_pstrcat(r->pool, result, name, "=", dvalue, NULL);
}
}
else
if (strcasecmp(name, CHXJ_COOKIE_PARAM) == 0) {
- DBG1(r, "found cookie parameter[%s]", value);
+ DBG(r, "found cookie parameter[%s]", value);
DBG(r, "call start chxj_load_cookie()");
cookie = chxj_load_cookie(r, value);
DBG(r, "call end chxj_load_cookie()");
}
r->args = result;
- DBG1(r, "result r->args=[%s]", r->args);
+ DBG(r, "result r->args=[%s]", r->args);
DBG(r, "end chxj_convert_input_header()");
return 0;
}
result = qs_alloc_zero_byte_string(r);
- DBG1(r, "BEFORE input convert source = [%s]", s);
+ DBG(r, "BEFORE input convert source = [%s]", s);
for (;;) {
char* pair_sv;
dlen = strlen(value);
value = chxj_url_decode(r, value);
- DBG1(r, "************ before encoding[%s]", value);
+ DBG(r, "************ before encoding[%s]", value);
dvalue = chxj_rencoding(r, value, &dlen);
dvalue = chxj_url_encode(r,dvalue);
- DBG1(r, "************ after encoding[%s]", dvalue);
+ DBG(r, "************ after encoding[%s]", dvalue);
result = apr_pstrcat(r->pool, result, name, "=", dvalue, NULL);
dlen = strlen(value);
value = chxj_url_decode(r, value);
- DBG1(r, "************ before encoding[%s]", value);
+ DBG(r, "************ before encoding[%s]", value);
dvalue = chxj_rencoding(r, value, &dlen);
dvalue = chxj_url_encode(r,dvalue);
- DBG1(r, "************ after encoding[%s]", dvalue);
+ DBG(r, "************ after encoding[%s]", dvalue);
result = apr_pstrcat(r->pool, result, &name[8], "=", dvalue, NULL);
}
else
if (strcasecmp(name, CHXJ_COOKIE_PARAM) == 0) {
- DBG1(r, "found cookie parameter[%s]", value);
+ DBG(r, "found cookie parameter[%s]", value);
DBG(r, "call start chxj_load_cookie()");
cookie = chxj_load_cookie(r, value);
DBG(r, "call end chxj_load_cookie()");
}
*len = strlen(result);
- DBG1(r, "AFTER input convert result = [%s]", result);
+ DBG(r, "AFTER input convert result = [%s]", result);
return result;
}
ctx = (mod_chxj_ctx*)f->ctx;
- DBG1(r, "content_type=[%s]", r->content_type);
+ DBG(r, "content_type=[%s]", r->content_type);
if (spec->html_spec_type != CHXJ_SPEC_UNKNOWN
&& r->content_type
memcpy(tmp, ctx->buffer, ctx->len);
#if 0
- DBG2(r, "input data=[%s] len=[%d]", tmp, ctx->len);
+ DBG(r, "input data=[%s] len=[%d]", tmp, ctx->len);
#endif
ctx->buffer = chxj_exchange(r,
user_agent);
#if 0
- DBG2(r, "output data=[%.*s]", ctx->len,ctx->buffer);
+ DBG(r, "output data=[%.*s]", ctx->len,ctx->buffer);
#endif
}
else {
memcpy(tmp, ctx->buffer, ctx->len);
#if 0
- DBG1(r, "input data=[%s]", tmp);
+ DBG(r, "input data=[%s]", tmp);
#endif
ctx->buffer = tmp;
#if 0
- DBG2(r, "output data=[%.*s]", ctx->len,ctx->buffer);
+ DBG(r, "output data=[%.*s]", ctx->len,ctx->buffer);
#endif
}
}
return rv;
}
else {
- DBG1(r, " SAVE COOKIE[%x]", entryp->action);
+ DBG(r, " SAVE COOKIE[%x]", entryp->action);
/*
* save cookie.
*/
location_header = (char*)apr_table_get(r->headers_out, "Location");
if (location_header) {
- DBG1(r, "Location Header=[%s]", location_header);
+ DBG(r, "Location Header=[%s]", location_header);
location_header = chxj_add_cookie_parameter(r,
location_header,
cookie);
apr_table_setn(r->headers_out, "Location", location_header);
- DBG1(r, "Location Header=[%s]", location_header);
+ DBG(r, "Location Header=[%s]", location_header);
}
break;
}
else
if (apr_bucket_read(b, &data, &len, APR_BLOCK_READ) == APR_SUCCESS) {
- DBG2(r, "read data[%.*s]",(int)len, data);
+ DBG(r, "read data[%.*s]",(int)len, data);
if (f->ctx == NULL) {
/*--------------------------------------------------------------------*/
data_bucket = apr_palloc(r->pool, len+1);
memset((void*)data_bucket, 0, len+1);
memcpy(data_bucket, data, len);
- DBG1(r, "(in)POSTDATA:[%s]", data_bucket);
+ DBG(r, "(in)POSTDATA:[%s]", data_bucket);
data_brigade = apr_pstrcat(r->pool, data_brigade, data_bucket, NULL);
}
);
if (len > 0) {
- DBG1(r, "(in:exchange)POSTDATA:[%s]", data_brigade);
+ DBG(r, "(in:exchange)POSTDATA:[%s]", data_brigade);
obb = apr_brigade_create(r->pool, c->bucket_alloc);
for (;p;p = (Node*)qs_get_next_node(doc,p)) {
Attr* attr;
if ((char*)qs_get_node_value(doc,p) != NULL) {
- DBG5(doc->r,"%*.*sNode:[%s][%s]\n", indent,indent," ",
+ DBG(doc->r,"%*.*sNode:[%s][%s]\n", indent,indent," ",
(char*)qs_get_node_name(doc,p),
(char*)qs_get_node_value(doc,p));
}
else {
- DBG4(doc->r,"%*.*sNode:[%s]\n", indent,indent," ", qs_get_node_name(doc,p));
+ DBG(doc->r,"%*.*sNode:[%s]\n", indent,indent," ", qs_get_node_name(doc,p));
}
for (attr = (Attr*)qs_get_attr(doc,p); attr; attr = (Attr*)qs_get_next_attr(doc,attr)) {
- DBG4(doc->r,"%*.*s ATTR:[%s]\n", indent,indent," ", (char *)qs_get_attr_name(doc,attr));
- DBG4(doc->r,"%*.*s VAL :[%s]\n", indent,indent," ", (char *)qs_get_attr_value(doc,attr));
+ DBG(doc->r,"%*.*s ATTR:[%s]\n", indent,indent," ", (char *)qs_get_attr_name(doc,attr));
+ DBG(doc->r,"%*.*s VAL :[%s]\n", indent,indent," ", (char *)qs_get_attr_value(doc,attr));
}
qs_dump_node(doc,p, indent+4);
}