package okhttp3.internal.http1;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\u0018\u0000 \r2\u00020\u0001:\u0001\rB\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0006\u0010\t\u001a\u00020\nJ\u0006\u0010\u000b\u001a\u00020\fR\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\b¨\u0006\u000e"}, d2 = {"Lokhttp3/internal/http1/HeadersReader;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "source", "Lokio/BufferedSource;", "(Lokio/BufferedSource;)V", "headerLimit", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "getSource", "()Lokio/BufferedSource;", "readHeaders", "Lokhttp3/Headers;", "readLine", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Companion", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class HeadersReader {
    private static final int HEADER_LIMIT = 262144;
    private long headerLimit;

    @org.jetbrains.annotations.NotNull
    private final okio.BufferedSource source;

    public HeadersReader(@org.jetbrains.annotations.NotNull okio.BufferedSource bufferedSource) {
        kotlin.jvm.internal.Intrinsics.l(bufferedSource, "source");
        this.source = bufferedSource;
        this.headerLimit = 262144L;
    }

    @org.jetbrains.annotations.NotNull
    public final okio.BufferedSource getSource() {
        return this.source;
    }

    @org.jetbrains.annotations.NotNull
    public final okhttp3.Headers readHeaders() {
        okhttp3.Headers.Builder builder = new okhttp3.Headers.Builder();
        while (true) {
            java.lang.String line = readLine();
            if (line.length() == 0) {
                return builder.build();
            }
            builder.addLenient$okhttp(line);
        }
    }

    @org.jetbrains.annotations.NotNull
    public final java.lang.String readLine() {
        java.lang.String strW1 = this.source.w1(this.headerLimit);
        this.headerLimit -= (long) strW1.length();
        return strW1;
    }
}
