Skip to content

Commit

Permalink
Merge pull request #45569 from geoand/rest-client-close
Browse files Browse the repository at this point in the history
Close stream when client responds with an entity
  • Loading branch information
geoand authored Jan 14, 2025
2 parents 25891df + 7841f90 commit 947988b
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 947988b

Please sign in to comment.