Skip to content

Commit

Permalink
Revert more stuff that'll land in main soon anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
nik9000 committed Sep 25, 2023
1 parent 339a0d5 commit fef0f3e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ public void dispatchRequest(final RestRequest request, final RestChannel channel
channel.sendResponse(
RestResponse.chunked(OK, ChunkedRestResponseBody.fromXContent(ignored -> Iterators.single((builder, params) -> {
throw new AssertionError("should not be called for HEAD REQUEST");
}), ToXContent.EMPTY_PARAMS, channel, null))
}), ToXContent.EMPTY_PARAMS, channel))
);
} catch (IOException e) {
throw new AssertionError(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public RestChunkedToXContentListener(RestChannel channel, ToXContent.Params para
@Override
protected void processResponse(Response response) throws IOException {
channel.sendResponse(
RestResponse.chunked(getRestStatus(response), ChunkedRestResponseBody.fromXContent(response, params, channel, null))
RestResponse.chunked(getRestStatus(response), ChunkedRestResponseBody.fromXContent(response, params, channel))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC
return channel -> client.admin().cluster().nodesHotThreads(nodesHotThreadsRequest, new RestResponseListener<>(channel) {
@Override
public RestResponse buildResponse(NodesHotThreadsResponse response) {
return RestResponse.chunked(RestStatus.OK, fromTextChunks(TEXT_CONTENT_TYPE, response.getTextChunks(), null));
return RestResponse.chunked(RestStatus.OK, fromTextChunks(TEXT_CONTENT_TYPE, response.getTextChunks()));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ public static RestResponse buildXContentBuilder(Table table, RestChannel channel
Iterators.single((builder, params) -> builder.endArray())
),
ToXContent.EMPTY_PARAMS,
channel,
null
channel
)
);
}
Expand Down Expand Up @@ -127,8 +126,7 @@ public static RestResponse buildTextPlainResponse(Table table, RestChannel chann
}
writer.append("\n");
})
),
null
)
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ public RestResponse buildResponse(NodesStatsResponse response) throws Exception
ChunkedToXContentHelper.endObject()
),
EMPTY_PARAMS,
channel,
null
channel
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void testWithHeaders() throws Exception {
public void testEmptyChunkedBody() {
RestResponse response = RestResponse.chunked(
RestStatus.OK,
ChunkedRestResponseBody.fromTextChunks(RestResponse.TEXT_CONTENT_TYPE, Collections.emptyIterator(), null)
ChunkedRestResponseBody.fromTextChunks(RestResponse.TEXT_CONTENT_TYPE, Collections.emptyIterator())
);
assertFalse(response.isChunked());
assertNotNull(response.content());
Expand Down

0 comments on commit fef0f3e

Please sign in to comment.