DO NOT REPLY [Bug 38030] - HTTP 1.0 POST Request without a message body improperly receives a 403

2005-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38030


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2005-12-29 09:00 ---
This is now fixed in the SVN trunk, and will appear in 5.5.15.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r359756 - /tomcat/container/tc5.5.x/webapps/docs/changelog.xml

2005-12-29 Thread billbarker
Author: billbarker
Date: Thu Dec 29 00:28:07 2005
New Revision: 359756

URL: http://svn.apache.org/viewcvs?rev=359756&view=rev
Log:
doc changes

Modified:
tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=359756&r1=359755&r2=359756&view=diff
==
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Thu Dec 29 00:28:07 2005
@@ -45,6 +45,14 @@
   
37934: Don't ask for authentication if deny-from-all is in 
effect. (billbarker)
   
+  38047: Handle the case where the Servlet attempts to read
+  the Request body from the AJP/1.3 Connector, in the case that no
+  body was sent. (billbarker)
+  
+  38030: Unconditionally return EOS for an attempt to read 
+  the body of any request that doesn't send CL or TE. 
+  (remm, billbarker).
+  
 
   
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 38030] - HTTP 1.0 POST Request without a message body improperly receives a 403

2005-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38030





--- Additional Comments From [EMAIL PROTECTED]  2005-12-29 09:40 ---
(In reply to comment #1)
> This is now fixed in the SVN trunk, and will appear in 5.5.15.

Urm, this in no way means that I don't agree with Remy that the TCK test is 
completely invalid.  It really s*cks when Tomcat has to program around bugs in 
Sun's test, for no other reason than that the test author is completely brain-
dead.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 38010] - Destroy function don't work after stop service on Windows

2005-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38010


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE




--- Additional Comments From [EMAIL PROTECTED]  2005-12-29 09:43 ---


*** This bug has been marked as a duplicate of 29521 ***

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 29521] - No destroy methods called on service shutdown

2005-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29521


[EMAIL PROTECTED] changed:

   What|Removed |Added

 CC||[EMAIL PROTECTED]




--- Additional Comments From [EMAIL PROTECTED]  2005-12-29 09:43 ---
*** Bug 38010 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r359753 - /tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11Processor.java

2005-12-29 Thread Remy Maucherat

[EMAIL PROTECTED] wrote:

Author: billbarker
Date: Wed Dec 28 23:58:51 2005
New Revision: 359753

URL: http://svn.apache.org/viewcvs?rev=359753&view=rev
Log:
Unconditionally return EOS for an attempt to read the body of any request that 
doesn't send CL or TE.

I haven't seen any real objections to the patch (and it can't break a working 
HTTP/1.0 client :).  Also, it brings us in like with what Httpd does in this 
case.

Fix for Bug #38030
Submitted By: Remy


I have to do a separate, identical, commit for the HTTP connector people 
should be using, then.


In JK, I don't understand the usage of the "read required" field. It 
seems to be set according to:

// Check to see if there should be a body packet coming along
// immediately after
int cl=req.getContentLength();
if(cl > 0) {
JkInputStream jkIS = ep.getInputStream();
jkIS.setIsReadRequired(true);
if(!delayInitialRead) {
jkIS.receive();
}
}

Does this work with chunking ?

Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r359753 - /tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11Processor.java

2005-12-29 Thread Bill Barker

"Remy Maucherat" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> [EMAIL PROTECTED] wrote:
>> Author: billbarker
>> Date: Wed Dec 28 23:58:51 2005
>> New Revision: 359753
>>
>> URL: http://svn.apache.org/viewcvs?rev=359753&view=rev
>> Log:
>> Unconditionally return EOS for an attempt to read the body of any request 
>> that doesn't send CL or TE.
>>
>> I haven't seen any real objections to the patch (and it can't break a 
>> working HTTP/1.0 client :).  Also, it brings us in like with what Httpd 
>> does in this case.
>>
>> Fix for Bug #38030
>> Submitted By: Remy
>
> I have to do a separate, identical, commit for the HTTP connector people 
> should be using, then.
>
> In JK, I don't understand the usage of the "read required" field. It seems 
> to be set according to:
> // Check to see if there should be a body packet coming along
> // immediately after
> int cl=req.getContentLength();
> if(cl > 0) {
> JkInputStream jkIS = ep.getInputStream();
> jkIS.setIsReadRequired(true);
> if(!delayInitialRead) {
> jkIS.receive();
> }
> }
>
> Does this work with chunking ?
>

Without actually checking, mod_jk/mod_proxy_ajp should only send an 
unrequested initial bodyChunk if the client sends a CL.  So if there is no 
CL, Tomcat will send back GET_BODY_CHUNK message, and act on the response 
from Httpd/IIS/SunOne.

The main purpose of the "read required" field is to clean up if the Servlet 
fails to actually read the (small) Request body, even though Httpd sent it 
to Tomcat.  Now (like the APR/AJP Connector), Tomcat doesn't attempt to 
actually read (by default) the unrequested initial bodyChunk until the 
Servlet asks for it.  However, if Httpd sent it, and the Servlet didn't ask 
for it, Tomcat needs to get it out of the the Socket stream, or bad things 
are going to happen ;-).

> Rémy 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r359753 - /tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11Processor.java

2005-12-29 Thread Mladen Turk

Bill Barker wrote:


Without actually checking, mod_jk/mod_proxy_ajp should only send an 
unrequested initial bodyChunk if the client sends a CL.  So if there is no 
CL, Tomcat will send back GET_BODY_CHUNK message, and act on the response 
from Httpd/IIS/SunOne.




For reading initial body mod_jk( and mod_ajp) relies on web
server providing initial body. For apache we use ap_get_client_block
that will return body length if CL is present or in case of chunked
encoding.

There is however one more thing that needs to be resolved and is
pretty important.

JK code in Tomcat has no way to figure out if the
AJP13_SEND_BODY_CHUNK has failed or not due to client error
(for example client closed browser before entire data has been sent).

Now I think that the JK connector recycles the current send
loop in case there is a 'new' request instead SEND_BODY_CHUNK
while the connector was in the send loop, but it does not
propagate that to the upper chain, so Tomcat on the next
request returns 304 (Not Modified) for the same resource
although there was error in previous send.

So, in case mod_jk sends AJP13_FORWARD_REQUEST while the
Tomcat part was in the SEND_BODY_CHUNK chunk loop the Tomcat
part of connector must behave like the connection was closed
and then re-established (without closing the socket of course).

Regards,
Mladen.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r359797 - /tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java

2005-12-29 Thread markt
Author: markt
Date: Thu Dec 29 06:04:47 2005
New Revision: 359797

URL: http://svn.apache.org/viewcvs?rev=359797&view=rev
Log:
Fix for bug 38012. Allow CGI scripts to issue redirects. Actually a more
general fix that allows CGI to set response status. Ported from TC5.

Modified:

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java

Modified: 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java?rev=359797&r1=359796&r2=359797&view=diff
==
--- 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 (original)
+++ 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 Thu Dec 29 06:04:47 2005
@@ -246,9 +246,6 @@
 
 /* some vars below copied from Craig R. McClanahan's InvokerServlet */
 
-/** the Context container associated with our web application. */
-private ServletContext context = null;
-
 /** the debugging detail level for this servlet. */
 private int debug = 0;
 
@@ -318,6 +315,7 @@
 } catch (IOException ioe) {
 ServletException e = new ServletException(
 "Unable to read shell environment variables", ioe);
+throw e;
 }
 }
 
@@ -326,9 +324,6 @@
 cgiExecutable = value;
 }
 
-// Identify the internal container resources we need
-context = config.getServletContext();
-
 }
 
 
@@ -1424,6 +1419,10 @@
  * @version   $Revision$, $Date$
  */
 
+/**
+ * @author Mark
+ *
+ */
 protected class CGIRunner {
 
 /** script/command to be executed */
@@ -1771,10 +1770,7 @@
 log("runCGI: addHeader(\"" + line + "\")");
 }
 if (line.startsWith("HTTP")) {
-//TODO: should set status codes (NPH support)
-/*
- * response.setStatus(getStatusCode(line));
- */
+response.setStatus(getStatus(line));
 } else if (line.indexOf(":") >= 0) {
 String header =
 line.substring(0, line.indexOf(":")).trim();
@@ -1841,6 +1837,36 @@
 }
 }
 
+/**
+ * Parses the status header and extracts the status code.
+ * 
+ * @param line The HTTP Status-Line (RFC2616, section 6.1)
+ * @return The extracted status code or the code representing an
+ * internal error if a valid status code cannot be extracted. 
+ */
+private int getStatus(String line) {
+int statusStart = line.indexOf(' ');
+
+if (statusStart < 0 || line.length() < statusStart + 4) {
+// Not a valid status line
+log ("runCGI: invalid status line:" + line);
+return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+}
+
+String status = line.substring(statusStart + 1, statusStart + 4);
+
+int statusCode;
+try {
+statusCode = Integer.parseInt(status);
+} catch (NumberFormatException nfe) {
+// Not a valid status code
+log ("runCGI: invalid status code:" + status);
+return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+}
+
+return statusCode;
+}
+
 private void sendToLog(BufferedReader rdr) {
 String line = null;
 int lineCount = 0 ;
@@ -1873,7 +1899,6 @@
  */
 
 protected String getPostInput(ArrayList params) {
-String lineSeparator = System.getProperty("line.separator");
 StringBuffer qs = new StringBuffer("");
 for (int i=0; i < params.size(); i++) {
 NameValuePair nvp = (NameValuePair) this.params.get(i); 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r359798 - in /tomcat/container/tc5.5.x: catalina/src/share/org/apache/catalina/servlets/CGIServlet.java webapps/docs/changelog.xml

2005-12-29 Thread markt
Author: markt
Date: Thu Dec 29 06:06:58 2005
New Revision: 359798

URL: http://svn.apache.org/viewcvs?rev=359798&view=rev
Log:
Fix for bug 38012. Allow CGI scripts to issue redirects. Actually a more
general fix that allows CGI to set response status.

Modified:

tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java?rev=359798&r1=359797&r2=359798&view=diff
==
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 Thu Dec 29 06:06:58 2005
@@ -1772,10 +1772,7 @@
 log("runCGI: addHeader(\"" + line + "\")");
 }
 if (line.startsWith("HTTP")) {
-//TODO: should set status codes (NPH support)
-/*
- * response.setStatus(getStatusCode(line));
- */
+response.setStatus(getStatus(line));
 } else if (line.indexOf(":") >= 0) {
 String header =
 line.substring(0, line.indexOf(":")).trim();
@@ -1851,6 +1848,36 @@
 }
 }
 
+/**
+ * Parses the status header and extracts the status code.
+ * 
+ * @param line The HTTP Status-Line (RFC2616, section 6.1)
+ * @return The extracted status code or the code representing an
+ * internal error if a valid status code cannot be extracted. 
+ */
+private int getStatus(String line) {
+int statusStart = line.indexOf(' ');
+
+if (statusStart < 0 || line.length() < statusStart + 4) {
+// Not a valid status line
+log ("runCGI: invalid status line:" + line);
+return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+}
+
+String status = line.substring(statusStart + 1, statusStart + 4);
+
+int statusCode;
+try {
+statusCode = Integer.parseInt(status);
+} catch (NumberFormatException nfe) {
+// Not a valid status code
+log ("runCGI: invalid status code:" + status);
+return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+}
+
+return statusCode;
+}
+
 private void sendToLog(BufferedReader rdr) {
 String line = null;
 int lineCount = 0 ;

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=359798&r1=359797&r2=359798&view=diff
==
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Thu Dec 29 06:06:58 2005
@@ -34,6 +34,9 @@
Remove leftover static logger which was used to log application level 
messages in
ApplicationContextFacade (remm)
   
+  
+38012: Where a CGI script sets a response code, use it. 
(markt)
+  
 
   
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 38012] - CGIServlet redirect

2005-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38012


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2005-12-29 15:07 ---
This has been fixed in SVN for TC4 and TC5. I used a more general fix that
allows any status code to be set.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r359799 - /tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java

2005-12-29 Thread markt
Author: markt
Date: Thu Dec 29 06:09:34 2005
New Revision: 359799

URL: http://svn.apache.org/viewcvs?rev=359799&view=rev
Log:
Remove useless comment kindly added by my IDE

Modified:

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java

Modified: 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java?rev=359799&r1=359798&r2=359799&view=diff
==
--- 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 (original)
+++ 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 Thu Dec 29 06:09:34 2005
@@ -1419,10 +1419,6 @@
  * @version   $Revision$, $Date$
  */
 
-/**
- * @author Mark
- *
- */
 protected class CGIRunner {
 
 /** script/command to be executed */



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 38012] - CGIServlet redirect

2005-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38012


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |




--- Additional Comments From [EMAIL PROTECTED]  2005-12-29 16:09 ---
My testing of this patch did not work.  

I think you have to use the "sendRedirect()" method in the response object.

The call that was added to "setStatus()" for this patch is not being used in my
scenario as this is not a NPH response.

Here is the response lines which are being read in my application:

Content-Type: text/html; charset=ISO-8859-1
Status: 302 Moved
Set-Cookie: emsng_ietm_session_key=b4849b471b8fab616355598d151a92b5; path=/
Date: Thu, 29 Dec 2005 15:02:48 GMT
Location: http://bfaist-ws:8080/emsng_ietm/cgi-bin/IETM_Menu.pl




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r359864 - /tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java

2005-12-29 Thread remm
Author: remm
Date: Thu Dec 29 10:12:55 2005
New Revision: 359864

URL: http://svn.apache.org/viewcvs?rev=359864&view=rev
Log:
- Port patch.

Modified:

tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java

Modified: 
tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewcvs/tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=359864&r1=359863&r2=359864&view=diff
==
--- 
tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
 (original)
+++ 
tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
 Thu Dec 29 10:12:55 2005
@@ -1364,18 +1364,13 @@
 parseHost(valueMB);
 
 if (!contentDelimitation) {
-// If there's no content length and we're using keep-alive
-// (HTTP/1.0 with keep-alive or HTTP/1.1), assume
+// If there's no content length 
+// (broken HTTP/1.0 or HTTP/1.1), assume
 // the client is not broken and didn't send a body
-if (keepAlive) {
-inputBuffer.addActiveFilter
+inputBuffer.addActiveFilter
 (inputFilters[Constants.VOID_FILTER]);
-contentDelimitation = true;
-}
+contentDelimitation = true;
 }
-
-if (!contentDelimitation)
-keepAlive = false;
 
 // Advertise sendfile support through a request attribute
 if (endpoint.getUseSendfile()) {



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r359869 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java

2005-12-29 Thread markt
Author: markt
Date: Thu Dec 29 10:42:08 2005
New Revision: 359869

URL: http://svn.apache.org/viewcvs?rev=359869&view=rev
Log:
Bug 38012. Add support for the CGI specific status header. 


Modified:

tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java?rev=359869&r1=359868&r2=359869&view=diff
==
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 Thu Dec 29 10:42:08 2005
@@ -1772,13 +1772,17 @@
 log("runCGI: addHeader(\"" + line + "\")");
 }
 if (line.startsWith("HTTP")) {
-response.setStatus(getStatus(line));
+response.setStatus(getSCFromHttpStatusLine(line));
 } else if (line.indexOf(":") >= 0) {
 String header =
 line.substring(0, line.indexOf(":")).trim();
 String value =
 line.substring(line.indexOf(":") + 1).trim(); 
-response.addHeader(header , value);
+if (header.equalsIgnoreCase("status")) {
+
response.setStatus(getSCFromCGIStatusHeader(value));
+} else {
+response.addHeader(header , value);
+}
 if ((header.toLowerCase().equals("content-type"))
 && (!value.toLowerCase().startsWith("text"))) {
 isBinaryContent = true;
@@ -1849,22 +1853,51 @@
 }
 
 /**
- * Parses the status header and extracts the status code.
+ * Parses the Status-Line and extracts the status code.
  * 
  * @param line The HTTP Status-Line (RFC2616, section 6.1)
  * @return The extracted status code or the code representing an
  * internal error if a valid status code cannot be extracted. 
  */
-private int getStatus(String line) {
-int statusStart = line.indexOf(' ');
+private int getSCFromHttpStatusLine(String line) {
+int statusStart = line.indexOf(' ') + 1;
+
+if (statusStart < 1 || line.length() < statusStart + 3) {
+// Not a valid HTTP Status-Line
+log ("runCGI: invalid HTTP Status-Line:" + line);
+return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+}
+
+String status = line.substring(statusStart, statusStart + 3);
+
+int statusCode;
+try {
+statusCode = Integer.parseInt(status);
+} catch (NumberFormatException nfe) {
+// Not a valid status code
+log ("runCGI: invalid status code:" + status);
+return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+}
 
-if (statusStart < 0 || line.length() < statusStart + 4) {
-// Not a valid status line
-log ("runCGI: invalid status line:" + line);
+return statusCode;
+}
+
+/**
+ * Parses the CGI Status Header value and extracts the status code.
+ * 
+ * @param value The CGI Status value of the form 
+ * digit digit digit SP reason-phrase
+ * @return The extracted status code or the code representing an
+ * internal error if a valid status code cannot be extracted. 
+ */
+private int getSCFromCGIStatusHeader(String value) {
+if (value.length() < 3) {
+// Not a valid status value
+log ("runCGI: invalid status value:" + value);
 return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
 }
 
-String status = line.substring(statusStart + 1, statusStart + 4);
+String status = value.substring(0, 3);
 
 int statusCode;
 try {



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r359870 - /tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java

2005-12-29 Thread markt
Author: markt
Date: Thu Dec 29 10:42:45 2005
New Revision: 359870

URL: http://svn.apache.org/viewcvs?rev=359870&view=rev
Log:
Bug 38012. Add support for the CGI specific status header. 


Modified:

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java

Modified: 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java?rev=359870&r1=359869&r2=359870&view=diff
==
--- 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 (original)
+++ 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java
 Thu Dec 29 10:42:45 2005
@@ -1766,13 +1766,17 @@
 log("runCGI: addHeader(\"" + line + "\")");
 }
 if (line.startsWith("HTTP")) {
-response.setStatus(getStatus(line));
+response.setStatus(getSCFromHttpStatusLine(line));
 } else if (line.indexOf(":") >= 0) {
 String header =
 line.substring(0, line.indexOf(":")).trim();
 String value =
-line.substring(line.indexOf(":") + 1).trim(); 
-response.addHeader(header , value);
+line.substring(line.indexOf(":") + 1).trim();
+if (header.equalsIgnoreCase("status")) {
+
response.setStatus(getSCFromCGIStatusHeader(value));
+} else {
+response.addHeader(header , value);
+}
 if ((header.toLowerCase().equals("content-type"))
 && (!value.toLowerCase().startsWith("text"))) {
 isBinaryContent = true;
@@ -1834,22 +1838,22 @@
 }
 
 /**
- * Parses the status header and extracts the status code.
+ * Parses the Status-Line and extracts the status code.
  * 
  * @param line The HTTP Status-Line (RFC2616, section 6.1)
  * @return The extracted status code or the code representing an
  * internal error if a valid status code cannot be extracted. 
  */
-private int getStatus(String line) {
-int statusStart = line.indexOf(' ');
+private int getSCFromHttpStatusLine(String line) {
+int statusStart = line.indexOf(' ') + 1;
 
-if (statusStart < 0 || line.length() < statusStart + 4) {
-// Not a valid status line
-log ("runCGI: invalid status line:" + line);
+if (statusStart < 1 || line.length() < statusStart + 3) {
+// Not a valid HTTP Status-Line
+log ("runCGI: invalid HTTP Status-Line:" + line);
 return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
 }
 
-String status = line.substring(statusStart + 1, statusStart + 4);
+String status = line.substring(statusStart, statusStart + 3);
 
 int statusCode;
 try {
@@ -1862,7 +1866,36 @@
 
 return statusCode;
 }
-
+
+/**
+ * Parses the CGI Status Header value and extracts the status code.
+ * 
+ * @param value The CGI Status value of the form 
+ * digit digit digit SP reason-phrase
+ * @return The extracted status code or the code representing an
+ * internal error if a valid status code cannot be extracted. 
+ */
+private int getSCFromCGIStatusHeader(String value) {
+if (value.length() < 3) {
+// Not a valid status value
+log ("runCGI: invalid status value:" + value);
+return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+}
+
+String status = value.substring(0, 3);
+
+int statusCode;
+try {
+statusCode = Integer.parseInt(status);
+} catch (NumberFormatException nfe) {
+// Not a valid status code
+log ("runCGI: invalid status code:" + status);
+return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+}
+
+return statusCode;
+}
+
 private void sendToLog(BufferedReader rdr) {
 String line = null;
 int lineCount = 0 ;



-
To unsubscribe, e-mail: [E

DO NOT REPLY [Bug 38012] - CGIServlet redirect

2005-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38012


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2005-12-29 19:45 ---
Thanks for testing so quickly.

I have added handling for the CGI specific status header. My testing shows that
send redirect is unecessary since the redirect status code and the location
headers are both present.

Again, TC4 and TC5 patched.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 38012] - CGIServlet redirect

2005-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38012





--- Additional Comments From [EMAIL PROTECTED]  2005-12-29 19:58 ---
My testing of the latest patch was successful.  Thanks Mark.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r359923 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/util/ExtensionValidator.java

2005-12-29 Thread markt
Author: markt
Date: Thu Dec 29 15:16:07 2005
New Revision: 359923

URL: http://svn.apache.org/viewcvs?rev=359923&view=rev
Log:
Remove unused code

Modified:

tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/util/ExtensionValidator.java

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/util/ExtensionValidator.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/util/ExtensionValidator.java?rev=359923&r1=359922&r2=359923&view=diff
==
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/util/ExtensionValidator.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/util/ExtensionValidator.java
 Thu Dec 29 15:16:07 2005
@@ -24,7 +24,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
-import java.util.ResourceBundle;
 import java.util.StringTokenizer;
 import java.util.jar.JarInputStream;
 import java.util.jar.Manifest;
@@ -64,7 +63,6 @@
 
 private static HashMap containerAvailableExtensions = null;
 private static ArrayList containerManifestResources = new ArrayList();
-private static ResourceBundle messages = null;
 
 
 // - Static Initializer
@@ -136,7 +134,6 @@
 
 String appName = context.getPath();
 ArrayList appManifestResources = new ArrayList();
-ManifestResource appManifestResource = null;
 // If the application context is null it does not exist and 
 // therefore is not valid
 if (dirContext == null) return false;



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 38078] New: - java.lang.RuntimeException: Read of HTTP Request POST parameters failed: Read timed out

2005-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38078

   Summary: java.lang.RuntimeException: Read of HTTP Request POST
parameters failed: Read timed out
   Product: Tomcat 4
   Version: 4.1.24
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: major
  Priority: P2
 Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


I am using Jboss application server with embedded tomcat web server(Apache 
Tomcat/4.1.24-LE-jdk14) in our application. I am getting below mentioned 
exception very often. Please let me know why does this exception happen and the 
cause for it. Also please advice what can be the possible solution for this 
error. Please find the exception stack trace below: 
java.lang.RuntimeException: Read of HTTP Request POST parameters failed: Read 
timed out 
at org.apache.catalina.connector.HttpRequestBase.parseParameters
(HttpRequestBase.java:692) 
at org.apache.catalina.connector.HttpRequestBase.getParameterNames
(HttpRequestBase.java:750) 
at org.apache.catalina.connector.RequestFacade.getParameterNames
(RequestFacade.java:176) 
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1161) 
at org.apache.struts.action.RequestProcessor.processPopulate
(RequestProcessor.java:821) 
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) 
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480) 
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193) 
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:256) 
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643) 
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191) 
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643) 
at org.apache.catalina.valves.CertificatesValve.invoke
(CertificatesValve.java:246) 
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641) 
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) 
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180) 
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643) 
at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:171) 
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641) 
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:172) 
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641) 
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509) 
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641) 
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174) 
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643) 
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
at org.apache.catalina.connector.http.HttpProcessor.run
(HttpProcessor.java:1151) 
at java.lang.Thread.run(Thread.java:534) 
2005-11-21 15:16:27,258 [HttpProcessor[443][485]] DEBUG 
org.apache.struts.util.RequestUtils - Get module name for 
path /knFetchMemberNames.do 
2005-11-21 15:16:27,259 [HttpProcessor[443][485]] DEBUG 
org.apache.struts.util.RequestUtils - Module name found: default 
2005-11-21 15:16:27,259 [HttpProcessor[443][485]] DEBUG 
org.apache.struts.action.RequestProcessor - Processing a 'POST' for 
path '/knFetchMemberNames' 
2005-11-21 15:16:27,259 [HttpPr