Skip to content

Commit

Permalink
Swap order of new member in AddressPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
peckb1 committed Apr 24, 2024
1 parent a4befc3 commit c6a955f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions okhttp/api/okhttp.api
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ public final class okhttp3/ConnectionPool$AddressPolicy {
public final field maximumConcurrentCallsPerConnection I
public final field minimumConcurrentCalls I
public fun <init> ()V
public fun <init> (IIJI)V
public synthetic fun <init> (IIJIILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (IJII)V
public synthetic fun <init> (IJIIILkotlin/jvm/internal/DefaultConstructorMarker;)V
}

public final class okhttp3/ConnectionSpec {
Expand Down
9 changes: 4 additions & 5 deletions okhttp/src/main/kotlin/okhttp3/ConnectionPool.kt
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,14 @@ class ConnectionPool internal constructor(
* Connections will still be closed if they idle beyond the keep-alive but will be replaced.
*/
@JvmField val minimumConcurrentCalls: Int = 0,
/** How long to wait to retry pre-emptive connection attempts that fail. */
@JvmField val backoffDelayMillis: Long = 60 * 1000,
/** How much jitter to introduce in connection retry backoff delays */
@JvmField val backoffJitterMillis: Int = 100,
/**
* The maximum number of concurrent calls per connection.
*
* Set this value to 1 to disable HTTP/2 connection coalescing
*/
@JvmField val maximumConcurrentCallsPerConnection: Int = Int.MAX_VALUE,
/** How long to wait to retry pre-emptive connection attempts that fail. */
@JvmField val backoffDelayMillis: Long = 60 * 1000,
/** How much jitter to introduce in connection retry backoff delays */
@JvmField val backoffJitterMillis: Int = 100,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class RealConnection(
connection: Http2Connection,
settings: Settings,
) {
this.withLock {
this.withLock {
this.lastMaxConcurrentStreamsFromSettings = settings.getMaxConcurrentStreams()
recalculateAllocationLimit()
}
Expand All @@ -369,7 +369,7 @@ class RealConnection(
* made during settings changes
*/
internal fun recalculateAllocationLimit() {
this.withLock {
this.withLock {
val oldLimit = allocationLimit
allocationLimit = getMaximumAllocationLimit()

Expand Down Expand Up @@ -425,7 +425,7 @@ class RealConnection(
e: IOException?,
) {
var noNewExchangesEvent = false
this.withLock {
this.withLock {
if (e is StreamResetException) {
when {
e.errorCode == ErrorCode.REFUSED_STREAM -> {
Expand Down

0 comments on commit c6a955f

Please sign in to comment.