Skip to content

Commit

Permalink
No need to use response methods returning a Future, if not used (part…
Browse files Browse the repository at this point in the history
… II)
  • Loading branch information
franz1981 committed Nov 28, 2022
1 parent 5614878 commit 7c4165d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Buffer createBuffer(ByteBuf data) {

public void write(ByteBuf data, boolean last) throws IOException {
if (last && data == null) {
request.response().end();
request.response().end((Handler<AsyncResult<Void>>) null);
return;
}
//do all this in the same lock
Expand All @@ -104,9 +104,9 @@ public void write(ByteBuf data, boolean last) throws IOException {
data.release();
} else {
if (last) {
request.response().end(createBuffer(data));
request.response().end(createBuffer(data), null);
} else {
request.response().write(createBuffer(data));
request.response().write(createBuffer(data), null);
}
}
} catch (Exception e) {
Expand Down Expand Up @@ -160,9 +160,9 @@ public void handle(Void event) {
if (overflow != null) {
if (overflow.size() > 0) {
if (closed) {
request.response().end(Buffer.buffer(overflow.toByteArray()));
request.response().end(Buffer.buffer(overflow.toByteArray()), null);
} else {
request.response().write(Buffer.buffer(overflow.toByteArray()));
request.response().write(Buffer.buffer(overflow.toByteArray()), null);
}
overflow.reset();
}
Expand Down

0 comments on commit 7c4165d

Please sign in to comment.