tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r697192 - /tomcat/trunk/java/org/apache/jk/common/JkInputStream.java
Date Fri, 19 Sep 2008 19:12:59 GMT
Author: rjung
Date: Fri Sep 19 12:12:59 2008
New Revision: 697192

URL: http://svn.apache.org/viewvc?rev=697192&view=rev
Log:
Port r486217, which was applied to connectors, but has
never been applied to 6.0 and trunk.

Modified:
    tomcat/trunk/java/org/apache/jk/common/JkInputStream.java

Modified: tomcat/trunk/java/org/apache/jk/common/JkInputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jk/common/JkInputStream.java?rev=697192&r1=697191&r2=697192&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jk/common/JkInputStream.java (original)
+++ tomcat/trunk/java/org/apache/jk/common/JkInputStream.java Fri Sep 19 12:12:59 2008
@@ -52,6 +52,7 @@
     private boolean isFirst = true;
     private boolean isReplay = false;
     private boolean isReadRequired = false;
+    private int packetSize = AjpConstants.MAX_PACKET_SIZE;
 
     static {
         // Make certain HttpMessages is loaded for SecurityManager
@@ -64,14 +65,19 @@
 
     public JkInputStream(MsgContext context, int bsize) {
         mc = context;
-        bodyMsg = new MsgAjp(bsize);
-        outputMsg = new MsgAjp(bsize);
+        // Never use less than the default maximum packet size.
+        if (bsize < AjpConstants.MAX_PACKET_SIZE)
+            this.packetSize = AjpConstants.MAX_PACKET_SIZE;
+        else
+            this.packetSize = bsize;
+        bodyMsg = new MsgAjp(this.packetSize);
+        outputMsg = new MsgAjp(this.packetSize);
     }
     /**
      * @deprecated
      */
     public JkInputStream(MsgContext context) {
-        this(context, 8*1024);
+        this(context, AjpConstants.MAX_PACKET_SIZE);
     }
 
     // -------------------- Jk specific methods --------------------
@@ -244,7 +250,8 @@
         // Why not use outBuf??
         bodyMsg.reset();
         bodyMsg.appendByte(AjpConstants.JK_AJP13_GET_BODY_CHUNK);
-        bodyMsg.appendInt(AjpConstants.MAX_READ_SIZE);
+        // Adjust allowed size if packetSize != default (AjpConstants.MAX_PACKET_SIZE)
+        bodyMsg.appendInt(AjpConstants.MAX_READ_SIZE + packetSize - AjpConstants.MAX_PACKET_SIZE);
         
         if( log.isDebugEnabled() )
             log.debug("refillReadBuffer " + Thread.currentThread());



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


Mime
View raw message