导航菜单

页面标题

页面副标题

Namma Yatri v3.3.7 - i.java 源代码

正在查看: Namma Yatri v3.3.7 应用的 i.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package Mc;

import Mc.b;
import Mc.f;
import Mc.h;
import Mc.j;
import Mc.r;
import Oc.b;
import Pc.a;
import Pc.b;
import Sd.C0187e;
import Sd.C0190h;
import Sd.InterfaceC0188f;
import Sd.InterfaceC0189g;
import Sd.L;
import Sd.a0;
import Sd.b0;
import io.grpc.AbstractC0799k;
import io.grpc.C;
import io.grpc.C0736a;
import io.grpc.C0738c;
import io.grpc.D;
import io.grpc.E;
import io.grpc.K;
import io.grpc.Z;
import io.grpc.a0;
import io.grpc.i0;
import io.grpc.internal.C0757d0;
import io.grpc.internal.InterfaceC0773l0;
import io.grpc.internal.InterfaceC0785s;
import io.grpc.internal.InterfaceC0787t;
import io.grpc.internal.InterfaceC0793w;
import io.grpc.internal.J0;
import io.grpc.internal.O0;
import io.grpc.internal.Q;
import io.grpc.internal.S;
import io.grpc.internal.U0;
import io.grpc.internal.W;
import io.grpc.internal.X;
import io.grpc.p0;
import io.grpc.q0;
import java.io.EOFException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URI;
import java.util.Collections;
import java.util.Deque;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.SocketFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import t8.t;
import t8.v;

class i implements InterfaceC0793w, b.a, r.d {
    private static final Map W = R();
    private static final Logger X = Logger.getLogger(i.class.getName());
    private final SocketFactory A;
    private SSLSocketFactory B;
    private HostnameVerifier C;
    private Socket D;
    private int E;
    private final Deque F;
    private final Nc.b G;
    private C0757d0 H;
    private boolean I;
    private long J;
    private long K;
    private boolean L;
    private final Runnable M;
    private final int N;
    private final boolean O;
    private final U0 P;
    private final X Q;
    private E.b R;
    final D S;
    int T;
    Runnable U;
    com.google.common.util.concurrent.l V;
    private final InetSocketAddress a;
    private final String b;
    private final String c;
    private final Random d;
    private final v e;
    private final int f;
    private final Oc.j g;
    private InterfaceC0773l0.a h;
    private Mc.b i;
    private r j;
    private final Object k;
    private final K l;
    private int m;
    private final Map n;
    private final Executor o;
    private final J0 p;
    private final ScheduledExecutorService q;
    private final int r;
    private int s;
    private e t;
    private C0736a u;
    private p0 v;
    private boolean w;
    private W x;
    private boolean y;
    private boolean z;

    class a extends X {
        a() {
        }

        @Override
        protected void b() {
            i.this.h.c(true);
        }

        @Override
        protected void c() {
            i.this.h.c(false);
        }
    }

    class b implements U0.c {
        b() {
        }
    }

    class d implements Runnable {
        d() {
        }

        @Override
        public void run() {
            Runnable runnable = i.this.U;
            if (runnable != null) {
                runnable.run();
            }
            i.this.o.execute(i.this.t);
            synchronized (i.this.k) {
                i.this.E = Integer.MAX_VALUE;
                i.this.l0();
            }
            com.google.common.util.concurrent.l lVar = i.this.V;
            if (lVar != null) {
                lVar.x((Object) null);
            }
        }
    }

    public i(f.C0023f c0023f, InetSocketAddress inetSocketAddress, String str, String str2, C0736a c0736a, D d2, Runnable runnable) {
        this(c0023f, inetSocketAddress, str, str2, c0736a, S.w, new Oc.g(), d2, runnable);
    }

    static int E(i iVar, int i) {
        int i2 = iVar.s + i;
        iVar.s = i2;
        return i2;
    }

    private static Map R() {
        EnumMap enumMap = new EnumMap(Oc.a.class);
        Oc.a aVar = Oc.a.NO_ERROR;
        p0 p0Var = p0.s;
        enumMap.put((EnumMap) aVar, (Oc.a) p0Var.r("No error: A GRPC status of OK should have been sent"));
        enumMap.put((EnumMap) Oc.a.PROTOCOL_ERROR, (Oc.a) p0Var.r("Protocol error"));
        enumMap.put((EnumMap) Oc.a.INTERNAL_ERROR, (Oc.a) p0Var.r("Internal error"));
        enumMap.put((EnumMap) Oc.a.FLOW_CONTROL_ERROR, (Oc.a) p0Var.r("Flow control error"));
        enumMap.put((EnumMap) Oc.a.STREAM_CLOSED, (Oc.a) p0Var.r("Stream closed"));
        enumMap.put((EnumMap) Oc.a.FRAME_TOO_LARGE, (Oc.a) p0Var.r("Frame too large"));
        enumMap.put((EnumMap) Oc.a.REFUSED_STREAM, (Oc.a) p0.t.r("Refused stream"));
        enumMap.put((EnumMap) Oc.a.CANCEL, (Oc.a) p0.f.r("Cancelled"));
        enumMap.put((EnumMap) Oc.a.COMPRESSION_ERROR, (Oc.a) p0Var.r("Compression error"));
        enumMap.put((EnumMap) Oc.a.CONNECT_ERROR, (Oc.a) p0Var.r("Connect error"));
        enumMap.put((EnumMap) Oc.a.ENHANCE_YOUR_CALM, (Oc.a) p0.n.r("Enhance your calm"));
        enumMap.put((EnumMap) Oc.a.INADEQUATE_SECURITY, (Oc.a) p0.l.r("Inadequate security"));
        return Collections.unmodifiableMap(enumMap);
    }

    private Pc.b S(InetSocketAddress inetSocketAddress, String str, String str2) {
        Pc.a a2 = new a.b().k("https").h(inetSocketAddress.getHostName()).j(inetSocketAddress.getPort()).a();
        b.C0029b d2 = new b.C0029b().e(a2).d("Host", a2.c() + ":" + a2.f()).d("User-Agent", this.c);
        if (str != null && str2 != null) {
            d2.d("Proxy-Authorization", Nc.c.a(str, str2));
        }
        return d2.c();
    }

    public Socket T(InetSocketAddress inetSocketAddress, InetSocketAddress inetSocketAddress2, String str, String str2) {
        Socket socket = null;
        try {
            socket = inetSocketAddress2.getAddress() != null ? this.A.createSocket(inetSocketAddress2.getAddress(), inetSocketAddress2.getPort()) : this.A.createSocket(inetSocketAddress2.getHostName(), inetSocketAddress2.getPort());
            socket.setTcpNoDelay(true);
            socket.setSoTimeout(this.T);
            a0 m = L.m(socket);
            InterfaceC0188f c2 = L.c(L.i(socket));
            Pc.b S = S(inetSocketAddress, str, str2);
            Pc.a b2 = S.b();
            c2.h0(String.format(Locale.US, "CONNECT %s:%d HTTP/1.1", b2.c(), Integer.valueOf(b2.f()))).h0("\r\n");
            int b3 = S.a().b();
            for (int i = 0; i < b3; i++) {
                c2.h0(S.a().a(i)).h0(": ").h0(S.a().c(i)).h0("\r\n");
            }
            c2.h0("\r\n");
            c2.flush();
            Nc.j a2 = Nc.j.a(g0(m));
            while (!g0(m).equals("")) {
            }
            int i2 = a2.b;
            if (i2 >= 200 && i2 < 300) {
                socket.setSoTimeout(0);
                return socket;
            }
            C0187e c0187e = new C0187e();
            try {
                socket.shutdownOutput();
                m.R1(c0187e, 1024L);
            } catch (IOException e2) {
                c0187e.h0("Unable to read body: " + e2.toString());
            }
            try {
                socket.close();
            } catch (IOException unused) {
            }
            throw p0.t.r(String.format(Locale.US, "Response returned from proxy was not successful (expected 2xx, got %d %s). Response body:\n%s", Integer.valueOf(a2.b), a2.c, c0187e.N1())).c();
        } catch (IOException e3) {
            if (socket != null) {
                S.f(socket);
            }
            throw p0.t.r("Failed trying to connect with proxy").q(e3).c();
        }
    }

    private Throwable Y() {
        synchronized (this.k) {
            try {
                p0 p0Var = this.v;
                if (p0Var != null) {
                    return p0Var.c();
                }
                return p0.t.r("Connection closed").c();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private void a0() {
        synchronized (this.k) {
            this.P.g(new b());
        }
    }

    private void d0(h hVar) {
        if (this.z && this.F.isEmpty() && this.n.isEmpty()) {
            this.z = false;
            C0757d0 c0757d0 = this.H;
            if (c0757d0 != null) {
                c0757d0.p();
            }
        }
        if (hVar.z()) {
            this.Q.e(hVar, false);
        }
    }

    public void f0(Oc.a aVar, String str) {
        k0(0, aVar, p0(aVar).f(str));
    }

    private static String g0(a0 a0Var) {
        C0187e c0187e = new C0187e();
        while (a0Var.R1(c0187e, 1L) != -1) {
            if (c0187e.E1(c0187e.o2() - 1) == 10) {
                return c0187e.u0();
            }
        }
        throw new EOFException("\\n not found: " + c0187e.k2().p());
    }

    private void i0() {
        synchronized (this.k) {
            try {
                this.i.M();
                Oc.i iVar = new Oc.i();
                n.c(iVar, 7, this.f);
                this.i.J1(iVar);
                if (this.f > 65535) {
                    this.i.b(0, r1 - 65535);
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    private void j0(h hVar) {
        if (!this.z) {
            this.z = true;
            C0757d0 c0757d0 = this.H;
            if (c0757d0 != null) {
                c0757d0.o();
            }
        }
        if (hVar.z()) {
            this.Q.e(hVar, true);
        }
    }

    public void k0(int i, Oc.a aVar, p0 p0Var) {
        synchronized (this.k) {
            try {
                if (this.v == null) {
                    this.v = p0Var;
                    this.h.a(p0Var);
                }
                if (aVar != null && !this.w) {
                    this.w = true;
                    this.i.s0(0, aVar, new byte[0]);
                }
                Iterator it = this.n.entrySet().iterator();
                while (it.hasNext()) {
                    Map.Entry entry = (Map.Entry) it.next();
                    if (((Integer) entry.getKey()).intValue() > i) {
                        it.remove();
                        ((h) entry.getValue()).A().M(p0Var, InterfaceC0785s.a.REFUSED, false, new Z());
                        d0((h) entry.getValue());
                    }
                }
                for (h hVar : this.F) {
                    hVar.A().M(p0Var, InterfaceC0785s.a.MISCARRIED, true, new Z());
                    d0(hVar);
                }
                this.F.clear();
                n0();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public boolean l0() {
        boolean z = false;
        while (!this.F.isEmpty() && this.n.size() < this.E) {
            m0((h) this.F.poll());
            z = true;
        }
        return z;
    }

    private void m0(h hVar) {
        t8.o.v(hVar.A().c0() == -1, "StreamId already assigned");
        this.n.put(Integer.valueOf(this.m), hVar);
        j0(hVar);
        hVar.A().f0(this.m);
        if ((hVar.N() != a0.d.UNARY && hVar.N() != a0.d.SERVER_STREAMING) || hVar.P()) {
            this.i.flush();
        }
        int i = this.m;
        if (i < 2147483645) {
            this.m = i + 2;
        } else {
            this.m = Integer.MAX_VALUE;
            k0(Integer.MAX_VALUE, Oc.a.NO_ERROR, p0.t.r("Stream ids exhausted"));
        }
    }

    private void n0() {
        if (this.v == null || !this.n.isEmpty() || !this.F.isEmpty() || this.y) {
            return;
        }
        this.y = true;
        C0757d0 c0757d0 = this.H;
        if (c0757d0 != null) {
            c0757d0.r();
        }
        W w = this.x;
        if (w != null) {
            w.f(Y());
            this.x = null;
        }
        if (!this.w) {
            this.w = true;
            this.i.s0(0, Oc.a.NO_ERROR, new byte[0]);
        }
        this.i.close();
    }

    static p0 p0(Oc.a aVar) {
        p0 p0Var = (p0) W.get(aVar);
        if (p0Var != null) {
            return p0Var;
        }
        return p0.g.r("Unknown http2 error code: " + aVar.a);
    }

    void U(boolean z, long j, long j2, boolean z2) {
        this.I = z;
        this.J = j;
        this.K = j2;
        this.L = z2;
    }

    void V(int i, p0 p0Var, InterfaceC0785s.a aVar, boolean z, Oc.a aVar2, Z z2) {
        synchronized (this.k) {
            try {
                h hVar = (h) this.n.remove(Integer.valueOf(i));
                if (hVar != null) {
                    if (aVar2 != null) {
                        this.i.w(i, Oc.a.CANCEL);
                    }
                    if (p0Var != null) {
                        h.b A = hVar.A();
                        if (z2 == null) {
                            z2 = new Z();
                        }
                        A.M(p0Var, aVar, z, z2);
                    }
                    if (!l0()) {
                        n0();
                        d0(hVar);
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    String W() {
        URI c2 = S.c(this.b);
        return c2.getHost() != null ? c2.getHost() : this.b;
    }

    int X() {
        URI c2 = S.c(this.b);
        return c2.getPort() != -1 ? c2.getPort() : this.a.getPort();
    }

    h Z(int i) {
        h hVar;
        synchronized (this.k) {
            hVar = (h) this.n.get(Integer.valueOf(i));
        }
        return hVar;
    }

    @Override
    public r.c[] a() {
        r.c[] cVarArr;
        synchronized (this.k) {
            try {
                cVarArr = new r.c[this.n.size()];
                Iterator it = this.n.values().iterator();
                int i = 0;
                while (it.hasNext()) {
                    cVarArr[i] = ((h) it.next()).A().b0();
                    i++;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return cVarArr;
    }

    @Override
    public void b(p0 p0Var) {
        f(p0Var);
        synchronized (this.k) {
            try {
                Iterator it = this.n.entrySet().iterator();
                while (it.hasNext()) {
                    Map.Entry entry = (Map.Entry) it.next();
                    it.remove();
                    ((h) entry.getValue()).A().N(p0Var, false, new Z());
                    d0((h) entry.getValue());
                }
                for (h hVar : this.F) {
                    hVar.A().M(p0Var, InterfaceC0785s.a.MISCARRIED, true, new Z());
                    d0(hVar);
                }
                this.F.clear();
                n0();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    boolean b0() {
        return this.B == null;
    }

    @Override
    public K c() {
        return this.l;
    }

    boolean c0(int i) {
        boolean z;
        synchronized (this.k) {
            if (i < this.m) {
                z = true;
                if ((i & 1) == 1) {
                }
            }
            z = false;
        }
        return z;
    }

    @Override
    public void d(InterfaceC0787t.a aVar, Executor executor) {
        long nextLong;
        synchronized (this.k) {
            try {
                boolean z = true;
                t8.o.u(this.i != null);
                if (this.y) {
                    W.g(aVar, executor, Y());
                    return;
                }
                W w = this.x;
                if (w != null) {
                    nextLong = 0;
                    z = false;
                } else {
                    nextLong = this.d.nextLong();
                    t tVar = (t) this.e.get();
                    tVar.g();
                    W w2 = new W(nextLong, tVar);
                    this.x = w2;
                    this.P.b();
                    w = w2;
                }
                if (z) {
                    this.i.m(false, (int) (nextLong >>> 32), (int) nextLong);
                }
                w.a(aVar, executor);
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override
    public h e(io.grpc.a0 a0Var, Z z, C0738c c0738c, AbstractC0799k[] abstractC0799kArr) {
        t8.o.p(a0Var, "method");
        t8.o.p(z, "headers");
        O0 h = O0.h(abstractC0799kArr, h(), z);
        synchronized (this.k) {
            try {
                try {
                    return new h(a0Var, z, this.i, this, this.j, this.k, this.r, this.f, this.b, this.c, h, this.P, c0738c, this.O);
                } catch (Throwable th) {
                    th = th;
                    throw th;
                }
            } catch (Throwable th2) {
                th = th2;
                throw th;
            }
        }
    }

    @Override
    public void f(p0 p0Var) {
        synchronized (this.k) {
            try {
                if (this.v != null) {
                    return;
                }
                this.v = p0Var;
                this.h.a(p0Var);
                n0();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override
    public Runnable g(InterfaceC0773l0.a aVar) {
        this.h = (InterfaceC0773l0.a) t8.o.p(aVar, "listener");
        if (this.I) {
            C0757d0 c0757d0 = new C0757d0(new C0757d0.c(this), this.q, this.J, this.K, this.L);
            this.H = c0757d0;
            c0757d0.q();
        }
        Mc.a D1 = Mc.a.D1(this.p, this, 10000);
        Oc.c s1 = D1.s1(this.g.b(L.c(D1), true));
        synchronized (this.k) {
            Mc.b bVar = new Mc.b(this, s1);
            this.i = bVar;
            this.j = new r(this, bVar);
        }
        CountDownLatch countDownLatch = new CountDownLatch(1);
        this.p.execute(new c(countDownLatch, D1));
        try {
            i0();
            countDownLatch.countDown();
            this.p.execute(new d());
            return null;
        } catch (Throwable th) {
            countDownLatch.countDown();
            throw th;
        }
    }

    @Override
    public C0736a h() {
        return this.u;
    }

    void h0(h hVar) {
        this.F.remove(hVar);
        d0(hVar);
    }

    @Override
    public void i(Throwable th) {
        t8.o.p(th, "failureCause");
        k0(0, Oc.a.INTERNAL_ERROR, p0.t.q(th));
    }

    void o0(h hVar) {
        if (this.v != null) {
            hVar.A().M(this.v, InterfaceC0785s.a.MISCARRIED, true, new Z());
        } else if (this.n.size() < this.E) {
            m0(hVar);
        } else {
            this.F.add(hVar);
            j0(hVar);
        }
    }

    public String toString() {
        return t8.i.c(this).c("logId", this.l.d()).d("address", this.a).toString();
    }

    private i(f.C0023f c0023f, InetSocketAddress inetSocketAddress, String str, String str2, C0736a c0736a, v vVar, Oc.j jVar, D d2, Runnable runnable) {
        this.d = new Random();
        this.k = new Object();
        this.n = new HashMap();
        this.E = 0;
        this.F = new LinkedList();
        this.Q = new a();
        this.T = 30000;
        this.a = (InetSocketAddress) t8.o.p(inetSocketAddress, "address");
        this.b = str;
        this.r = c0023f.j;
        this.f = c0023f.o;
        this.o = (Executor) t8.o.p(c0023f.b, "executor");
        this.p = new J0(c0023f.b);
        this.q = (ScheduledExecutorService) t8.o.p(c0023f.d, "scheduledExecutorService");
        this.m = 3;
        SocketFactory socketFactory = c0023f.f;
        this.A = socketFactory == null ? SocketFactory.getDefault() : socketFactory;
        this.B = c0023f.g;
        this.C = c0023f.h;
        this.G = (Nc.b) t8.o.p(c0023f.i, "connectionSpec");
        this.e = (v) t8.o.p(vVar, "stopwatchFactory");
        this.g = (Oc.j) t8.o.p(jVar, "variant");
        this.c = S.i("okhttp", str2);
        this.S = d2;
        this.M = (Runnable) t8.o.p(runnable, "tooManyPingsRunnable");
        this.N = c0023f.q;
        this.P = c0023f.e.a();
        this.l = K.a(getClass(), inetSocketAddress.toString());
        this.u = C0736a.c().d(Q.b, c0736a).a();
        this.O = c0023f.r;
        a0();
    }

    class c implements Runnable {
        final CountDownLatch a;
        final Mc.a b;

        c(CountDownLatch countDownLatch, Mc.a aVar) {
            this.a = countDownLatch;
            this.b = aVar;
        }

        @Override
        public void run() {
            i iVar;
            e eVar;
            Socket T;
            SSLSession sSLSession;
            Socket socket;
            try {
                this.a.await();
            } catch (InterruptedException unused) {
                Thread.currentThread().interrupt();
            }
            InterfaceC0189g d = L.d(new a());
            try {
                try {
                    i iVar2 = i.this;
                    D d2 = iVar2.S;
                    if (d2 == null) {
                        T = iVar2.A.createSocket(i.this.a.getAddress(), i.this.a.getPort());
                    } else {
                        if (!(d2.b() instanceof InetSocketAddress)) {
                            throw p0.s.r("Unsupported SocketAddress implementation " + i.this.S.b().getClass()).c();
                        }
                        i iVar3 = i.this;
                        T = iVar3.T(iVar3.S.c(), (InetSocketAddress) i.this.S.b(), i.this.S.d(), i.this.S.a());
                    }
                    Socket socket2 = T;
                    if (i.this.B != null) {
                        SSLSocket b = o.b(i.this.B, i.this.C, socket2, i.this.W(), i.this.X(), i.this.G);
                        sSLSession = b.getSession();
                        socket = b;
                    } else {
                        sSLSession = null;
                        socket = socket2;
                    }
                    socket.setTcpNoDelay(true);
                    InterfaceC0189g d3 = L.d(L.m(socket));
                    this.b.X0(L.i(socket), socket);
                    i iVar4 = i.this;
                    iVar4.u = iVar4.u.d().d(C.a, socket.getRemoteSocketAddress()).d(C.b, socket.getLocalSocketAddress()).d(C.c, sSLSession).d(Q.a, sSLSession == null ? i0.NONE : i0.PRIVACY_AND_INTEGRITY).a();
                    i iVar5 = i.this;
                    iVar5.t = iVar5.new e(iVar5.g.a(d3, true));
                    synchronized (i.this.k) {
                        try {
                            i.this.D = (Socket) t8.o.p(socket, "socket");
                            if (sSLSession != null) {
                                i.this.R = new E.b(new E.c(sSLSession));
                            }
                        } finally {
                        }
                    }
                } catch (q0 e) {
                    i.this.k0(0, Oc.a.INTERNAL_ERROR, e.a());
                    iVar = i.this;
                    eVar = iVar.new e(iVar.g.a(d, true));
                    iVar.t = eVar;
                } catch (Exception e2) {
                    i.this.i(e2);
                    iVar = i.this;
                    eVar = iVar.new e(iVar.g.a(d, true));
                    iVar.t = eVar;
                }
            } catch (Throwable th) {
                i iVar6 = i.this;
                iVar6.t = iVar6.new e(iVar6.g.a(d, true));
                throw th;
            }
        }

        class a implements Sd.a0 {
            a() {
            }

            @Override
            public long R1(C0187e c0187e, long j) {
                return -1L;
            }

            @Override
            public b0 r() {
                return b0.e;
            }

            @Override
            public void close() {
            }
        }
    }

    class e implements b.a, Runnable {
        Oc.b b;
        private final j a = new j(Level.FINE, i.class);
        boolean c = true;

        e(Oc.b bVar) {
            this.b = bVar;
        }

        private int a(List list) {
            long j = 0;
            for (int i = 0; i < list.size(); i++) {
                Oc.d dVar = (Oc.d) list.get(i);
                j += dVar.a.H() + 32 + dVar.b.H();
            }
            return (int) Math.min(j, 2147483647L);
        }

        @Override
        public void A(boolean z, boolean z2, int i, int i2, List list, Oc.e eVar) {
            p0 p0Var;
            boolean z3;
            int a;
            this.a.d(j.a.INBOUND, i, list, z2);
            if (i.this.N == Integer.MAX_VALUE || (a = a(list)) <= i.this.N) {
                p0Var = null;
            } else {
                p0Var = p0.n.r(String.format(Locale.US, "Response %s metadata larger than %d: %d", z2 ? "trailer" : "header", Integer.valueOf(i.this.N), Integer.valueOf(a)));
            }
            synchronized (i.this.k) {
                try {
                    h hVar = (h) i.this.n.get(Integer.valueOf(i));
                    z3 = false;
                    if (hVar == null) {
                        if (i.this.c0(i)) {
                            i.this.i.w(i, Oc.a.STREAM_CLOSED);
                        } else {
                            z3 = true;
                        }
                    } else if (p0Var == null) {
                        Uc.c.d("OkHttpClientTransport$ClientFrameHandler.headers", hVar.A().h0());
                        hVar.A().j0(list, z2);
                    } else {
                        if (!z2) {
                            i.this.i.w(i, Oc.a.CANCEL);
                        }
                        hVar.A().N(p0Var, false, new Z());
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
            if (z3) {
                i.this.f0(Oc.a.PROTOCOL_ERROR, "Received header for unknown stream: " + i);
            }
        }

        @Override
        public void B(boolean z, Oc.i iVar) {
            boolean z2;
            this.a.i(j.a.INBOUND, iVar);
            synchronized (i.this.k) {
                try {
                    if (n.b(iVar, 4)) {
                        i.this.E = n.a(iVar, 4);
                    }
                    if (n.b(iVar, 7)) {
                        z2 = i.this.j.f(n.a(iVar, 7));
                    } else {
                        z2 = false;
                    }
                    if (this.c) {
                        i iVar2 = i.this;
                        iVar2.u = iVar2.h.d(i.this.u);
                        i.this.h.b();
                        this.c = false;
                    }
                    i.this.i.U(iVar);
                    if (z2) {
                        i.this.j.h();
                    }
                    i.this.l0();
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

        @Override
        public void b(int r8, long r9) {
            throw new UnsupportedOperationException("Method not decompiled: Mc.i.e.b(int, long):void");
        }

        @Override
        public void m(boolean z, int i, int i2) {
            W w;
            long j = (i << 32) | (i2 & 4294967295L);
            this.a.e(j.a.INBOUND, j);
            if (!z) {
                synchronized (i.this.k) {
                    i.this.i.m(true, i, i2);
                }
                return;
            }
            synchronized (i.this.k) {
                try {
                    w = null;
                    if (i.this.x == null) {
                        i.X.warning("Received unexpected ping ack. No ping outstanding");
                    } else if (i.this.x.h() == j) {
                        W w2 = i.this.x;
                        i.this.x = null;
                        w = w2;
                    } else {
                        i.X.log(Level.WARNING, String.format(Locale.US, "Received unexpected ping ack. Expecting %d, got %d", Long.valueOf(i.this.x.h()), Long.valueOf(j)));
                    }
                } finally {
                }
            }
            if (w != null) {
                w.d();
            }
        }

        @Override
        public void n(int i, int i2, List list) {
            this.a.g(j.a.INBOUND, i, i2, list);
            synchronized (i.this.k) {
                i.this.i.w(i, Oc.a.PROTOCOL_ERROR);
            }
        }

        @Override
        public void run() {
            p0 p0Var;
            String name = Thread.currentThread().getName();
            Thread.currentThread().setName("OkHttpClientTransport");
            while (this.b.p1(this)) {
                try {
                    if (i.this.H != null) {
                        i.this.H.n();
                    }
                } catch (Throwable th) {
                    try {
                        i.this.k0(0, Oc.a.PROTOCOL_ERROR, p0.s.r("error in frame handler").q(th));
                        try {
                            this.b.close();
                        } catch (IOException e) {
                            e = e;
                            i.X.log(Level.INFO, "Exception closing frame reader", (Throwable) e);
                        } catch (RuntimeException e2) {
                            if (!"bio == null".equals(e2.getMessage())) {
                                throw e2;
                            }
                        }
                    } catch (Throwable th2) {
                        try {
                            this.b.close();
                        } catch (IOException e3) {
                            i.X.log(Level.INFO, "Exception closing frame reader", (Throwable) e3);
                        } catch (RuntimeException e4) {
                            if (!"bio == null".equals(e4.getMessage())) {
                                throw e4;
                            }
                        }
                        i.this.h.e();
                        Thread.currentThread().setName(name);
                        throw th2;
                    }
                }
            }
            synchronized (i.this.k) {
                p0Var = i.this.v;
            }
            if (p0Var == null) {
                p0Var = p0.t.r("End of stream or IOException");
            }
            i.this.k0(0, Oc.a.INTERNAL_ERROR, p0Var);
            try {
                this.b.close();
            } catch (IOException e5) {
                e = e5;
                i.X.log(Level.INFO, "Exception closing frame reader", (Throwable) e);
            } catch (RuntimeException e6) {
                if (!"bio == null".equals(e6.getMessage())) {
                    throw e6;
                }
            }
            i.this.h.e();
            Thread.currentThread().setName(name);
        }

        @Override
        public void w(int i, Oc.a aVar) {
            this.a.h(j.a.INBOUND, i, aVar);
            p0 f = i.p0(aVar).f("Rst Stream");
            boolean z = f.n() == p0.b.CANCELLED || f.n() == p0.b.DEADLINE_EXCEEDED;
            synchronized (i.this.k) {
                try {
                    h hVar = (h) i.this.n.get(Integer.valueOf(i));
                    if (hVar != null) {
                        Uc.c.d("OkHttpClientTransport$ClientFrameHandler.rstStream", hVar.A().h0());
                        i.this.V(i, f, aVar == Oc.a.REFUSED_STREAM ? InterfaceC0785s.a.REFUSED : InterfaceC0785s.a.PROCESSED, z, null, null);
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }

        @Override
        public void y(boolean z, int i, InterfaceC0189g interfaceC0189g, int i2, int i3) {
            this.a.b(j.a.INBOUND, i, interfaceC0189g.q(), i2, z);
            h Z = i.this.Z(i);
            if (Z != null) {
                long j = i2;
                interfaceC0189g.L0(j);
                C0187e c0187e = new C0187e();
                c0187e.R0(interfaceC0189g.q(), j);
                Uc.c.d("OkHttpClientTransport$ClientFrameHandler.data", Z.A().h0());
                synchronized (i.this.k) {
                    Z.A().i0(c0187e, z, i3 - i2);
                }
            } else {
                if (!i.this.c0(i)) {
                    i.this.f0(Oc.a.PROTOCOL_ERROR, "Received data for unknown stream: " + i);
                    return;
                }
                synchronized (i.this.k) {
                    i.this.i.w(i, Oc.a.STREAM_CLOSED);
                }
                interfaceC0189g.skip(i2);
            }
            i.E(i.this, i3);
            if (i.this.s >= i.this.f * 0.5f) {
                synchronized (i.this.k) {
                    i.this.i.b(0, i.this.s);
                }
                i.this.s = 0;
            }
        }

        @Override
        public void z(int i, Oc.a aVar, C0190h c0190h) {
            this.a.c(j.a.INBOUND, i, aVar, c0190h);
            if (aVar == Oc.a.ENHANCE_YOUR_CALM) {
                String N = c0190h.N();
                i.X.log(Level.WARNING, String.format("%s: Received GOAWAY with ENHANCE_YOUR_CALM. Debug data: %s", this, N));
                if ("too_many_pings".equals(N)) {
                    i.this.M.run();
                }
            }
            p0 f = S.h.i(aVar.a).f("Received Goaway");
            if (c0190h.H() > 0) {
                f = f.f(c0190h.N());
            }
            i.this.k0(i, null, f);
        }

        @Override
        public void o() {
        }

        @Override
        public void x(int i, int i2, int i3, boolean z) {
        }
    }
}