Rename since this message is used for response headers and response body
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 23 Aug 2011 11:00:02 +0000 (11:00 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 23 Aug 2011 11:00:02 +0000 (11:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1160619 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/ajp/AbstractAjpProcessor.java
java/org/apache/coyote/ajp/AjpNioProcessor.java
java/org/apache/coyote/ajp/AjpProcessor.java

index fc30163..f3f48c3 100644 (file)
@@ -146,9 +146,9 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> {
 
 
     /**
-     * Message used for response header composition.
+     * Message used for response composition.
      */
-    protected AjpMessage responseHeaderMessage = null;
+    protected AjpMessage responseMessage = null;
 
 
     /**
@@ -234,7 +234,7 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> {
         request.setInputBuffer(new SocketInputBuffer());
 
         requestHeaderMessage = new AjpMessage(packetSize);
-        responseHeaderMessage = new AjpMessage(packetSize);
+        responseMessage = new AjpMessage(packetSize);
         bodyMessage = new AjpMessage(packetSize);
 
         // Set the getBody message buffer
@@ -865,11 +865,11 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> {
 
         response.setCommitted(true);
 
-        responseHeaderMessage.reset();
-        responseHeaderMessage.appendByte(Constants.JK_AJP13_SEND_HEADERS);
+        responseMessage.reset();
+        responseMessage.appendByte(Constants.JK_AJP13_SEND_HEADERS);
 
         // HTTP header contents
-        responseHeaderMessage.appendInt(response.getStatus());
+        responseMessage.appendInt(response.getStatus());
         String message = null;
         if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER &&
                 HttpMessages.isSafeInHttpHeader(response.getMessage())) {
@@ -883,7 +883,7 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> {
             message = Integer.toString(response.getStatus());
         }
         tmpMB.setString(message);
-        responseHeaderMessage.appendBytes(tmpMB);
+        responseMessage.appendBytes(tmpMB);
 
         // Special headers
         MimeHeaders headers = response.getMimeHeaders();
@@ -902,24 +902,24 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> {
 
         // Other headers
         int numHeaders = headers.size();
-        responseHeaderMessage.appendInt(numHeaders);
+        responseMessage.appendInt(numHeaders);
         for (int i = 0; i < numHeaders; i++) {
             MessageBytes hN = headers.getName(i);
             int hC = Constants.getResponseAjpIndex(hN.toString());
             if (hC > 0) {
-                responseHeaderMessage.appendInt(hC);
+                responseMessage.appendInt(hC);
             }
             else {
-                responseHeaderMessage.appendBytes(hN);
+                responseMessage.appendBytes(hN);
             }
             MessageBytes hV=headers.getValue(i);
-            responseHeaderMessage.appendBytes(hV);
+            responseMessage.appendBytes(hV);
         }
 
         // Write to buffer
-        responseHeaderMessage.end();
-        output(responseHeaderMessage.getBuffer(), 0,
-                responseHeaderMessage.getLen());
+        responseMessage.end();
+        output(responseMessage.getBuffer(), 0,
+                responseMessage.getLen());
     }
 
 
index 8b34c24..6315419 100644 (file)
@@ -538,11 +538,11 @@ public class AjpNioProcessor extends AbstractAjpProcessor<NioChannel> {
                     thisTime = chunkSize;
                 }
                 len -= thisTime;
-                responseHeaderMessage.reset();
-                responseHeaderMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK);
-                responseHeaderMessage.appendBytes(chunk.getBytes(), chunk.getOffset() + off, thisTime);
-                responseHeaderMessage.end();
-                output(responseHeaderMessage.getBuffer(), 0, responseHeaderMessage.getLen());
+                responseMessage.reset();
+                responseMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK);
+                responseMessage.appendBytes(chunk.getBytes(), chunk.getOffset() + off, thisTime);
+                responseMessage.end();
+                output(responseMessage.getBuffer(), 0, responseMessage.getLen());
 
                 off += thisTime;
             }
index 57a0698..b5b3e24 100644 (file)
@@ -487,11 +487,11 @@ public class AjpProcessor extends AbstractAjpProcessor<Socket> {
                     thisTime = chunkSize;
                 }
                 len -= thisTime;
-                responseHeaderMessage.reset();
-                responseHeaderMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK);
-                responseHeaderMessage.appendBytes(chunk.getBytes(), chunk.getOffset() + off, thisTime);
-                responseHeaderMessage.end();
-                output.write(responseHeaderMessage.getBuffer(), 0, responseHeaderMessage.getLen());
+                responseMessage.reset();
+                responseMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK);
+                responseMessage.appendBytes(chunk.getBytes(), chunk.getOffset() + off, thisTime);
+                responseMessage.end();
+                output.write(responseMessage.getBuffer(), 0, responseMessage.getLen());
 
                 off += thisTime;
             }