diff --git a/src/main/java/io/vertx/core/http/impl/HttpServerFileUploadImpl.java b/src/main/java/io/vertx/core/http/impl/HttpServerFileUploadImpl.java index 10e952f57b6..b30f1a6ad69 100644 --- a/src/main/java/io/vertx/core/http/impl/HttpServerFileUploadImpl.java +++ b/src/main/java/io/vertx/core/http/impl/HttpServerFileUploadImpl.java @@ -63,6 +63,7 @@ class HttpServerFileUploadImpl implements HttpServerFileUpload { this.charset = charset; this.size = size; this.pending = new InboundBuffer(context) + .drainHandler(v -> req.resume()) .emptyHandler(v -> { if (complete) { handleComplete(); diff --git a/src/test/java/io/vertx/core/http/HttpTest.java b/src/test/java/io/vertx/core/http/HttpTest.java index d75c683749a..0bd5090a6ea 100644 --- a/src/test/java/io/vertx/core/http/HttpTest.java +++ b/src/test/java/io/vertx/core/http/HttpTest.java @@ -2733,18 +2733,28 @@ public void testFormUploadSmallFile() throws Exception { } @Test - public void testFormUploadLargerFile() throws Exception { + public void testFormUploadMediumFile() throws Exception { testFormUploadFile(TestUtils.randomAlphaString(20000), false); } + @Test + public void testFormUploadLargeFile() throws Exception { + testFormUploadFile(TestUtils.randomAlphaString(4 * 1024 * 1024), false); + } + @Test public void testFormUploadSmallFileStreamToDisk() throws Exception { testFormUploadFile(TestUtils.randomAlphaString(100), true); } @Test - public void testFormUploadLargerFileStreamToDisk() throws Exception { - testFormUploadFile(TestUtils.randomAlphaString(20000), true); + public void testFormUploadMediumFileStreamToDisk() throws Exception { + testFormUploadFile(TestUtils.randomAlphaString(20 * 1024), true); + } + + @Test + public void testFormUploadLargeFileStreamToDisk() throws Exception { + testFormUploadFile(TestUtils.randomAlphaString(4 * 1024 * 1024), true); } private void testFormUploadFile(String contentStr, boolean streamToDisk) throws Exception {