tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r660169 - in /tomcat/connectors/trunk/jk: native/apache-2.0/mod_jk.c xdocs/miscellaneous/changelog.xml
Date Mon, 26 May 2008 11:51:32 GMT
Author: rjung
Date: Mon May 26 04:51:30 2008
New Revision: 660169

URL: http://svn.apache.org/viewvc?rev=660169&view=rev
Log:
BZ 45026: For Apache httpd 2.x add "Unknown Reason"
as the reason phrase, if we get an empty one from the backend.
Otherwise httpd 2.x returns status 500.

Modified:
    tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=660169&r1=660168&r2=660169&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Mon May 26 04:51:30 2008
@@ -283,8 +283,25 @@
     apache_private_data_t *p = s->ws_private;
     request_rec *r = p->r;
 
-    if (!reason) {
-        reason = "";
+    /* If there is no reason given (or an empty one),
+     * we'll try to guess a good one.
+     */
+    if (!reason || *reason == '\0') {
+        /* We ask Apache httpd about a good reason phrase. */
+        reason = ap_get_status_line(status);
+        /* Unfortunately it returns with a 500 reason phrase,
+         * whenever it does not know about the given status code,
+         * e.g. in the case of custom status codes.
+         */
+        if (status != 500 && !strncmp(reason, "500 ", 4)) {
+            reason = "Unknown Reason";
+        } else {
+            /* Apache httpd returns a full status line,
+             * but we only want a reason phrase, so skip
+             * the prepended status code.
+             */
+            reason = reason + 4;
+        }
     }
     r->status = status;
     r->status_line = apr_psprintf(r->pool, "%d %s", status, reason);

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=660169&r1=660168&r2=660169&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Mon May 26 04:51:30 2008
@@ -44,6 +44,11 @@
   <subsection name="Native">
     <changelog>
       <fix>
+        <bug>45026</bug>: For Apache httpd 2.x add "Unknown Reason"
+        as the reason phrase, if we get an empty one from the backend.
+        Otherwise httpd 2.x returns status 500.
+      </fix>
+      <fix>
         Fix Cygwin build. (rjung)
       </fix>
       <update>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message