Skip to content

Commit

Permalink
Issue #8885 - Restore HttpChannel.Listener
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed May 22, 2023
1 parent d75eba4 commit 1a10be7
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1168,9 +1168,10 @@ else if (contentLength >= 0)
else if (failure != null)
{
Throwable throwable = failure;
ByteBuffer slice = content != null ? content.slice() : BufferUtil.EMPTY_BUFFER;
httpChannelState._serializedInvoker.run(() ->
{
_listener.onResponseWrite(_request, last, content.slice(), throwable);
_listener.onResponseWrite(_request, last, slice, throwable);
callback.failed(throwable);
});
}
Expand All @@ -1192,10 +1193,10 @@ else if (failure != null)
{
if (LOG.isDebugEnabled())
LOG.debug("writing last={} {} {}", last, BufferUtil.toDetailString(content), this);
ByteBuffer contentSlice = content.slice();
ByteBuffer slice = content != null ? content.slice() : BufferUtil.EMPTY_BUFFER;
Callback listenerCallback = Callback.from(() ->
{
_listener.onResponseWrite(_request, last, contentSlice, null);
_listener.onResponseWrite(_request, last, slice, null);
}, this);
stream.send(_request._metaData, responseMetaData, last, content, listenerCallback);
}
Expand Down

0 comments on commit 1a10be7

Please sign in to comment.