package n5; import com.google.android.gms.common.api.Api; import java.io.Closeable; import java.io.IOException; import java.net.Socket; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import n5.l; /* loaded from: classes2.dex */ public final class f implements Closeable { /* renamed from: a, reason: collision with root package name */ final boolean f12019a; /* renamed from: b, reason: collision with root package name */ final b f12020b; /* renamed from: d, reason: collision with root package name */ final String f12022d; /* renamed from: e, reason: collision with root package name */ int f12023e; /* renamed from: f, reason: collision with root package name */ int f12024f; /* renamed from: g, reason: collision with root package name */ boolean f12025g; /* renamed from: h, reason: collision with root package name */ private final ScheduledExecutorService f12026h; /* renamed from: i, reason: collision with root package name */ private final ExecutorService f12027i; /* renamed from: j, reason: collision with root package name */ final n5.h f12028j; /* renamed from: k, reason: collision with root package name */ private boolean f12029k; /* renamed from: m, reason: collision with root package name */ long f12031m; /* renamed from: o, reason: collision with root package name */ final n5.i f12033o; /* renamed from: p, reason: collision with root package name */ boolean f12034p; /* renamed from: q, reason: collision with root package name */ final Socket f12035q; /* renamed from: r, reason: collision with root package name */ final m f12036r; /* renamed from: s, reason: collision with root package name */ final j f12037s; /* renamed from: t, reason: collision with root package name */ final Set f12038t; /* renamed from: v, reason: collision with root package name */ static final /* synthetic */ boolean f12018v = true; /* renamed from: u, reason: collision with root package name */ private static final ExecutorService f12017u = new ThreadPoolExecutor(0, Api.BaseClientBuilder.API_PRIORITY_OTHER, 60, TimeUnit.SECONDS, new SynchronousQueue(), i5.c.D("OkHttp Http2Connection", f12018v)); /* renamed from: c, reason: collision with root package name */ final Map f12021c = new LinkedHashMap(); /* renamed from: l, reason: collision with root package name */ long f12030l = 0; /* renamed from: n, reason: collision with root package name */ n5.i f12032n = new n5.i(); public static class a { /* renamed from: a, reason: collision with root package name */ Socket f12039a; /* renamed from: b, reason: collision with root package name */ String f12040b; /* renamed from: c, reason: collision with root package name */ h5.f f12041c; /* renamed from: d, reason: collision with root package name */ h5.e f12042d; /* renamed from: e, reason: collision with root package name */ b f12043e = b.f12047a; /* renamed from: f, reason: collision with root package name */ n5.h f12044f = n5.h.f12106a; /* renamed from: g, reason: collision with root package name */ boolean f12045g; /* renamed from: h, reason: collision with root package name */ int f12046h; public a(boolean z10) { this.f12045g = z10; } public f a() { return new f(this); } public a b(b bVar) { this.f12043e = bVar; return this; } public a c(int i10) { this.f12046h = i10; return this; } public a d(Socket socket, String str, h5.f fVar, h5.e eVar) { this.f12039a = socket; this.f12040b = str; this.f12041c = fVar; this.f12042d = eVar; return this; } } public static abstract class b { /* renamed from: a, reason: collision with root package name */ public static final b f12047a = new a(); class a extends b { a() { } @Override // n5.f.b public void b(n5.g gVar) { gVar.i(n5.b.REFUSED_STREAM); } } public void a(f fVar) { } public abstract void b(n5.g gVar); } class c extends i5.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f12048b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ n5.b f12049c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ c(String str, Object[] objArr, int i10, n5.b bVar) { super(str, objArr); this.f12048b = i10; this.f12049c = bVar; } @Override // i5.b public void j() { try { f.this.u0(this.f12048b, this.f12049c); } catch (IOException unused) { f.this.q0(); } } } class d extends i5.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f12051b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ long f12052c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ d(String str, Object[] objArr, int i10, long j10) { super(str, objArr); this.f12051b = i10; this.f12052c = j10; } @Override // i5.b public void j() { try { f.this.f12036r.O(this.f12051b, this.f12052c); } catch (IOException unused) { f.this.q0(); } } } class e extends i5.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f12054b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ List f12055c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ e(String str, Object[] objArr, int i10, List list) { super(str, objArr); this.f12054b = i10; this.f12055c = list; } @Override // i5.b public void j() { if (f.this.f12028j.a(this.f12054b, this.f12055c)) { try { f.this.f12036r.P(this.f12054b, n5.b.CANCEL); synchronized (f.this) { f.this.f12038t.remove(Integer.valueOf(this.f12054b)); } } catch (IOException unused) { } } } } /* renamed from: n5.f$f, reason: collision with other inner class name */ class C0196f extends i5.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f12057b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ List f12058c; /* renamed from: d, reason: collision with root package name */ final /* synthetic */ boolean f12059d; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ C0196f(String str, Object[] objArr, int i10, List list, boolean z10) { super(str, objArr); this.f12057b = i10; this.f12058c = list; this.f12059d = z10; } @Override // i5.b public void j() { boolean b10 = f.this.f12028j.b(this.f12057b, this.f12058c, this.f12059d); if (b10) { try { f.this.f12036r.P(this.f12057b, n5.b.CANCEL); } catch (IOException unused) { return; } } if (b10 || this.f12059d) { synchronized (f.this) { f.this.f12038t.remove(Integer.valueOf(this.f12057b)); } } } } class g extends i5.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f12061b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ h5.d f12062c; /* renamed from: d, reason: collision with root package name */ final /* synthetic */ int f12063d; /* renamed from: e, reason: collision with root package name */ final /* synthetic */ boolean f12064e; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ g(String str, Object[] objArr, int i10, h5.d dVar, int i11, boolean z10) { super(str, objArr); this.f12061b = i10; this.f12062c = dVar; this.f12063d = i11; this.f12064e = z10; } @Override // i5.b public void j() { try { boolean c10 = f.this.f12028j.c(this.f12061b, this.f12062c, this.f12063d, this.f12064e); if (c10) { f.this.f12036r.P(this.f12061b, n5.b.CANCEL); } if (c10 || this.f12064e) { synchronized (f.this) { f.this.f12038t.remove(Integer.valueOf(this.f12061b)); } } } catch (IOException unused) { } } } class h extends i5.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f12066b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ n5.b f12067c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ h(String str, Object[] objArr, int i10, n5.b bVar) { super(str, objArr); this.f12066b = i10; this.f12067c = bVar; } @Override // i5.b public void j() { f.this.f12028j.d(this.f12066b, this.f12067c); synchronized (f.this) { f.this.f12038t.remove(Integer.valueOf(this.f12066b)); } } } final class i extends i5.b { /* renamed from: b, reason: collision with root package name */ final boolean f12069b; /* renamed from: c, reason: collision with root package name */ final int f12070c; /* renamed from: d, reason: collision with root package name */ final int f12071d; i(boolean z10, int i10, int i11) { super("OkHttp %s ping %08x%08x", f.this.f12022d, Integer.valueOf(i10), Integer.valueOf(i11)); this.f12069b = z10; this.f12070c = i10; this.f12071d = i11; } @Override // i5.b public void j() { f.this.j0(this.f12069b, this.f12070c, this.f12071d); } } class j extends i5.b implements l.b { /* renamed from: b, reason: collision with root package name */ final l f12073b; class a extends i5.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ n5.g f12075b; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ a(String str, Object[] objArr, n5.g gVar) { super(str, objArr); this.f12075b = gVar; } @Override // i5.b public void j() { try { f.this.f12020b.b(this.f12075b); } catch (IOException e10) { o5.a.j().o(4, "Http2Connection.Listener failure for " + f.this.f12022d, e10); try { this.f12075b.i(n5.b.PROTOCOL_ERROR); } catch (IOException unused) { } } } } class b extends i5.b { b(String str, Object... objArr) { super(str, objArr); } @Override // i5.b public void j() { f fVar = f.this; fVar.f12020b.a(fVar); } } class c extends i5.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ n5.i f12078b; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ c(String str, Object[] objArr, n5.i iVar) { super(str, objArr); this.f12078b = iVar; } @Override // i5.b public void j() { try { f.this.f12036r.Y(this.f12078b); } catch (IOException unused) { f.this.q0(); } } } j(l lVar) { super("OkHttp %s", f.this.f12022d); this.f12073b = lVar; } private void k(n5.i iVar) { try { f.this.f12026h.execute(new c("OkHttp %s ACK Settings", new Object[]{f.this.f12022d}, iVar)); } catch (RejectedExecutionException unused) { } } @Override // n5.l.b public void a() { } @Override // n5.l.b public void b(boolean z10, int i10, int i11) { if (!z10) { try { f.this.f12026h.execute(f.this.new i(f.f12018v, i10, i11)); } catch (RejectedExecutionException unused) { } } else { synchronized (f.this) { f.this.f12029k = false; f.this.notifyAll(); } } } @Override // n5.l.b public void c(int i10, int i11, List list) { f.this.P(i11, list); } @Override // n5.l.b public void d(boolean z10, n5.i iVar) { n5.g[] gVarArr; long j10; int i10; synchronized (f.this) { int g10 = f.this.f12033o.g(); if (z10) { f.this.f12033o.c(); } f.this.f12033o.d(iVar); k(iVar); int g11 = f.this.f12033o.g(); gVarArr = null; if (g11 == -1 || g11 == g10) { j10 = 0; } else { j10 = g11 - g10; f fVar = f.this; if (!fVar.f12034p) { fVar.f12034p = f.f12018v; } if (!fVar.f12021c.isEmpty()) { gVarArr = (n5.g[]) f.this.f12021c.values().toArray(new n5.g[f.this.f12021c.size()]); } } f.f12017u.execute(new b("OkHttp %s settings", f.this.f12022d)); } if (gVarArr == null || j10 == 0) { return; } for (n5.g gVar : gVarArr) { synchronized (gVar) { gVar.b(j10); } } } @Override // n5.l.b public void e(boolean z10, int i10, h5.f fVar, int i11) { if (f.this.w0(i10)) { f.this.O(i10, fVar, i11, z10); return; } n5.g z11 = f.this.z(i10); if (z11 == null) { f.this.D0(i10, n5.b.PROTOCOL_ERROR); long j10 = i11; f.this.S(j10); fVar.skip(j10); return; } z11.c(fVar, i11); if (z10) { z11.h(); } } @Override // n5.l.b public void f(boolean z10, int i10, int i11, List list) { if (f.this.w0(i10)) { f.this.r0(i10, list, z10); return; } synchronized (f.this) { n5.g z11 = f.this.z(i10); if (z11 != null) { z11.d(list); if (z10) { z11.h(); return; } return; } f fVar = f.this; if (fVar.f12025g) { return; } if (i10 <= fVar.f12023e) { return; } if (i10 % 2 == fVar.f12024f % 2) { return; } n5.g gVar = new n5.g(i10, f.this, false, z10, list); f fVar2 = f.this; fVar2.f12023e = i10; fVar2.f12021c.put(Integer.valueOf(i10), gVar); f.f12017u.execute(new a("OkHttp %s stream %d", new Object[]{f.this.f12022d, Integer.valueOf(i10)}, gVar)); } } @Override // n5.l.b public void g(int i10, int i11, int i12, boolean z10) { } @Override // n5.l.b public void h(int i10, n5.b bVar) { if (f.this.w0(i10)) { f.this.R(i10, bVar); return; } n5.g z02 = f.this.z0(i10); if (z02 != null) { z02.g(bVar); } } @Override // n5.l.b public void i(int i10, long j10) { f fVar = f.this; if (i10 == 0) { synchronized (fVar) { f fVar2 = f.this; fVar2.f12031m += j10; fVar2.notifyAll(); } return; } n5.g z10 = fVar.z(i10); if (z10 != null) { synchronized (z10) { z10.b(j10); } } } @Override // i5.b protected void j() { Throwable th; n5.b bVar; n5.b bVar2 = n5.b.INTERNAL_ERROR; try { try { this.f12073b.I(this); while (this.f12073b.R(false, this)) { } bVar = n5.b.NO_ERROR; } catch (IOException unused) { bVar = bVar2; } catch (Throwable th2) { th = th2; bVar = bVar2; try { f.this.a0(bVar, bVar2); } catch (IOException unused2) { } i5.c.j(this.f12073b); throw th; } try { try { f.this.a0(bVar, n5.b.CANCEL); } catch (Throwable th3) { th = th3; f.this.a0(bVar, bVar2); i5.c.j(this.f12073b); throw th; } } catch (IOException unused3) { n5.b bVar3 = n5.b.PROTOCOL_ERROR; f.this.a0(bVar3, bVar3); i5.c.j(this.f12073b); } } catch (IOException unused4) { } i5.c.j(this.f12073b); } @Override // n5.l.b public void a(int i10, n5.b bVar, h5.g gVar) { n5.g[] gVarArr; gVar.o(); synchronized (f.this) { gVarArr = (n5.g[]) f.this.f12021c.values().toArray(new n5.g[f.this.f12021c.size()]); f.this.f12025g = f.f12018v; } for (n5.g gVar2 : gVarArr) { if (gVar2.l() > i10 && gVar2.o()) { gVar2.g(n5.b.REFUSED_STREAM); f.this.z0(gVar2.l()); } } } } f(a aVar) { n5.i iVar = new n5.i(); this.f12033o = iVar; this.f12034p = false; this.f12038t = new LinkedHashSet(); this.f12028j = aVar.f12044f; boolean z10 = aVar.f12045g; this.f12019a = z10; this.f12020b = aVar.f12043e; int i10 = z10 ? 1 : 2; this.f12024f = i10; if (z10) { this.f12024f = i10 + 2; } if (z10) { this.f12032n.b(7, 16777216); } String str = aVar.f12040b; this.f12022d = str; ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1, i5.c.D(i5.c.r("OkHttp %s Writer", str), false)); this.f12026h = scheduledThreadPoolExecutor; if (aVar.f12046h != 0) { i iVar2 = new i(false, 0, 0); long j10 = aVar.f12046h; scheduledThreadPoolExecutor.scheduleAtFixedRate(iVar2, j10, j10, TimeUnit.MILLISECONDS); } this.f12027i = new ThreadPoolExecutor(0, 1, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue(), i5.c.D(i5.c.r("OkHttp %s Push Observer", str), f12018v)); iVar.b(7, 65535); iVar.b(5, 16384); this.f12031m = iVar.g(); this.f12035q = aVar.f12039a; this.f12036r = new m(aVar.f12042d, z10); this.f12037s = new j(new l(aVar.f12041c, z10)); } /* JADX WARN: Removed duplicated region for block: B:21:0x0041 A[Catch: all -> 0x0073, TryCatch #0 {, blocks: (B:6:0x0007, B:8:0x000e, B:9:0x0013, B:11:0x0017, B:13:0x0029, B:15:0x0031, B:19:0x003b, B:21:0x0041, B:22:0x004a, B:36:0x006d, B:37:0x0072), top: B:5:0x0007, outer: #1 }] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ private n5.g G(int r11, java.util.List r12, boolean r13) { /* r10 = this; r6 = r13 ^ 1 r4 = 0 n5.m r7 = r10.f12036r monitor-enter(r7) monitor-enter(r10) // Catch: java.lang.Throwable -> L76 int r0 = r10.f12024f // Catch: java.lang.Throwable -> L73 r1 = 1073741823(0x3fffffff, float:1.9999999) if (r0 <= r1) goto L13 n5.b r0 = n5.b.REFUSED_STREAM // Catch: java.lang.Throwable -> L73 r10.H0(r0) // Catch: java.lang.Throwable -> L73 L13: boolean r0 = r10.f12025g // Catch: java.lang.Throwable -> L73 if (r0 != 0) goto L6d int r8 = r10.f12024f // Catch: java.lang.Throwable -> L73 int r0 = r8 + 2 r10.f12024f = r0 // Catch: java.lang.Throwable -> L73 n5.g r9 = new n5.g // Catch: java.lang.Throwable -> L73 r0 = r9 r1 = r8 r2 = r10 r3 = r6 r5 = r12 r0.(r1, r2, r3, r4, r5) // Catch: java.lang.Throwable -> L73 if (r13 == 0) goto L3a long r0 = r10.f12031m // Catch: java.lang.Throwable -> L73 r2 = 0 int r13 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1)) if (r13 == 0) goto L3a long r0 = r9.f12082b // Catch: java.lang.Throwable -> L73 int r13 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1)) if (r13 != 0) goto L38 goto L3a L38: r13 = 0 goto L3b L3a: r13 = 1 L3b: boolean r0 = r9.p() // Catch: java.lang.Throwable -> L73 if (r0 == 0) goto L4a java.util.Map r0 = r10.f12021c // Catch: java.lang.Throwable -> L73 java.lang.Integer r1 = java.lang.Integer.valueOf(r8) // Catch: java.lang.Throwable -> L73 r0.put(r1, r9) // Catch: java.lang.Throwable -> L73 L4a: monitor-exit(r10) // Catch: java.lang.Throwable -> L73 if (r11 != 0) goto L53 n5.m r0 = r10.f12036r // Catch: java.lang.Throwable -> L76 r0.d0(r6, r8, r11, r12) // Catch: java.lang.Throwable -> L76 goto L5c L53: boolean r0 = r10.f12019a // Catch: java.lang.Throwable -> L76 if (r0 != 0) goto L65 n5.m r0 = r10.f12036r // Catch: java.lang.Throwable -> L76 r0.I(r11, r8, r12) // Catch: java.lang.Throwable -> L76 L5c: monitor-exit(r7) // Catch: java.lang.Throwable -> L76 if (r13 == 0) goto L64 n5.m r11 = r10.f12036r r11.flush() L64: return r9 L65: java.lang.IllegalArgumentException r11 = new java.lang.IllegalArgumentException // Catch: java.lang.Throwable -> L76 java.lang.String r12 = "client streams shouldn't have associated stream IDs" r11.(r12) // Catch: java.lang.Throwable -> L76 throw r11 // Catch: java.lang.Throwable -> L76 L6d: n5.a r11 = new n5.a // Catch: java.lang.Throwable -> L73 r11.() // Catch: java.lang.Throwable -> L73 throw r11 // Catch: java.lang.Throwable -> L73 L73: r11 = move-exception monitor-exit(r10) // Catch: java.lang.Throwable -> L73 throw r11 // Catch: java.lang.Throwable -> L76 L76: r11 = move-exception monitor-exit(r7) // Catch: java.lang.Throwable -> L76 throw r11 */ throw new UnsupportedOperationException("Method not decompiled: n5.f.G(int, java.util.List, boolean):n5.g"); } private synchronized void Y(i5.b bVar) { if (!E0()) { this.f12027i.execute(bVar); } } /* JADX INFO: Access modifiers changed from: private */ public void q0() { try { n5.b bVar = n5.b.PROTOCOL_ERROR; a0(bVar, bVar); } catch (IOException unused) { } } void D0(int i10, n5.b bVar) { try { this.f12026h.execute(new c("OkHttp %s stream %d", new Object[]{this.f12022d, Integer.valueOf(i10)}, i10, bVar)); } catch (RejectedExecutionException unused) { } } public synchronized boolean E0() { return this.f12025g; } public synchronized int F0() { return this.f12033o.f(Api.BaseClientBuilder.API_PRIORITY_OTHER); } public n5.g G0(List list, boolean z10) { return G(0, list, z10); } public void H0(n5.b bVar) { synchronized (this.f12036r) { synchronized (this) { if (this.f12025g) { return; } this.f12025g = f12018v; this.f12036r.R(this.f12023e, bVar, i5.c.f10871a); } } } void I(int i10, long j10) { try { this.f12026h.execute(new d("OkHttp Window Update %s stream %d", new Object[]{this.f12022d, Integer.valueOf(i10)}, i10, j10)); } catch (RejectedExecutionException unused) { } } public void I0() { f0(f12018v); } /* JADX WARN: Code restructure failed: missing block: B:20:0x0030, code lost: r3 = java.lang.Math.min((int) java.lang.Math.min(r12, r3), r8.f12036r.m0()); r6 = r3; r8.f12031m -= r6; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public void J0(int r9, boolean r10, h5.d r11, long r12) { /* r8 = this; r0 = 0 r1 = 0 int r3 = (r12 > r1 ? 1 : (r12 == r1 ? 0 : -1)) if (r3 != 0) goto Ld n5.m r12 = r8.f12036r r12.f0(r10, r9, r11, r0) return Ld: int r3 = (r12 > r1 ? 1 : (r12 == r1 ? 0 : -1)) if (r3 <= 0) goto L60 monitor-enter(r8) L12: long r3 = r8.f12031m // Catch: java.lang.Throwable -> L56 java.lang.InterruptedException -> L58 int r5 = (r3 > r1 ? 1 : (r3 == r1 ? 0 : -1)) if (r5 > 0) goto L30 java.util.Map r3 = r8.f12021c // Catch: java.lang.Throwable -> L56 java.lang.InterruptedException -> L58 java.lang.Integer r4 = java.lang.Integer.valueOf(r9) // Catch: java.lang.Throwable -> L56 java.lang.InterruptedException -> L58 boolean r3 = r3.containsKey(r4) // Catch: java.lang.Throwable -> L56 java.lang.InterruptedException -> L58 if (r3 == 0) goto L28 r8.wait() // Catch: java.lang.Throwable -> L56 java.lang.InterruptedException -> L58 goto L12 L28: java.io.IOException r9 = new java.io.IOException // Catch: java.lang.Throwable -> L56 java.lang.InterruptedException -> L58 java.lang.String r10 = "stream closed" r9.(r10) // Catch: java.lang.Throwable -> L56 java.lang.InterruptedException -> L58 throw r9 // Catch: java.lang.Throwable -> L56 java.lang.InterruptedException -> L58 L30: long r3 = java.lang.Math.min(r12, r3) // Catch: java.lang.Throwable -> L56 int r4 = (int) r3 // Catch: java.lang.Throwable -> L56 n5.m r3 = r8.f12036r // Catch: java.lang.Throwable -> L56 int r3 = r3.m0() // Catch: java.lang.Throwable -> L56 int r3 = java.lang.Math.min(r4, r3) // Catch: java.lang.Throwable -> L56 long r4 = r8.f12031m // Catch: java.lang.Throwable -> L56 long r6 = (long) r3 // Catch: java.lang.Throwable -> L56 long r4 = r4 - r6 r8.f12031m = r4 // Catch: java.lang.Throwable -> L56 monitor-exit(r8) // Catch: java.lang.Throwable -> L56 long r12 = r12 - r6 n5.m r4 = r8.f12036r if (r10 == 0) goto L51 int r5 = (r12 > r1 ? 1 : (r12 == r1 ? 0 : -1)) if (r5 != 0) goto L51 r5 = 1 goto L52 L51: r5 = 0 L52: r4.f0(r5, r9, r11, r3) goto Ld L56: r9 = move-exception goto L5e L58: java.io.InterruptedIOException r9 = new java.io.InterruptedIOException // Catch: java.lang.Throwable -> L56 r9.() // Catch: java.lang.Throwable -> L56 throw r9 // Catch: java.lang.Throwable -> L56 L5e: monitor-exit(r8) // Catch: java.lang.Throwable -> L56 throw r9 L60: return */ throw new UnsupportedOperationException("Method not decompiled: n5.f.J0(int, boolean, h5.d, long):void"); } void O(int i10, h5.f fVar, int i11, boolean z10) { h5.d dVar = new h5.d(); long j10 = i11; fVar.s(j10); fVar.H(dVar, j10); if (dVar.u0() == j10) { Y(new g("OkHttp %s Push Data[%s]", new Object[]{this.f12022d, Integer.valueOf(i10)}, i10, dVar, i11, z10)); return; } throw new IOException(dVar.u0() + " != " + i11); } void P(int i10, List list) { synchronized (this) { if (this.f12038t.contains(Integer.valueOf(i10))) { D0(i10, n5.b.PROTOCOL_ERROR); return; } this.f12038t.add(Integer.valueOf(i10)); try { Y(new e("OkHttp %s Push MobonRequest[%s]", new Object[]{this.f12022d, Integer.valueOf(i10)}, i10, list)); } catch (RejectedExecutionException unused) { } } } void R(int i10, n5.b bVar) { Y(new h("OkHttp %s Push Reset[%s]", new Object[]{this.f12022d, Integer.valueOf(i10)}, i10, bVar)); } synchronized void S(long j10) { long j11 = this.f12030l + j10; this.f12030l = j11; if (j11 >= this.f12032n.g() / 2) { I(0, this.f12030l); this.f12030l = 0L; } } void a0(n5.b bVar, n5.b bVar2) { if (!f12018v && Thread.holdsLock(this)) { throw new AssertionError(); } n5.g[] gVarArr = null; try { H0(bVar); e = null; } catch (IOException e10) { e = e10; } synchronized (this) { if (!this.f12021c.isEmpty()) { gVarArr = (n5.g[]) this.f12021c.values().toArray(new n5.g[this.f12021c.size()]); this.f12021c.clear(); } } if (gVarArr != null) { for (n5.g gVar : gVarArr) { try { gVar.i(bVar2); } catch (IOException e11) { if (e != null) { e = e11; } } } } try { this.f12036r.close(); } catch (IOException e12) { if (e == null) { e = e12; } } try { this.f12035q.close(); } catch (IOException e13) { e = e13; } this.f12026h.shutdown(); this.f12027i.shutdown(); if (e != null) { throw e; } } @Override // java.io.Closeable, java.lang.AutoCloseable public void close() { a0(n5.b.NO_ERROR, n5.b.CANCEL); } void f0(boolean z10) { if (z10) { this.f12036r.c(); this.f12036r.q0(this.f12032n); if (this.f12032n.g() != 65535) { this.f12036r.O(0, r5 - 65535); } } new Thread(this.f12037s).start(); } public void flush() { this.f12036r.flush(); } void j0(boolean z10, int i10, int i11) { boolean z11; if (!z10) { synchronized (this) { z11 = this.f12029k; this.f12029k = f12018v; } if (z11) { q0(); return; } } try { this.f12036r.a0(z10, i10, i11); } catch (IOException unused) { q0(); } } void r0(int i10, List list, boolean z10) { try { Y(new C0196f("OkHttp %s Push Headers[%s]", new Object[]{this.f12022d, Integer.valueOf(i10)}, i10, list, z10)); } catch (RejectedExecutionException unused) { } } void u0(int i10, n5.b bVar) { this.f12036r.P(i10, bVar); } boolean w0(int i10) { if (i10 == 0 || (i10 & 1) != 0) { return false; } return f12018v; } synchronized n5.g z(int i10) { return (n5.g) this.f12021c.get(Integer.valueOf(i10)); } synchronized n5.g z0(int i10) { n5.g gVar; gVar = (n5.g) this.f12021c.remove(Integer.valueOf(i10)); notifyAll(); return gVar; } }