Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
yschimke committed Oct 5, 2025
commit 2dfddae5d04fc4b54f55d2c7811e66e4e9529dbe
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RealInterceptorChain constructor(
internal val connectTimeoutMillis: Int,
internal val readTimeoutMillis: Int,
internal val writeTimeoutMillis: Int,
internal val clientOverrides: ClientOverrides?
internal val clientOverrides: ClientOverrides?,
) : Interceptor.Chain {
private var calls: Int = 0

Expand Down Expand Up @@ -108,17 +108,15 @@ class RealInterceptorChain constructor(
return copy(writeTimeoutMillis = checkDuration("writeTimeout", timeout.toLong(), unit))
}

override fun withDns(dns: Dns?): Interceptor.Chain {
return withClientOverrides {
override fun withDns(dns: Dns?): Interceptor.Chain =
withClientOverrides {
copy(dns = dns)
}
}

override fun withSocketFactory(socketFactory: SocketFactory?): Interceptor.Chain {
return withClientOverrides {
override fun withSocketFactory(socketFactory: SocketFactory?): Interceptor.Chain =
withClientOverrides {
copy(socketFactory = socketFactory)
}
}

private fun withClientOverrides(overrides: ClientOverrides.() -> ClientOverrides): Interceptor.Chain {
check(exchange == null) { "ClientOverrides can't be adjusted in a network interceptor" }
Expand Down
Loading