reta commented on code in PR #3645:
URL: https://github.com/apache/cxf/pull/3645#discussion_r4418093889
##########
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java:
##########
@@ -1614,18 +1616,43 @@ private int getMaxRetransmits() {
* @throws IOException
*/
protected void handleResponse() throws IOException {
- // Process retransmits until we fall out.
- handleRetransmits();
-
- if (outMessage == null
- || outMessage.getExchange() == null
- || outMessage.getExchange().isSynchronous()) {
+ if (isSynchronous()) {
+ // Process retransmits until we fall out.
+ handleRetransmits();
handleResponseInternal();
} else {
+ // the retransmits wait for the response, so they are
processed with it,
+ // not to block the caller thread
handleResponseAsync();
}
}
+ private boolean isSynchronous() {
+ return outMessage == null
+ || outMessage.getExchange() == null
+ || outMessage.getExchange().isSynchronous();
+ }
+
+ /**
+ * Processes the retransmits, if any, and then the response of an
asynchronous exchange,
+ * on the thread that handles the response.
+ */
+ private void handleRetransmitsAndResponse() throws IOException {
Review Comment:
Sorry @ffang , taking me longer to figure out what is going on, so we have
now `handleResponse` and `handleRetransmitsAndResponse`, both do call
`handleRetransmits` but their behavior diverges, I am trying to reconstruct the
flows so we could make it less confusing, thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]