Repository: ktorio/ktor
File: ktor-client/ktor-client-okhttp/jvm/src/io/ktor/client/engine/okhttp/OkHttpConfig.kt (Kotlin)

Code before:

    /**
     * Specifies the size of cache that keeps recently used [OkHttpClient] instances.
     * Set this property to `0` to disable caching.
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.clientCacheSize)
     */
    public var clientCacheSize: Int = 10

    /**
     * Specifies the [WebSocket.Factory] used to create a [WebSocket] instance.
     * Otherwise, [OkHttpClient] is used directly.
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.webSocketFactory)
     */
    public var webSocketFactory: WebSocket.Factory? = null

    /**
     * Specifies if duplex streaming is enabled for the OkHttp client.
     * Setting this to `true` allows clients to send and receive data simultaneously
     * using bidirectional streaming.
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.getDuplexStreamingEnabled)
     *
     * @see [okhttp3.RequestBody.isDuplex]
     */
    public var duplexStreamingEnabled: Boolean = false

    /**
     * Configures [OkHttpClient] using [OkHttpClient.Builder].
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.config)
     */
    public fun config(block: OkHttpClient.Builder.() -> Unit) {
        val oldConfig = config
        config = {
            oldConfig()
            block()
        }
    }

    /**
     * Adds an [Interceptor] to the [OkHttp] client.
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.addInterceptor)
     */
    public fun addInterceptor(interceptor: Interceptor) {
        config {
            addInterceptor(interceptor)
        }
    }

Review comment (suggestion):
Minor. Let's use a variant with the updated `Report a problem` link and comment `(HTTP/2 only)`:
```
/**
 * Specifies if duplex streaming is enabled for the [OkHttpClient].
 * Setting this to `true` allows clients to send and receive data simultaneously
 * using bidirectional streaming (HTTP/2 only).
 *
 * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.duplexStreamingEnabled)
 *
 * @see [okhttp3.RequestBody.isDuplex]
 */
     ```

Code after:

    /**
     * Specifies the size of cache that keeps recently used [OkHttpClient] instances.
     * Set this property to `0` to disable caching.
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.clientCacheSize)
     */
    public var clientCacheSize: Int = 10

    /**
     * Specifies the [WebSocket.Factory] used to create a [WebSocket] instance.
     * Otherwise, [OkHttpClient] is used directly.
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.webSocketFactory)
     */
    public var webSocketFactory: WebSocket.Factory? = null

    /**
     * Specifies if duplex streaming is enabled for the [OkHttpClient].
     * Setting this to `true` allows clients to send and receive data simultaneously
     * using bidirectional streaming (HTTP/2 only).
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.duplexStreamingEnabled)
     *
     * @see [okhttp3.RequestBody.isDuplex]
     */
    public var duplexStreamingEnabled: Boolean = false

    /**
     * Configures [OkHttpClient] using [OkHttpClient.Builder].
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.config)
     */
    public fun config(block: OkHttpClient.Builder.() -> Unit) {
        val oldConfig = config
        config = {
            oldConfig()
            block()
        }
    }

    /**
     * Adds an [Interceptor] to the [OkHttp] client.
     *
     * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.engine.okhttp.OkHttpConfig.addInterceptor)
     */
    public fun addInterceptor(interceptor: Interceptor) {
        config {
            addInterceptor(interceptor)
        }
    }