You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2019/04/16 08:03:15 UTC
[tomcat] branch master updated: Revert processing change
This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new c3c6686 Revert processing change
c3c6686 is described below
commit c3c66860b8e994584bdfb7dd62c219f53967792e
Author: remm <re...@apache.org>
AuthorDate: Tue Apr 16 10:03:02 2019 +0200
Revert processing change
The close refactoring is enough to ensure connections are properly
closed.
---
java/org/apache/coyote/http2/Http2AsyncParser.java | 8 +++++---
java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java b/java/org/apache/coyote/http2/Http2AsyncParser.java
index 448f3ce..2c764f8 100644
--- a/java/org/apache/coyote/http2/Http2AsyncParser.java
+++ b/java/org/apache/coyote/http2/Http2AsyncParser.java
@@ -31,14 +31,16 @@ import org.apache.tomcat.util.net.SocketWrapperBase.CompletionState;
class Http2AsyncParser extends Http2Parser {
private final SocketWrapperBase<?> socketWrapper;
+ private final Http2AsyncUpgradeHandler upgradeHandler;
private Throwable error = null;
private final ByteBuffer header;
private final ByteBuffer framePaylod;
- Http2AsyncParser(String connectionId, Input input, Output output, SocketWrapperBase<?> socketWrapper) {
+ Http2AsyncParser(String connectionId, Input input, Output output, SocketWrapperBase<?> socketWrapper, Http2AsyncUpgradeHandler upgradeHandler) {
super(connectionId, input, output);
this.socketWrapper = socketWrapper;
socketWrapper.getSocketBufferHandler().expand(input.getMaxFrameSize());
+ this.upgradeHandler = upgradeHandler;
header = ByteBuffer.allocate(9);
framePaylod = ByteBuffer.allocate(input.getMaxFrameSize());
}
@@ -226,7 +228,7 @@ class Http2AsyncParser extends Http2Parser {
if (state == CompletionState.DONE) {
// The call was not completed inline, so must start reading new frames
// or process the stream exception
- socketWrapper.processSocket(SocketEvent.OPEN_READ, false);
+ upgradeHandler.upgradeDispatch(SocketEvent.OPEN_READ);
}
}
@@ -238,7 +240,7 @@ class Http2AsyncParser extends Http2Parser {
log.debug(sm.getString("http2Parser.error", connectionId, Integer.valueOf(streamId), frameType), e);
}
if (state == null || state == CompletionState.DONE) {
- socketWrapper.processSocket(SocketEvent.ERROR, true);
+ upgradeHandler.upgradeDispatch(SocketEvent.ERROR);
}
}
diff --git a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
index de80eb1..f4559a3 100644
--- a/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java
@@ -69,7 +69,7 @@ public class Http2AsyncUpgradeHandler extends Http2UpgradeHandler {
@Override
protected Http2Parser getParser(String connectionId) {
- return new Http2AsyncParser(connectionId, this, this, socketWrapper);
+ return new Http2AsyncParser(connectionId, this, this, socketWrapper, this);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org