billbarker 2004/12/16 19:02:41
Modified: jk/java/org/apache/jk/common HandlerRequest.java
Log:
Fix weird NumberFormatException.
Apache never sends "Content-Length" as a String, which is probably why this
one has been here so long.
Reported By: Allistair Crossley [EMAIL PROTECTED]
Revision Changes Path
1.41 +3 -6
jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java
Index: HandlerRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- HandlerRequest.java 11 Dec 2004 04:00:35 -0000 1.40
+++ HandlerRequest.java 17 Dec 2004 03:02:41 -0000 1.41
@@ -675,8 +675,6 @@
hId = -1;
msg.getBytes( tmpMB );
ByteChunk bc=tmpMB.getByteChunk();
- //hName=tmpMB.toString();
- // vMB=headers.addValue( hName );
vMB=headers.addValue( bc.getBuffer(),
bc.getStart(), bc.getLength() );
}
@@ -684,12 +682,11 @@
msg.getBytes(vMB);
if (hId == SC_REQ_CONTENT_LENGTH ||
- tmpMB.equalsIgnoreCase("Content-Length")) {
+ (hId == -1 && tmpMB.equalsIgnoreCase("Content-Length"))) {
// just read the content-length header, so set it
- int contentLength = (vMB == null) ? -1 : vMB.getInt();
- req.setContentLength(contentLength);
+ req.setContentLength( vMB.getInt() );
} else if (hId == SC_REQ_CONTENT_TYPE ||
- tmpMB.equalsIgnoreCase("Content-Type")) {
+ (hId == -1 && tmpMB.equalsIgnoreCase("Content-Type"))) {
// just read the content-type header, so set it
ByteChunk bchunk = vMB.getByteChunk();
req.contentType().setBytes(bchunk.getBytes(),
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]