OSDN Git Service

Merge branch 'branch_0.13.0' into branch_0.13.0-svn
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sat, 13 Dec 2008 18:37:55 +0000 (18:37 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sat, 13 Dec 2008 18:37:55 +0000 (18:37 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_13_0@4601 1a406e8e-add9-4483-a2c8-d8cac5b7c224

src/mod_chxj.c

index 519d34a..dc01a22 100644 (file)
@@ -965,7 +965,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
         }
       }
       if (apr_table_get(r->headers_out, "Location") || apr_table_get(r->err_headers_out, "Location")) {
-        if (r->status < HTTP_MULTIPLE_CHOICES || r->status > HTTP_TEMPORARY_REDIRECT) {
+        if (! ap_is_HTTP_REDIRECT(r->status)) {
           r->status = HTTP_MOVED_TEMPORARILY;
         }
       }
@@ -1141,7 +1141,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
           DBG(r, "REQ[%X] call pass_data_to_filter()", (unsigned int)(apr_size_t)r);
           s_add_cookie_id_if_has_location_header(r, cookie);
           if (apr_table_get(r->headers_out, "Location") || apr_table_get(r->err_headers_out, "Location")) {
-            if (r->status < HTTP_MULTIPLE_CHOICES || r->status > HTTP_TEMPORARY_REDIRECT) {
+            if (! ap_is_HTTP_REDIRECT(r->status)) {
               r->status = HTTP_MOVED_TEMPORARILY;
             }
           }
@@ -1192,7 +1192,7 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
           }
         }
         if (apr_table_get(r->headers_out, "Location") || apr_table_get(r->err_headers_out, "Location")) {
-          if (r->status < HTTP_MULTIPLE_CHOICES || r->status > HTTP_TEMPORARY_REDIRECT) {
+          if (! ap_is_HTTP_REDIRECT(r->status)) {
             r->status = HTTP_MOVED_TEMPORARILY;
           }
         }
@@ -1229,7 +1229,7 @@ s_add_cookie_id_if_has_location_header(request_rec *r, cookie_t *cookie)
     apr_table_unset(r->headers_out, "Location");
     apr_table_setn(r->headers_out, "Location", location_header);
     DBG(r, "REQ[%X] Location Header=[%s]", (unsigned int)(apr_size_t)r, location_header);
-    if (r->status < HTTP_MULTIPLE_CHOICES || r->status > HTTP_TEMPORARY_REDIRECT) {
+    if (!ap_is_HTTP_REDIRECT(r->status)) {
       r->status = HTTP_MOVED_TEMPORARILY;
     }
   }
@@ -1323,6 +1323,10 @@ chxj_input_handler(request_rec *r)
       apr_table_unset(r->headers_out, "Transfer-Encoding");
     }
   }
+  if (ap_is_HTTP_ERROR(response_code)) {
+    DBG(r, "REQ[%X] end of chxj_input_handler() (HTTP-ERROR received. response code:[%d])", (unsigned int)(apr_size_t)r, response_code);
+    return response_code;
+  }
   {
     apr_pool_t *wpool;
     apr_pool_create(&wpool, r->pool);
@@ -1344,7 +1348,7 @@ chxj_input_handler(request_rec *r)
   }
 
   DBG(r, "REQ[%X] end of chxj_input_handler()", (unsigned int)(apr_size_t)r);
-  return response_code;
+  return APR_SUCCESS;
 }
 
 static mod_chxj_global_config *