Skip to content

Commit

Permalink
Close stream when client responds with an entity
Browse files Browse the repository at this point in the history
This shouldn't have an effect given the type of
buffers we currently use, but if we change things
in the future, this call will be necessary
  • Loading branch information
geoand committed Jan 14, 2025
1 parent 90dd16b commit 7841f90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ public static ResponseImpl mapToResponse(RestClientRequestContext context,
if (entity != null) {
builder.entity(entity);
}
if (entity != null) {
entityStream.close();
}
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public void handle(AsyncResult<Buffer> ar) {
try {
if (buffer.length() > 0) {
requestContext.setResponseEntityStream(
new ByteBufInputStream(buffer.getByteBuf()));
new ByteBufInputStream(buffer.getByteBuf(), true));
} else {
requestContext.setResponseEntityStream(null);
}
Expand Down

0 comments on commit 7841f90

Please sign in to comment.