diff --git a/src/main/java/io/vertx/core/http/impl/VertxHttp2ConnectionHandler.java b/src/main/java/io/vertx/core/http/impl/VertxHttp2ConnectionHandler.java index 7588d1dfeb9..2d566444847 100644 --- a/src/main/java/io/vertx/core/http/impl/VertxHttp2ConnectionHandler.java +++ b/src/main/java/io/vertx/core/http/impl/VertxHttp2ConnectionHandler.java @@ -409,9 +409,6 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception connection.onHeadersRead(ctx, 1, frame.headers(), frame.padding(), frame.isEndStream()); } else if (msg instanceof Http2DataFrame) { Http2DataFrame frame = (Http2DataFrame) msg; - Http2LocalFlowController controller = decoder().flowController(); - Http2Stream stream = decoder().connection().stream(1); - controller.receiveFlowControlledFrame(stream, frame.content(), frame.padding(), frame.isEndStream()); connection.onDataRead(ctx, 1, frame.content(), frame.padding(), frame.isEndStream()); } } else { diff --git a/src/test/java/io/vertx/core/http/Http2WithUpgradeServerFileUploadTest.java b/src/test/java/io/vertx/core/http/Http2WithUpgradeServerFileUploadTest.java new file mode 100644 index 00000000000..17660b98831 --- /dev/null +++ b/src/test/java/io/vertx/core/http/Http2WithUpgradeServerFileUploadTest.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2011-2019 Contributors to the Eclipse Foundation + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 + * which is available at https://www.apache.org/licenses/LICENSE-2.0. + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 + */ +package io.vertx.core.http; + +/** + */ +public class Http2WithUpgradeServerFileUploadTest extends HttpServerFileUploadTest { + + @Override + protected HttpClientOptions createBaseClientOptions() { + return new HttpClientOptions() + .setProtocolVersion(HttpVersion.HTTP_2) + .setHttp2ClearTextUpgrade(true); + } + +} diff --git a/src/test/java/io/vertx/core/http/HttpServerFileUploadTest.java b/src/test/java/io/vertx/core/http/HttpServerFileUploadTest.java index e3caa77ee83..4552ee72a73 100644 --- a/src/test/java/io/vertx/core/http/HttpServerFileUploadTest.java +++ b/src/test/java/io/vertx/core/http/HttpServerFileUploadTest.java @@ -331,16 +331,12 @@ private void testFormUploadFile(String filename, "\r\n"; req.headers().set("content-length", "" + (pro + contentStr + epi).length()); req.headers().set("content-type", "multipart/form-data; boundary=" + boundary); - if (abortClient || cancelStream) { - Future fut = req.write(pro + contentStr.substring(0, contentStr.length() / 2)); - if (abortClient) { - fut.onComplete(onSuccess(v -> { - clientConn.set(req.connection()); - checkClose.run(); - })); - } - } else { - req.end(pro + contentStr + epi); + Future fut = req.end(pro + contentStr + epi); + if (abortClient) { + fut.onComplete(onSuccess(v -> { + clientConn.set(req.connection()); + checkClose.run(); + })); } if (abortClient) { req.response(onFailure(err -> complete()));