seguin      02/01/26 06:14:35

  Modified:    jk/java/org/apache/jk/common HandlerRequest.java
  Log:
  port fix for bug 5861.
  
  Revision  Changes    Path
  1.3       +9 -1      
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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HandlerRequest.java       26 Jan 2002 07:25:53 -0000      1.2
  +++ HandlerRequest.java       26 Jan 2002 14:14:35 -0000      1.3
  @@ -430,6 +430,13 @@
                   msg.getInt(); // To advance the read position
                   hName = headerTransArray[hId - 1];
               } else {
  +                // reset hId -- if the header currently being read
  +                // happens to be 7 or 8 bytes long, the code below
  +                // will think it's the content-type header or the
  +                // content-length header - SC_REQ_CONTENT_TYPE=7,
  +                // SC_REQ_CONTENT_LENGTH=8 - leading to unexpected
  +                // behaviour.  see bug 5861 for more information.
  +                hId = -1;
                   msg.getBytes( tmpMB );
                   hName=tmpMB.toString();
               }
  @@ -437,11 +444,12 @@
               vMB=headers.addValue( hName );
               msg.getBytes(vMB);
   
  -            // set content length, if this is it...
               if (hId == SC_REQ_CONTENT_LENGTH) {
  +                // just read the content-length header, so set it
                   int contentLength = (vMB == null) ? -1 : vMB.getInt();
                   req.setContentLength(contentLength);
               } else if (hId == SC_REQ_CONTENT_TYPE) {
  +                // just read the content-type header, so set it
                   ByteChunk bchunk = vMB.getByteChunk();
                   req.contentType().setBytes(bchunk.getBytes(),
                                              bchunk.getOffset(),
  
  
  

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

Reply via email to