Author: markt
Date: Thu May 21 09:04:45 2015
New Revision: 1680771
URL: http://svn.apache.org/r1680771
Log:
Rename swallowPayload() -> swallow() since it isn't just payloads
Modified:
tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1680771&r1=1680770&r2=1680771&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Thu May
21 09:04:45 2015
@@ -367,7 +367,7 @@ public class Http2UpgradeHandler extends
}
if (padLength > 0) {
- swallowPayload(padLength);
+ swallow(padLength);
}
// Process this stream on a container thread
@@ -544,15 +544,15 @@ public class Http2UpgradeHandler extends
// Swallow the payload
log.info("Swallowing [" + payloadSize + "] bytes of unknown frame type
[" + type +
"] from stream [" + streamId + "]");
- swallowPayload(payloadSize);
+ swallow(payloadSize);
}
- private void swallowPayload(int payloadSize) throws IOException {
+ private void swallow(int len) throws IOException {
int read = 0;
byte[] buffer = new byte[1024];
- while (read < payloadSize) {
- int toRead = Math.min(buffer.length, payloadSize - read);
+ while (read < len) {
+ int toRead = Math.min(buffer.length, len - read);
int thisTime = socketWrapper.read(true, buffer, 0, toRead);
if (thisTime == -1) {
throw new IOException("TODO: i18n");
@@ -603,7 +603,7 @@ public class Http2UpgradeHandler extends
int payloadSize = ByteUtil.getThreeBytes(frameHeader, 0);
if (payloadSize > remoteSettings.getMaxFrameSize()) {
- swallowPayload(payloadSize);
+ swallow(payloadSize);
throw new
Http2Exception(sm.getString("upgradeHandler.payloadTooBig",
Integer.toString(payloadSize),
Long.toString(remoteSettings.getMaxFrameSize())),
streamId, Http2Exception.FRAME_SIZE_ERROR);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]