Prevent hung uploads in MultipartParser

This commit adds an onRequest() hook to request more data from
the source in order to avoid hung uploads in MultipartParser.

Closes gh-34388
Signed-off-by: Gang Cheng <chenggangpro@gmail.com>
This commit is contained in:
Gang Cheng
2025-02-08 12:01:25 +08:00
committed by Sébastien Deleuze
parent f45a08d4f5
commit 4606337180

View File

@@ -100,6 +100,7 @@ final class MultipartParser extends BaseSubscriber<DataBuffer> {
return Flux.create(sink -> {
MultipartParser parser = new MultipartParser(sink, boundary, maxHeadersSize, headersCharset);
sink.onCancel(parser::onSinkCancel);
sink.onRequest(l -> parser.requestBuffer());
buffers.subscribe(parser);
});
}