responseContent() remove excess ByteBufFlux conversion#2792
Merged
violetagg merged 6 commits intoreactor:mainfrom May 5, 2023
Merged
responseContent() remove excess ByteBufFlux conversion#2792violetagg merged 6 commits intoreactor:mainfrom
responseContent() remove excess ByteBufFlux conversion#2792violetagg merged 6 commits intoreactor:mainfrom
Conversation
…xcess ByteBufFlux conversion
…xcess ByteBufFlux conversion
…xcess ByteBufFlux conversion
Member
|
@manzhizhen Please use |
Contributor
Author
ok, I do it. |
…xcess ByteBufFlux conversion
Member
|
The failed test on CI for Windows OS is not relevant as it is in |
Contributor
Author
Okay, get it |
violetagg
reviewed
May 4, 2023
reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientFinalizer.java
Show resolved
Hide resolved
added 2 commits
May 4, 2023 22:15
…xcess ByteBufFlux conversion, preserve the contentReceiver constant
…xcess ByteBufFlux conversion, preserve the contentReceiver constant
violetagg
approved these changes
May 4, 2023
responseContent() remove excess ByteBufFlux conversion
violetagg
added a commit
that referenced
this pull request
May 5, 2023
violetagg
pushed a commit
that referenced
this pull request
May 5, 2023
Member
|
@manzhizhen Thanks for the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When I looked at the implementation of the class HttpClientFinalizer code, I found that the logic of the responseContent method was a bit strange. HttpClientFinalizer.contentReceiver represents ChannelOperations::receive, while ChannelOperations::receive internal implementation has already made a call to ByteBufFlux.fromInbound to return a ByteBufFlux, and a call and encapsulation of ByteBufFlux.fromInbound has also been made in the responseContent method, This is actually unnecessary, so you can directly refer to the internal implementation of ChannelOperations::receive in the responseContent method to generate ByteBufFlux, which will result in better performance and clearer logic. Similarly, there are similar issues with WebsocketFinalizer:responseContent, which is why this PR.