Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ public FormData parseBlocking() throws IOException {
} else {
throw UndertowMessages.MESSAGES.failedToAllocateResource();
}
} catch (MalformedMessageException e) {
throw new IOException(e);
}
return exchange.getAttachment(FORM_DATA);
}
Expand Down Expand Up @@ -323,15 +321,12 @@ public void data(final ByteBuffer buffer) throws IOException {
throw UndertowMessages.MESSAGES.maxFileSizeExceeded(this.maxIndividualFileSize);
}
if (file == null && fileSizeThreshold < this.currentFileSize && (fileName != null || this.currentFileSize > fieldSizeThreshold)) {
try {
createdFiles.add(createFile());
createdFiles.add(createFile());

FileOutputStream fileOutputStream = new FileOutputStream(file.toFile());
try(FileOutputStream fileOutputStream = new FileOutputStream(file.toFile());){
contentBytes.writeTo(fileOutputStream);

fileChannel = fileOutputStream.getChannel();
} catch (IOException e) {
throw new RuntimeException(e);
}
}

Expand Down
6 changes: 1 addition & 5 deletions core/src/main/java/io/undertow/util/MultipartParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,7 @@ public void handle(final PartHandler handler, final ByteBuffer rawData) throws I
try {
do {
buf.clear();
try {
decoder.decode(rawData, buf);
} catch (IOException e) {
throw new RuntimeException(e);
}
decoder.decode(rawData, buf);
buf.flip();
handler.data(buf);
} while (rawData.hasRemaining());
Expand Down
Loading