package 㿎;

import java.io.IOException;
import java.util.ArrayList;
import 㿎.C2531;
import 㿎.ሽ.AbstractRunnableC2561;
import 㿎.ሽ.ඓ.C2547;
import 㿎.ሽ.ඓ.C2548;
import 㿎.ሽ.ᨨ.C2558;
import 㿎.ሽ.㴹.C2579;
import 㿎.ሽ.㴹.C2582;
import 㿎.ሽ.㴹.C2583;
import 㿎.ሽ.㴹.C2586;
import 㿎.ሽ.㸾.C2589;

/* renamed from: 㿎.ゎ  reason: contains not printable characters */
/* compiled from: RealCall */
public final class C2642 implements AbstractC2537 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final C2586 f8974;

    /* renamed from: ඓ  reason: contains not printable characters */
    public final C2644 f8975;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final C2625 f8976;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public boolean f8977;

    /* renamed from: 㴹  reason: contains not printable characters */
    public final boolean f8978;

    /* renamed from: 㸾  reason: contains not printable characters */
    public AbstractC2533 f8979;

    /* renamed from: 㿎.ゎ$K  reason: contains not printable characters */
    /* compiled from: RealCall */
    public final class C2643 extends AbstractRunnableC2561 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final AbstractC2660 f8980;

        public C2643(AbstractC2660 r4) {
            super("OkHttp %s", C2642.this.m6954());
            this.f8980 = r4;
        }

        /* JADX WARNING: Removed duplicated region for block: B:14:0x0033 A[SYNTHETIC, Splitter:B:14:0x0033] */
        /* JADX WARNING: Removed duplicated region for block: B:16:0x0051 A[Catch:{ all -> 0x002d }] */
        @Override // 㿎.ሽ.AbstractRunnableC2561
        /* renamed from: K  reason: contains not printable characters */
        public void m6960() {
            boolean z;
            IOException e;
            try {
                C2671 r1 = C2642.this.m6953();
                if (C2642.this.f8974.f8705) {
                    try {
                        this.f8980.onFailure(C2642.this, new IOException("Canceled"));
                    } catch (IOException e2) {
                        e = e2;
                        z = true;
                        if (!z) {
                            try {
                                C2558 r2 = C2558.f8643;
                                r2.m6731(4, "Callback failure for " + C2642.this.m6958(), e);
                            } catch (Throwable th) {
                                C2530 r22 = C2642.this.f8976.f8886;
                                r22.m6579(r22.f8532, this, true);
                                throw th;
                            }
                        } else {
                            C2642.this.f8979.m6616();
                            this.f8980.onFailure(C2642.this, e);
                        }
                        C2530 r12 = C2642.this.f8976.f8886;
                        r12.m6579(r12.f8532, this, true);
                    }
                } else {
                    this.f8980.onResponse(C2642.this, r1);
                }
            } catch (IOException e3) {
                e = e3;
                z = false;
                if (!z) {
                }
                C2530 r122 = C2642.this.f8976.f8886;
                r122.m6579(r122.f8532, this, true);
            }
            C2530 r1222 = C2642.this.f8976.f8886;
            r1222.m6579(r1222.f8532, this, true);
        }
    }

    public C2642(C2625 r1, C2644 r2, boolean z) {
        this.f8976 = r1;
        this.f8975 = r2;
        this.f8978 = z;
        this.f8974 = new C2586(r1, z);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C2642 m6952(C2625 r1, C2644 r2, boolean z) {
        C2642 r0 = new C2642(r1, r2, z);
        r0.f8979 = ((C2629) r1.f8899).f8935;
        return r0;
    }

    @Override // java.lang.Object
    public Object clone() throws CloneNotSupportedException {
        return m6952(this.f8976, this.f8975, this.f8978);
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public C2671 m6953() throws IOException {
        ArrayList arrayList = new ArrayList();
        arrayList.addAll(this.f8976.f8896);
        arrayList.add(this.f8974);
        arrayList.add(new C2582(this.f8976.f8894));
        this.f8976.m6919();
        arrayList.add(new C2589());
        arrayList.add(new C2547(this.f8976));
        if (!this.f8978) {
            arrayList.addAll(this.f8976.f8887);
        }
        arrayList.add(new C2579(this.f8978));
        C2644 r6 = this.f8975;
        AbstractC2533 r8 = this.f8979;
        C2625 r0 = this.f8976;
        return new C2583(arrayList, null, null, null, 0, r6, this, r8, r0.f8881, r0.f8888, r0.f8889).m6789(this.f8975);
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public String m6954() {
        C2531.C2532 r0 = this.f8975.f8985.m6598("/...");
        r0.m6602("");
        r0.f8544 = C2531.m6587("", " \"':;<=>@[]^`{}|/\\?#", false, false, false, true);
        return r0.m6607().f8537;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public C2671 m6955() throws IOException {
        synchronized (this) {
            if (!this.f8977) {
                this.f8977 = true;
            } else {
                throw new IllegalStateException("Already Executed");
            }
        }
        this.f8974.f8708 = C2558.f8643.m6728("response.body().close()");
        this.f8979.m6608();
        try {
            this.f8976.f8886.m6581(this);
            C2671 r1 = m6953();
            if (r1 != null) {
                C2530 r2 = this.f8976.f8886;
                r2.m6579(r2.f8530, this, false);
                return r1;
            }
            throw new IOException("Canceled");
        } catch (IOException e) {
            this.f8979.m6616();
            throw e;
        } catch (Throwable th) {
            C2530 r22 = this.f8976.f8886;
            r22.m6579(r22.f8530, this, false);
            throw th;
        }
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public String m6958() {
        StringBuilder sb = new StringBuilder();
        sb.append(m6959() ? "canceled " : "");
        sb.append(this.f8978 ? "web socket" : "call");
        sb.append(" to ");
        sb.append(m6954());
        return sb.toString();
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean m6959() {
        return this.f8974.f8705;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m6957(AbstractC2660 r3) {
        synchronized (this) {
            if (!this.f8977) {
                this.f8977 = true;
            } else {
                throw new IllegalStateException("Already Executed");
            }
        }
        this.f8974.f8708 = C2558.f8643.m6728("response.body().close()");
        this.f8979.m6608();
        this.f8976.f8886.m6580(new C2643(r3));
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m6956() {
        C2586 r0 = this.f8974;
        r0.f8705 = true;
        C2548 r02 = r0.f8704;
        if (r02 != null) {
            r02.m6683();
        }
    }
}
