Use some existing constants instead of inline numbers
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 24 Mar 2009 10:35:53 +0000 (10:35 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 24 Mar 2009 10:35:53 +0000 (10:35 +0000)
in AJP connectors.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@757706 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jk/common/ChannelNioSocket.java
java/org/apache/jk/common/ChannelSocket.java
java/org/apache/jk/common/MsgAjp.java

index db93c10..93c3f26 100644 (file)
@@ -100,8 +100,8 @@ public class ChannelNioSocket extends JkHandler
     private int socketTimeout = 0;
     private boolean nioIsBroken = false;
     private Selector selector = null;
-    private int bufferSize = 8*1024;
-    private int packetSize = 8*1024;
+    private int bufferSize = AjpConstants.MAX_PACKET_SIZE;
+    private int packetSize = AjpConstants.MAX_PACKET_SIZE;
 
     private long requestCount=0;
     
@@ -154,7 +154,7 @@ public class ChannelNioSocket extends JkHandler
     }
 
     public void setBufferSize(int bs) {
-        if(bs > 8*1024) {
+        if(bs > AjpConstants.MAX_PACKET_SIZE) {
             bufferSize = bs;
         }
     }
@@ -164,8 +164,8 @@ public class ChannelNioSocket extends JkHandler
     }
 
     public void setPacketSize(int ps) {
-        if(ps < 8*1024) {
-            ps = 8*1024;
+        if(ps < AjpConstants.MAX_PACKET_SIZE) {
+            ps = AjpConstants.MAX_PACKET_SIZE;
         }
         packetSize = ps;
     }
index bf49904..3d38e9d 100644 (file)
@@ -89,7 +89,7 @@ public class ChannelSocket extends JkHandler
     private int linger=100;
     private int socketTimeout;
     private int bufferSize = -1;
-    private int packetSize = 8*1024;
+    private int packetSize = AjpConstants.MAX_PACKET_SIZE;
 
     private long requestCount=0;
     
@@ -208,8 +208,8 @@ public class ChannelSocket extends JkHandler
     }
 
     public void setPacketSize(int ps) {
-        if(ps < 8*1024) {
-            ps = 8*1024;
+        if(ps < AjpConstants.MAX_PACKET_SIZE) {
+            ps = AjpConstants.MAX_PACKET_SIZE;
         }
         packetSize = ps;
     }
index 8b6ce05..db5df55 100644 (file)
@@ -63,8 +63,8 @@ public class MsgAjp extends Msg {
      * Constructor that takes a buffer size
      */
     public MsgAjp(int bsize) {
-        if(bsize < 8*1024) {
-            bsize = 8*1024;
+        if(bsize < AjpConstants.MAX_PACKET_SIZE) {
+            bsize = AjpConstants.MAX_PACKET_SIZE;
         }
         bufsize = bsize;
         buf = new byte[bsize];
@@ -76,7 +76,7 @@ public class MsgAjp extends Msg {
      * @deprecated Use the buffer size constructor.
      */
     public MsgAjp() {
-        this(8*1024);
+        this(AjpConstants.MAX_PACKET_SIZE);
     }
 
     /**