Skip to content

Commit

Permalink
Fix regression of client offloadNone() strategy
Browse files Browse the repository at this point in the history
Motivation:
The changes in apple#2108 introduced a regression in the handling of
computation of the effective strategy of a client when a
strategy `offloadNone()` (or the deprecated `offloadNever()`) was used
with the  `HttpClientBuilder`. Rather than preventing all offloading,
the computed offloading was used.
Modifications:
If the strategy specified on the `HttpClientBuilder` does not specify
any offloads then no offloading will be used.
Result:
The offloading behavior matches the requested behavior specified on
the  `HttpClientBuilder`.
  • Loading branch information
bondolo committed Jun 7, 2022
1 parent 5565f32 commit 1978ca7
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void add(StreamingHttpConnectionFilterFactory connectionFilter) {
}
}

HttpExecutionStrategy buildForClient(HttpExecutionStrategy transportStrategy) {
HttpExecutionStrategy buildForClient(HttpExecutionStrategy builderStrategy) {
HttpExecutionStrategy chainStrategy = clientChain;
if (null != connFilterChain) {
chainStrategy = null != chainStrategy ? chainStrategy.merge(connFilterChain) : connFilterChain;
Expand All @@ -132,9 +132,10 @@ HttpExecutionStrategy buildForClient(HttpExecutionStrategy transportStrategy) {
}

return (null == chainStrategy || !chainStrategy.hasOffloads()) ?
transportStrategy :
defaultStrategy() == transportStrategy || !transportStrategy.hasOffloads() ?
chainStrategy : chainStrategy.merge(transportStrategy);
builderStrategy :
defaultStrategy() == builderStrategy ?
chainStrategy : builderStrategy.hasOffloads() ?
chainStrategy.merge(builderStrategy) : builderStrategy;
}

ExecutionStrategy buildForConnectionFactory() {
Expand Down

0 comments on commit 1978ca7

Please sign in to comment.