Author: markt Date: Wed Dec 14 11:05:54 2016 New Revision: 1774183 URL: http://svn.apache.org/viewvc?rev=1774183&view=rev Log: Don't duplicate storage of ajpFlush in the Processor
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java?rev=1774183&r1=1774182&r2=1774183&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java Wed Dec 14 11:05:54 2016 @@ -93,19 +93,19 @@ public abstract class AbstractAjpProtoco // ------------------------------------------------- AJP specific properties // ------------------------------------------ managed in the ProtocolHandler + private boolean ajpFlush = true; + public boolean getAjpFlush() { return ajpFlush; } /** - * Send AJP flush packet when flushing. - * An flush packet is a zero byte AJP13 SEND_BODY_CHUNK - * packet. mod_jk and mod_proxy_ajp interprete this as - * a request to flush data to the client. - * AJP always does flush at the and of the response, so if - * it is not important, that the packets get streamed up to - * the client, do not use extra flush packets. - * For compatibility and to stay on the safe side, flush - * packets are enabled by default. + * Configure whether to aend an AJP flush packet when flushing. A flush + * packet is a zero byte AJP13 SEND_BODY_CHUNK packet. mod_jk and + * mod_proxy_ajp interpret this as a request to flush data to the client. + * AJP always does flush at the and of the response, so if it is not + * important, that the packets get streamed up to the client, do not use + * extra flush packets. For compatibility and to stay on the safe side, + * flush packets are enabled by default. + * + * @param ajpFlush The new flush setting */ - protected boolean ajpFlush = true; - public boolean getAjpFlush() { return ajpFlush; } public void setAjpFlush(boolean ajpFlush) { this.ajpFlush = ajpFlush; } @@ -186,7 +186,6 @@ public abstract class AbstractAjpProtoco protected Processor createProcessor() { AjpProcessor processor = new AjpProcessor(this); processor.setAdapter(getAdapter()); - processor.setAjpFlush(getAjpFlush()); processor.setTomcatAuthentication(getTomcatAuthentication()); processor.setTomcatAuthorization(getTomcatAuthorization()); processor.setRequiredSecret(requiredSecret); Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1774183&r1=1774182&r2=1774183&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Wed Dec 14 11:05:54 2016 @@ -279,25 +279,6 @@ public class AjpProcessor extends Abstra // ------------------------------------------------------------- Properties - - /** - * Send AJP flush packet when flushing. - * An flush packet is a zero byte AJP13 SEND_BODY_CHUNK - * packet. mod_jk and mod_proxy_ajp interprete this as - * a request to flush data to the client. - * AJP always does flush at the and of the response, so if - * it is not important, that the packets get streamed up to - * the client, do not use extra flush packets. - * For compatibility and to stay on the safe side, flush - * packets are enabled by default. - */ - protected boolean ajpFlush = true; - public boolean getAjpFlush() { return ajpFlush; } - public void setAjpFlush(boolean ajpFlush) { - this.ajpFlush = ajpFlush; - } - - /** * The number of milliseconds Tomcat will wait for a subsequent request * before closing the connection. The default is -1 which is an infinite @@ -1092,7 +1073,7 @@ public class AjpProcessor extends Abstra // non-blocking writes. // TODO Validate the assertion above if (!responseFinished) { - if (ajpFlush) { + if (protocol.getAjpFlush()) { // Send the flush message socketWrapper.write(true, flushMessageArray, 0, flushMessageArray.length); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org