OSDN Git Service

* Deleted:
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Wed, 6 Feb 2008 05:21:23 +0000 (05:21 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Wed, 6 Feb 2008 05:21:23 +0000 (05:21 +0000)
     --with-apache-header
     deleted --with-apache-header, but you may specify the option.
     If you specified the option, configure script will use the option value.
  * Changed:
    cache file deleting logic.

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

17 files changed:
configure
configure.ac
include/chxj_img_conv_format.h
include/mod_chxj.h
src/chxj_apply_convrule.c
src/chxj_calc_ecc.c
src/chxj_chtml10.c
src/chxj_cookie.c
src/chxj_encoding.c
src/chxj_hdml.c
src/chxj_img_conv_format.c
src/chxj_qr_code.c
src/chxj_specified_device.c
src/chxj_tag_util.c
src/chxj_xhtml_mobile_1_0.c
src/mod_chxj.c
src/qs_parse_string.c

index 2eba413..c6ef9bf 100755 (executable)
--- a/configure
+++ b/configure
@@ -19316,16 +19316,6 @@ if test "${with_apache_header+set}" = set; then
   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.
@@ -20031,6 +20021,9 @@ case $host_os in
     ;;
 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` "
index 52cc49d..691819a 100644 (file)
@@ -17,12 +17,6 @@ AM_PROG_LIBTOOL
 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. 
@@ -185,6 +179,9 @@ case $host_os in
     ;;
 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` "
index c56d570..ad838fa 100644 (file)
 /* 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);
index 0af9ff6..8af7c11 100644 (file)
@@ -339,24 +339,11 @@ module AP_MODULE_DECLARE_DATA chxj_module;
 #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[];
index 0744eef..6773c27 100644 (file)
@@ -48,7 +48,7 @@ s_apply_rule(request_rec* r, chxjconvrule_entry* pp)
 
   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) {
index 5aa4166..580682d 100644 (file)
@@ -977,7 +977,7 @@ chxj_calc_ecc(qr_code_t* qrcode,
       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);
@@ -1016,7 +1016,7 @@ chxj_calc_ecc(qr_code_t* qrcode,
         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
@@ -1027,7 +1027,7 @@ chxj_calc_ecc(qr_code_t* qrcode,
         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;
@@ -1046,7 +1046,7 @@ chxj_calc_ecc(qr_code_t* qrcode,
           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
@@ -1109,7 +1109,7 @@ chxj_calc_ecc(qr_code_t* qrcode,
   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
index 69afe62..f5b5c11 100644 (file)
@@ -347,7 +347,7 @@ chxj_exchange_chtml10(
 
   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                                                            */
@@ -406,7 +406,7 @@ chxj_exchange_chtml10(
   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;
 }
index d4cae03..dca4a75 100644 (file)
@@ -93,7 +93,7 @@ chxj_save_cookie(request_rec* r)
   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;
@@ -133,7 +133,7 @@ chxj_save_cookie(request_rec* r)
       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++;
   }
 
@@ -180,7 +180,7 @@ chxj_save_cookie(request_rec* r)
                            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);
@@ -207,11 +207,11 @@ chxj_save_cookie(request_rec* r)
   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
@@ -249,7 +249,7 @@ chxj_save_cookie(request_rec* r)
    */
   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;
   }
@@ -332,7 +332,7 @@ chxj_update_cookie(request_rec* r, cookie_t* old_cookie)
                            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);
@@ -386,7 +386,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);
+    DBG(r, "OLD COOKIE VALUE=[%s][%s]", hentryp[ii].key, hentryp[ii].val);
     store_string = apr_pstrcat(r->pool, 
                                store_string, 
                                hentryp[ii].key, 
@@ -402,7 +402,7 @@ chxj_update_cookie(request_rec* r, cookie_t* old_cookie)
    */
   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;
   }
@@ -447,7 +447,7 @@ chxj_load_cookie(request_rec* r, char* cookie_id)
   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));
@@ -479,7 +479,7 @@ chxj_load_cookie(request_rec* r, char* cookie_id)
                            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));
@@ -496,7 +496,7 @@ chxj_load_cookie(request_rec* r, char* cookie_id)
   
     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;
@@ -516,7 +516,7 @@ chxj_load_cookie(request_rec* r, char* cookie_id)
       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);
@@ -585,7 +585,7 @@ chxj_add_cookie_parameter(request_rec* r, char* value, cookie_t* cookie)
   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);
 
@@ -608,7 +608,7 @@ chxj_add_cookie_parameter(request_rec* r, char* value, cookie_t* cookie)
     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;
 
@@ -623,7 +623,7 @@ chxj_cookie_check_host(request_rec* r, char* value)
 {
   char* hostnm;
 
-  DBG1(r, "hostname=[%s]", r->hostname);
+  DBG(r, "hostname=[%s]", r->hostname);
 
   hostnm = s_get_hostname_from_url(r, value);
   if (hostnm) {
@@ -739,7 +739,7 @@ chxj_delete_cookie(request_rec* r, char* cookie_id)
                            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));
@@ -808,7 +808,7 @@ chxj_cookie_db_lock_name_create(request_rec* r, const char* 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);
   }
@@ -859,7 +859,7 @@ chxj_save_cookie_expire(request_rec* r, cookie_t* cookie)
                            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);
@@ -885,7 +885,7 @@ chxj_save_cookie_expire(request_rec* r, cookie_t* cookie)
    */
   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));
   }
 
@@ -1011,7 +1011,7 @@ chxj_delete_cookie_expire(request_rec* r, char* cookie_id)
                            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));
@@ -1069,7 +1069,7 @@ chxj_cookie_expire_gc(request_rec* r)
                            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));
@@ -1085,7 +1085,7 @@ chxj_cookie_expire_gc(request_rec* r)
 
   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;
@@ -1108,8 +1108,8 @@ chxj_cookie_expire_gc(request_rec* r)
       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);
 
@@ -1118,7 +1118,7 @@ chxj_cookie_expire_gc(request_rec* r)
         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);
index 5aa792a..9b27681 100644 (file)
@@ -80,7 +80,7 @@ chxj_encoding(request_rec *r, const char* src, apr_size_t* len)
     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);
@@ -97,7 +97,7 @@ chxj_encoding(request_rec *r, const char* src, apr_size_t* len)
   *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;
 }
 
@@ -155,7 +155,7 @@ chxj_rencoding(request_rec *r, const char* src, apr_size_t* len)
     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);
 
@@ -174,7 +174,7 @@ chxj_rencoding(request_rec *r, const char* src, apr_size_t* len)
   *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;
 }
index 8ae2b77..2b6116b 100644 (file)
@@ -385,7 +385,7 @@ chxj_exchange_hdml(
     /* 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"
@@ -408,8 +408,8 @@ chxj_exchange_hdml(
     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);
@@ -424,7 +424,7 @@ chxj_exchange_hdml(
     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);
   }
 
@@ -1768,7 +1768,7 @@ s_hdml_do_input_radio_tag(hdml_t* hdml, Node* tag)
   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.           */
       /*----------------------------------------------------------------------*/
@@ -1875,7 +1875,7 @@ s_hdml_do_input_radio_tag(hdml_t* hdml, Node* tag)
     }
 
     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, 
@@ -2398,13 +2398,13 @@ s_hdml_start_select_tag(void* pdoc, Node* node)
         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, 
@@ -2486,7 +2486,7 @@ s_hdml_start_option_tag(void* pdoc, Node* node)
   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, 
@@ -2733,11 +2733,11 @@ s_hdml_count_radio_tag(hdml_t* hdml, Node* node)
     /*------------------------------------------------------------------------*/
     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;
       }
     }
@@ -2750,7 +2750,7 @@ s_hdml_count_radio_tag(hdml_t* hdml, Node* node)
       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);
 
@@ -2851,7 +2851,7 @@ s_output_to_postdata(hdml_t* hdml, char* s)
                           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] );
 }
 
 
@@ -2909,7 +2909,7 @@ s_output_to_init_vars(hdml_t* hdml, char* s)
 
   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);
 }
 
 
index 253666f..3c757d8 100644 (file)
@@ -280,8 +280,8 @@ chxj_img_conv_format_handler(request_rec* r)
   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);
@@ -344,8 +344,8 @@ chxj_exchange_image(request_rec *r, const char** src, apr_size_t* len)
   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;
@@ -371,6 +371,7 @@ s_img_conv_format_from_file(
   apr_finfo_t    st;
   apr_finfo_t    cache_st;
   char*          tmpfile;
+  int            try_count;
 
   if (spec->html_spec_type == CHXJ_SPEC_UNKNOWN) {
     /* 
@@ -383,53 +384,58 @@ s_img_conv_format_from_file(
   /* 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;
@@ -487,14 +493,14 @@ s_create_cache_file(request_rec*       r,
                     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;
@@ -677,7 +683,7 @@ s_create_cache_file(request_rec*       r,
 
   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;
   }
@@ -688,7 +694,7 @@ s_create_cache_file(request_rec*       r,
   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;
   }
   
@@ -705,7 +711,7 @@ s_create_cache_file(request_rec*       r,
     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));
@@ -718,7 +724,7 @@ s_create_cache_file(request_rec*       r,
       }
       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));
         }
@@ -727,25 +733,27 @@ s_create_cache_file(request_rec*       r,
     }
     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;
@@ -758,7 +766,7 @@ s_create_cache_file(request_rec*       r,
                   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;
   }
 
@@ -794,7 +802,7 @@ s_create_cache_file(request_rec*       r,
 
   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;
   }
 
@@ -1007,14 +1015,14 @@ s_fixup_size(MagickWand* magick_wand,
   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;
@@ -1052,7 +1060,7 @@ s_fixup_size(MagickWand* magick_wand,
     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:
@@ -1074,8 +1082,8 @@ s_fixup_size(MagickWand* magick_wand,
   }
 
   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);
   
@@ -1101,11 +1109,11 @@ s_fixup_size(MagickWand* 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;
         }
   
@@ -1152,7 +1160,7 @@ s_fixup_color(MagickWand* magick_wand, request_rec* r, device_table* spec, img_c
 
   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,
@@ -1164,11 +1172,11 @@ s_fixup_color(MagickWand* magick_wand, request_rec* r, device_table* spec, img_c
       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,
@@ -1180,7 +1188,7 @@ s_fixup_color(MagickWand* magick_wand, request_rec* r, device_table* spec, img_c
       return NULL;
     }
 
-    DBG1(r,"call end MagickQuantizeImage() spec->color=[%d]",spec->color);
+    DBG(r,"call end MagickQuantizeImage() spec->color=[%d]",spec->color);
   }
 
 
@@ -1264,7 +1272,7 @@ s_add_copyright(MagickWand* magick_wand, request_rec* r, device_table* spec)
 
   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");
@@ -1323,7 +1331,7 @@ s_img_down_sizing(MagickWand* magick_wand, request_rec* r, device_table* spec)
 
     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) {
@@ -1337,7 +1345,7 @@ s_img_down_sizing(MagickWand* magick_wand, request_rec* r, device_table* spec)
       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;
@@ -1405,7 +1413,7 @@ s_img_down_sizing(MagickWand* magick_wand, request_rec* r, device_table* spec)
 
       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;
@@ -1429,10 +1437,10 @@ s_send_cache_file(device_table* spec, query_string_param_t* query_string, reques
   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");
@@ -1454,19 +1462,19 @@ s_send_cache_file(device_table* spec, query_string_param_t* query_string, reques
     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) {
@@ -1511,20 +1519,20 @@ s_send_cache_file(device_table* spec, query_string_param_t* query_string, reques
       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);
     }
   }
   
@@ -1547,14 +1555,14 @@ s_send_original_file(request_rec* r, const char* originalfile)
   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;
 }
@@ -1570,10 +1578,10 @@ s_header_only_cache_file(device_table* spec, query_string_param_t* query_string,
   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");
@@ -1595,7 +1603,7 @@ s_header_only_cache_file(device_table* spec, query_string_param_t* query_string,
     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) {
@@ -1632,7 +1640,7 @@ s_header_only_cache_file(device_table* spec, query_string_param_t* query_string,
       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);
     }
   }
   
@@ -1658,12 +1666,12 @@ s_create_workfile(
   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:
@@ -1676,7 +1684,7 @@ s_create_workfile(
     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) {
@@ -1745,7 +1753,7 @@ chxj_trans_name(request_rec *r)
   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;
   }
 
@@ -1755,7 +1763,7 @@ chxj_trans_name(request_rec *r)
   }
 
 
-  DBG1(r,"Match URI[%s]", r->uri);
+  DBG(r,"Match URI[%s]", r->uri);
 
 
   if (r->filename == NULL) 
@@ -1767,7 +1775,7 @@ chxj_trans_name(request_rec *r)
   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)
@@ -1787,7 +1795,7 @@ chxj_trans_name(request_rec *r)
   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++) {
@@ -1809,7 +1817,7 @@ chxj_trans_name(request_rec *r)
       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) {
@@ -1821,7 +1829,7 @@ chxj_trans_name(request_rec *r)
     }
   }
   if (fname == NULL) {
-    DBG1(r,"NotFound [%s]", r->filename);
+    DBG(r,"NotFound [%s]", r->filename);
     return DECLINED;
   }
   for (ii=0; ii<7-1; ii++) {
@@ -1835,12 +1843,12 @@ chxj_trans_name(request_rec *r)
   }
 
   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);
   
index 1ab9b3a..107b681 100644 (file)
@@ -827,7 +827,7 @@ chxj_qr_code(qr_code_t* qrcode, char* module[])
     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
 
     /*------------------------------------------------------------------------*/
@@ -835,7 +835,7 @@ chxj_qr_code(qr_code_t* qrcode, char* module[])
     /*------------------------------------------------------------------------*/
     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
 
     /*------------------------------------------------------------------------*/
@@ -872,7 +872,7 @@ chxj_qr_code(qr_code_t* qrcode, char* module[])
   /*--------------------------------------------------------------------------*/
   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);
@@ -881,7 +881,7 @@ chxj_qr_code(qr_code_t* qrcode, char* module[])
     }
   }
 #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
 
@@ -890,7 +890,7 @@ chxj_qr_code(qr_code_t* qrcode, char* module[])
   /*--------------------------------------------------------------------------*/
   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
 
@@ -911,7 +911,7 @@ chxj_qr_code(qr_code_t* qrcode, char* module[])
     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
 
@@ -923,7 +923,7 @@ chxj_qr_code(qr_code_t* qrcode, char* module[])
   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
 
   /*--------------------------------------------------------------------------*/
@@ -954,7 +954,7 @@ chxj_qr_code(qr_code_t* qrcode, char* module[])
   /* ºÇŬ¥Þ¥¹¥¯¤ÇºÆÅÙºî¤ê¤Ê¤ª¤·                                               */
   /*--------------------------------------------------------------------------*/
 #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);
@@ -972,7 +972,7 @@ chxj_qr_code(qr_code_t* qrcode, char* 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 ;
 
@@ -981,7 +981,7 @@ chxj_qr_code(qr_code_t* qrcode, char* module[])
       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 */
@@ -1229,10 +1229,10 @@ chxj_qrcode_node_to_qrcode(qr_code_t* qrcode, Node* node)
     }
   }
 #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
 }
 
@@ -1248,7 +1248,7 @@ s_get_mode_spec(qr_code_t *qrcode)
   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;
@@ -1267,7 +1267,7 @@ s_get_char_bit_count(qr_code_t* qrcode, int len)
   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;
   }
@@ -1280,7 +1280,7 @@ s_get_char_bit_count(qr_code_t* qrcode, int len)
     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++) {
@@ -1298,7 +1298,7 @@ s_get_char_bit_count(qr_code_t* qrcode, int len)
   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;
@@ -1559,7 +1559,7 @@ s_data_to_bin_8bit(qr_code_t* qrcode, int UNUSED(data_code_count))
   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;
@@ -1637,7 +1637,7 @@ s_data_to_bin_kanji(qr_code_t* qrcode, int UNUSED(data_code_count))
   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;
@@ -1657,7 +1657,7 @@ s_tidy_8bit_code(qr_code_t* qrcode, const char* indata, int data_code_count)
   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);
@@ -1691,7 +1691,7 @@ s_tidy_8bit_code(qr_code_t* qrcode, const char* indata, int data_code_count)
   }
 
 #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;
@@ -1834,7 +1834,7 @@ s_setup_timing_pattern(qr_code_t* qrcode, char* dst[])
   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;
@@ -1930,7 +1930,7 @@ s_setup_type_info(qr_code_t* qrcode, char* dst[], qr_mask_pattern_t pat)
 
 #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
 
   /* ·Á¼°¾ðÊó¥Ç¡¼¥¿¤ÎÀ¸À® */
@@ -2057,8 +2057,8 @@ s_map_data(qr_code_t* qrcode,
 
 #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;
index e84631b..73c2e67 100644 (file)
@@ -92,7 +92,7 @@ chxj_specified_device(request_rec* r, const char* user_agent)
       continue;
     }
 
-    DBG1(r, "pattern is [%s]", dtl->pattern);
+    DBG(r, "pattern is [%s]", dtl->pattern);
     if (! dtl->regexp) {
       DBG(r,"compile failed.");
       return returnType;
@@ -100,10 +100,10 @@ chxj_specified_device(request_rec* r, const char* user_agent)
 
     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;
         }
index aed92c1..6325e07 100644 (file)
@@ -212,7 +212,7 @@ qs_get_selected_value_text(Doc *doc, Node* node, request_rec* r)
 
         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) {
           /*------------------------------------------------------------------*/
@@ -272,7 +272,7 @@ qs_get_selected_value(Doc* doc, Node* node, request_rec* r)
 
         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)
           /*------------------------------------------------------------------*/
@@ -487,7 +487,7 @@ chxj_chxjif_is_mine(device_table* spec, Doc* doc, Node* tag)
 
     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) {
index 43619b3..9e65748 100644 (file)
@@ -2507,7 +2507,7 @@ s_xhtml_1_0_text_tag(void* pdoc, Node* child)
     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;
index 727bd4e..8dfd654 100644 (file)
@@ -215,14 +215,14 @@ chxj_exchange(request_rec *r, const char** src, apr_size_t* len, device_table *s
   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;
   }
 
@@ -344,7 +344,7 @@ chxj_convert_input_header(request_rec *r,chxjconvrule_entry* entryp)
   }
 
   buff = apr_pstrdup(r->pool, r->args);
-  DBG1(r, "r->args=[%s]", buff);
+  DBG(r, "r->args=[%s]", buff);
 
   /* _chxj_dmy */
   /* _chxj_c_ */
@@ -373,12 +373,12 @@ chxj_convert_input_header(request_rec *r,chxjconvrule_entry* entryp)
 
         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);
       }
@@ -406,7 +406,7 @@ chxj_convert_input_header(request_rec *r,chxjconvrule_entry* entryp)
     }
     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()");
@@ -417,7 +417,7 @@ chxj_convert_input_header(request_rec *r,chxjconvrule_entry* entryp)
   }
   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;
 }
@@ -453,7 +453,7 @@ chxj_input_convert(
 
   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;
@@ -497,12 +497,12 @@ chxj_input_convert(
 
         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);
 
@@ -530,12 +530,12 @@ chxj_input_convert(
 
         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);
 
@@ -546,7 +546,7 @@ chxj_input_convert(
     }
     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()");
@@ -557,7 +557,7 @@ chxj_input_convert(
   }
   *len = strlen(result);
 
-  DBG1(r, "AFTER input convert result = [%s]", result);
+  DBG(r, "AFTER input convert result = [%s]", result);
 
   return result;
 }
@@ -657,7 +657,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
 
         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 
@@ -673,7 +673,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
             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, 
@@ -683,7 +683,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
                                         user_agent);
 
 #if 0
-            DBG2(r, "output data=[%.*s]", ctx->len,ctx->buffer);
+            DBG(r, "output data=[%.*s]", ctx->len,ctx->buffer);
 #endif
           }
           else {
@@ -759,7 +759,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
             memcpy(tmp, ctx->buffer, ctx->len);
 
 #if 0
-            DBG1(r, "input data=[%s]", tmp);
+            DBG(r, "input data=[%s]", tmp);
 #endif
 
 
@@ -772,7 +772,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
               ctx->buffer = tmp;
 
 #if 0
-            DBG2(r, "output data=[%.*s]", ctx->len,ctx->buffer);
+            DBG(r, "output data=[%.*s]", ctx->len,ctx->buffer);
 #endif
           }
         }
@@ -790,7 +790,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
         return rv;
       }
       else {
-        DBG1(r, " SAVE COOKIE[%x]", entryp->action);
+        DBG(r, " SAVE COOKIE[%x]", entryp->action);
 
         /*
          * save cookie.
@@ -815,12 +815,12 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
              */
             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;
 
@@ -837,7 +837,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
     }
     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) {
         /*--------------------------------------------------------------------*/
@@ -1001,7 +1001,7 @@ chxj_input_filter(ap_filter_t*        f,
       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);
     }
@@ -1029,7 +1029,7 @@ chxj_input_filter(ap_filter_t*        f,
     );
 
   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);
 
index 99fcc71..d2b1aa8 100644 (file)
@@ -264,16 +264,16 @@ qs_dump_node(Doc* doc, Node* node, int indent)
   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);
   }