OSDN Git Service

* Fixed Bug.
authorAtsushi Konno <konn@users.sourceforge.jp>
Tue, 7 Apr 2009 11:58:17 +0000 (20:58 +0900)
committerAtsushi Konno <konn@users.sourceforge.jp>
Tue, 7 Apr 2009 11:58:17 +0000 (20:58 +0900)
    - http://sourceforge.jp/ticket/browse.php?group_id=1608&tid=15934

src/chxj_img_conv_format.c
src/mod_chxj.c

index 31f02ea..f912528 100644 (file)
@@ -246,19 +246,14 @@ chxj_img_conv_format_handler(request_rec *r)
   int                   rtn;
 
   DBG(r, "REQ[%X] start chxj_img_conv_format_handler()", (apr_size_t)(unsigned int)r);
+
+  s_chxj_trans_name2(r);
   
   if (! r->handler || 
       (r->handler && !STRCASEEQ('c','C',"chxj-picture",r->handler) && !STRCASEEQ('c','C',"chxj-qrcode",r->handler))) {
     DBG(r, "REQ[%X] Response Code:[%d]", (apr_size_t)(unsigned int)r, r->status);
-    s_chxj_trans_name2(r);
-    if (! r->handler) {
-      DBG(r, "REQ[%X] end chxj_img_conv_format_handler() r->handler is null", (apr_size_t)(unsigned int)r);
-      return DECLINED;
-    }
-    if (r->handler && !STRCASEEQ('c','C',"chxj-picture",r->handler) && !STRCASEEQ('c','C',"chxj-qrcode",r->handler)) {
-      DBG(r, "REQ[%X] end chxj_img_conv_format_handler() r->handler is[%s]", (apr_size_t)(unsigned int)r, r->handler);
-      return DECLINED;
-    }
+    DBG(r, "REQ[%X] end chxj_img_conv_format_handler() r->handler is[%s]", (apr_size_t)(unsigned int)r, r->handler);
+    return DECLINED;
   }
 
   qsp = s_get_query_string_param(r);
@@ -2035,7 +2030,7 @@ chxj_trans_name(request_rec *r)
   DBG(r,"URI[%s]", filename_sv);
 
   do_ext_check = TRUE;
-  for (ii=0; ii<7-1; ii++) {
+  for (ii=0; ii<(int)(sizeof(ext)/sizeof(ext[0])); ii++) {
     char* pos = strrchr(filename_sv, '.');
     if (pos && pos++) {
       if (strcasecmp(pos, ext[ii]) == 0) {
@@ -2047,7 +2042,7 @@ chxj_trans_name(request_rec *r)
   }
 
   if (do_ext_check) {
-    for (ii=0; ii<7; ii++) {
+    for (ii=0; ii<(int)(sizeof(ext)/sizeof(ext[0])); ii++) {
       if (strlen(ext[ii]) == 0) {
         fname = apr_psprintf(r->pool, "%s", filename_sv);
       }
@@ -2069,7 +2064,7 @@ chxj_trans_name(request_rec *r)
     DBG(r,"NotFound [%s]", r->filename);
     return DECLINED;
   }
-  for (ii=0; ii<7-1; ii++) {
+  for (ii=0; ii<(int)(sizeof(ext)/sizeof(ext[0])); ii++) {
     char* pos = strrchr(fname, '.');
     if (pos && pos++) {
       if (strcasecmp(pos, ext[ii]) == 0) {
@@ -2153,7 +2148,7 @@ s_chxj_trans_name2(request_rec *r)
   DBG(r,"REQ[%x] r->filename[%s]", (apr_size_t)(unsigned int)r, filename_sv);
 
   do_ext_check = TRUE;
-  for (ii=0; ii<7-1; ii++) {
+  for (ii=0; ii<(int)(sizeof(ext)/sizeof(ext[0])); ii++) {
     char* pos = strrchr(filename_sv, '.');
     if (pos && pos++) {
       if (strcasecmp(pos, ext[ii]) == 0) {
@@ -2165,7 +2160,7 @@ s_chxj_trans_name2(request_rec *r)
   }
 
   if (do_ext_check) {
-    for (ii=0; ii<7; ii++) {
+    for (ii=0; ii<(int)(sizeof(ext)/sizeof(ext[0])); ii++) {
       if (strlen(ext[ii]) == 0) {
         fname = apr_psprintf(r->pool, "%s", filename_sv);
       }
@@ -2187,7 +2182,7 @@ s_chxj_trans_name2(request_rec *r)
     DBG(r,"NotFound [%s]", r->filename);
     return DECLINED;
   }
-  for (ii=0; ii<7-1; ii++) {
+  for (ii=0; ii<(int)(sizeof(ext)/sizeof(ext[0])); ii++) {
     char* pos = strrchr(fname, '.');
     if (pos && pos++) {
       if (strcasecmp(pos, ext[ii]) == 0) {
index 7c85017..a5e36d5 100644 (file)
@@ -1556,7 +1556,11 @@ chxj_translate_name(request_rec *r)
   DBG(r, "REQ[%X] START REQUEST (uri:[%s] args:[%s])", (unsigned int)(apr_size_t)r, r->unparsed_uri, r->args ? r->args : "");
   DBG(r, "REQ[%X] ", (unsigned int)(apr_size_t)r);
   DBG(r, "REQ[%X] =======================================================================", (unsigned int)(apr_size_t)r);
+#if 0
   return chxj_trans_name(r);
+#else
+  return DECLINED;
+#endif
 }