Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhatn committed Oct 4, 2023
1 parent c91e1f2 commit 63e6473
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,18 +398,25 @@ public void messageReceived(
) throws Exception {
FilterTransportChannel filterChannel = new FilterTransportChannel(channel) {
@Override
public void sendResponse(TransportResponse response) throws IOException {
ExchangeResponse exchangeResponse = (ExchangeResponse) response;
Page page = exchangeResponse.takePage();
public void sendResponse(TransportResponse transportResponse) throws IOException {
ExchangeResponse origResp = (ExchangeResponse) transportResponse;
Page page = origResp.takePage();
if (page != null) {
IntBlock block = page.getBlock(0);
for (int i = 0; i < block.getPositionCount(); i++) {
if (block.getInt(i) == disconnectOnSeqNo) {
page.releaseBlocks();
throw new IOException("page is too large");
}
}
}
super.sendResponse(response);
ExchangeResponse newResp = new ExchangeResponse(page, origResp.finished());
origResp.decRef();
while (origResp.hasReferences()) {
newResp.incRef();
origResp.decRef();
}
super.sendResponse(newResp);
}
};
handler.messageReceived(request, filterChannel, task);
Expand Down

0 comments on commit 63e6473

Please sign in to comment.