OSDN Git Service

* Added New Features.
authorAtsushi Konno <konn@users.sourceforge.jp>
Tue, 31 Mar 2009 09:16:55 +0000 (18:16 +0900)
committerAtsushi Konno <konn@users.sourceforge.jp>
Tue, 31 Mar 2009 09:16:55 +0000 (18:16 +0900)
    - Added EnvInfoOnly Option for ChxjConvertRule directive.

include/mod_chxj.h
src/mod_chxj.c

index 7a51f51..fd18b6e 100644 (file)
@@ -381,6 +381,7 @@ struct mod_chxj_config {
 #define CONVRULE_JRCONV_OFF_BIT       (0x00000400)
 #define CONVRULE_NOCACHE_ON_BIT       (0x00000800)
 #define CONVRULE_EMOJI_ONLY_BIT       (0x00001000)
+#define CONVRULE_ENVINFO_ONLY_BIT     (0x00002000)
 
 #define CONVRULE_ENGINE_ON_CMD        "EngineOn"
 #define CONVRULE_ENGINE_OFF_CMD       "EngineOff"
@@ -398,6 +399,7 @@ struct mod_chxj_config {
 #define CONVRULE_JRCONV_OFF_CMD       "JRConvOff"
 #define CONVRULE_NOCACHE_ON_CMD       "NoCacheOn"
 #define CONVRULE_EMOJI_ONLY_CMD       "EmojiOnly"
+#define CONVRULE_ENVINFO_ONLY_CMD     "EnvInfoOnly"
 
 
 #define CONVRULE_FLAG_NOTMATCH        (0x00000001)
index 0f7bb65..31716ee 100644 (file)
@@ -379,7 +379,9 @@ chxj_convert(request_rec *r, const char **src, apr_size_t *len, device_table *sp
    * save cookie.
    */
   cookie = NULL;
-  if (entryp->action & CONVRULE_COOKIE_ON_BIT && !(entryp->action & CONVRULE_EMOJI_ONLY_BIT)) {
+  if (entryp->action & CONVRULE_COOKIE_ON_BIT 
+      && !(entryp->action & CONVRULE_EMOJI_ONLY_BIT)
+      && !(entryp->action & CONVRULE_ENVINFO_ONLY_BIT)) {
     switch(spec->html_spec_type) {
     case CHXJ_SPEC_Chtml_1_0:
     case CHXJ_SPEC_Chtml_2_0:
@@ -424,29 +426,31 @@ chxj_convert(request_rec *r, const char **src, apr_size_t *len, device_table *sp
         }
       }
       DBG(r, "REQ[%X] end of chxj_convert()(emoji only)", (unsigned int)(apr_size_t)r);
-      return dst;
     }
 
-    if (convert_routine[spec->html_spec_type].converter) {
-      if (tmp)
-        dst = convert_routine[spec->html_spec_type].converter(r, 
-                                                              spec, 
-                                                              tmp, 
-                                                              *len, 
-                                                              len, 
-                                                              entryp, 
-                                                              cookie);
-      else
-        dst = convert_routine[spec->html_spec_type].converter(r,
-                                                              spec, 
-                                                              *src, 
-                                                              *len, 
-                                                              len, 
-                                                              entryp, 
-                                                              cookie);
-    }
-    if (dst && *len) {
-      dst = chxj_conv_z2h(r, dst, len, entryp);
+    if (   !(entryp->action & CONVRULE_EMOJI_ONLY_BIT) 
+        && !(entryp->action & CONVRULE_ENVINFO_ONLY_BIT)) {
+      if (convert_routine[spec->html_spec_type].converter) {
+        if (tmp)
+          dst = convert_routine[spec->html_spec_type].converter(r, 
+                                                                spec, 
+                                                                tmp, 
+                                                                *len, 
+                                                                len, 
+                                                                entryp, 
+                                                                cookie);
+        else
+          dst = convert_routine[spec->html_spec_type].converter(r,
+                                                                spec, 
+                                                                *src, 
+                                                                *len, 
+                                                                len, 
+                                                                entryp, 
+                                                                cookie);
+      }
+      if (dst && *len) {
+        dst = chxj_conv_z2h(r, dst, len, entryp);
+      }
     }
   }
   ap_set_content_length(r, *len);
@@ -2320,6 +2324,10 @@ cmd_convert_rule(cmd_parms *cmd, void *mconfig, const char *arg)
       if (strcasecmp(CONVRULE_EMOJI_ONLY_CMD, action) == 0) {
         newrule->action |= CONVRULE_EMOJI_ONLY_BIT;
       }
+      else
+      if (strcasecmp(CONVRULE_ENVINFO_ONLY_CMD, action) == 0) {
+        newrule->action |= CONVRULE_ENVINFO_ONLY_BIT;
+      }
       break;
 
     case 'C':