package t9; 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 t9.h; /* loaded from: classes2.dex */ public final class f implements Closeable { /* renamed from: z, reason: collision with root package name */ private static final ExecutorService f14504z = new ThreadPoolExecutor(0, Api.BaseClientBuilder.API_PRIORITY_OTHER, 60, TimeUnit.SECONDS, new SynchronousQueue(), o9.e.I("OkHttp Http2Connection", true)); /* renamed from: a, reason: collision with root package name */ final boolean f14505a; /* renamed from: b, reason: collision with root package name */ final j f14506b; /* renamed from: d, reason: collision with root package name */ final String f14508d; /* renamed from: e, reason: collision with root package name */ int f14509e; /* renamed from: f, reason: collision with root package name */ int f14510f; /* renamed from: g, reason: collision with root package name */ private boolean f14511g; /* renamed from: h, reason: collision with root package name */ private final ScheduledExecutorService f14512h; /* renamed from: i, reason: collision with root package name */ private final ExecutorService f14513i; /* renamed from: j, reason: collision with root package name */ final t9.l f14514j; /* renamed from: s, reason: collision with root package name */ long f14523s; /* renamed from: u, reason: collision with root package name */ final m f14525u; /* renamed from: v, reason: collision with root package name */ final Socket f14526v; /* renamed from: w, reason: collision with root package name */ final t9.j f14527w; /* renamed from: x, reason: collision with root package name */ final l f14528x; /* renamed from: y, reason: collision with root package name */ final Set f14529y; /* renamed from: c, reason: collision with root package name */ final Map f14507c = new LinkedHashMap(); /* renamed from: k, reason: collision with root package name */ private long f14515k = 0; /* renamed from: l, reason: collision with root package name */ private long f14516l = 0; /* renamed from: m, reason: collision with root package name */ private long f14517m = 0; /* renamed from: n, reason: collision with root package name */ private long f14518n = 0; /* renamed from: o, reason: collision with root package name */ private long f14519o = 0; /* renamed from: p, reason: collision with root package name */ private long f14520p = 0; /* renamed from: q, reason: collision with root package name */ private long f14521q = 0; /* renamed from: r, reason: collision with root package name */ long f14522r = 0; /* renamed from: t, reason: collision with root package name */ m f14524t = new m(); class a extends o9.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f14530b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ t9.b f14531c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ a(String str, Object[] objArr, int i10, t9.b bVar) { super(str, objArr); this.f14530b = i10; this.f14531c = bVar; } @Override // o9.b public void k() { try { f.this.Q0(this.f14530b, this.f14531c); } catch (IOException e10) { f.this.j0(e10); } } } class b extends o9.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f14533b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ long f14534c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ b(String str, Object[] objArr, int i10, long j10) { super(str, objArr); this.f14533b = i10; this.f14534c = j10; } @Override // o9.b public void k() { try { f.this.f14527w.j0(this.f14533b, this.f14534c); } catch (IOException e10) { f.this.j0(e10); } } } class c extends o9.b { c(String str, Object... objArr) { super(str, objArr); } @Override // o9.b public void k() { f.this.P0(false, 2, 0); } } class d extends o9.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f14537b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ List f14538c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ d(String str, Object[] objArr, int i10, List list) { super(str, objArr); this.f14537b = i10; this.f14538c = list; } @Override // o9.b public void k() { if (f.this.f14514j.a(this.f14537b, this.f14538c)) { try { f.this.f14527w.d0(this.f14537b, t9.b.CANCEL); synchronized (f.this) { f.this.f14529y.remove(Integer.valueOf(this.f14537b)); } } catch (IOException unused) { } } } } class e extends o9.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f14540b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ List f14541c; /* renamed from: d, reason: collision with root package name */ final /* synthetic */ boolean f14542d; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ e(String str, Object[] objArr, int i10, List list, boolean z10) { super(str, objArr); this.f14540b = i10; this.f14541c = list; this.f14542d = z10; } @Override // o9.b public void k() { boolean b10 = f.this.f14514j.b(this.f14540b, this.f14541c, this.f14542d); if (b10) { try { f.this.f14527w.d0(this.f14540b, t9.b.CANCEL); } catch (IOException unused) { return; } } if (b10 || this.f14542d) { synchronized (f.this) { f.this.f14529y.remove(Integer.valueOf(this.f14540b)); } } } } /* renamed from: t9.f$f, reason: collision with other inner class name */ class C0236f extends o9.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f14544b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ x9.c f14545c; /* renamed from: d, reason: collision with root package name */ final /* synthetic */ int f14546d; /* renamed from: e, reason: collision with root package name */ final /* synthetic */ boolean f14547e; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ C0236f(String str, Object[] objArr, int i10, x9.c cVar, int i11, boolean z10) { super(str, objArr); this.f14544b = i10; this.f14545c = cVar; this.f14546d = i11; this.f14547e = z10; } @Override // o9.b public void k() { try { boolean c10 = f.this.f14514j.c(this.f14544b, this.f14545c, this.f14546d, this.f14547e); if (c10) { f.this.f14527w.d0(this.f14544b, t9.b.CANCEL); } if (c10 || this.f14547e) { synchronized (f.this) { f.this.f14529y.remove(Integer.valueOf(this.f14544b)); } } } catch (IOException unused) { } } } class g extends o9.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ int f14549b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ t9.b f14550c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ g(String str, Object[] objArr, int i10, t9.b bVar) { super(str, objArr); this.f14549b = i10; this.f14550c = bVar; } @Override // o9.b public void k() { f.this.f14514j.d(this.f14549b, this.f14550c); synchronized (f.this) { f.this.f14529y.remove(Integer.valueOf(this.f14549b)); } } } public static class h { /* renamed from: a, reason: collision with root package name */ Socket f14552a; /* renamed from: b, reason: collision with root package name */ String f14553b; /* renamed from: c, reason: collision with root package name */ x9.e f14554c; /* renamed from: d, reason: collision with root package name */ x9.d f14555d; /* renamed from: e, reason: collision with root package name */ j f14556e = j.f14561a; /* renamed from: f, reason: collision with root package name */ t9.l f14557f = t9.l.f14632a; /* renamed from: g, reason: collision with root package name */ boolean f14558g; /* renamed from: h, reason: collision with root package name */ int f14559h; public h(boolean z10) { this.f14558g = z10; } public f a() { return new f(this); } public h b(j jVar) { this.f14556e = jVar; return this; } public h c(int i10) { this.f14559h = i10; return this; } public h d(Socket socket, String str, x9.e eVar, x9.d dVar) { this.f14552a = socket; this.f14553b = str; this.f14554c = eVar; this.f14555d = dVar; return this; } } final class i extends o9.b { i() { super("OkHttp %s ping", f.this.f14508d); } @Override // o9.b public void k() { boolean z10; synchronized (f.this) { if (f.this.f14516l < f.this.f14515k) { z10 = true; } else { f.O(f.this); z10 = false; } } if (z10) { f.this.j0(null); } else { f.this.P0(false, 1, 0); } } } public static abstract class j { /* renamed from: a, reason: collision with root package name */ public static final j f14561a = new a(); class a extends j { a() { } @Override // t9.f.j public void b(t9.i iVar) { iVar.d(t9.b.REFUSED_STREAM, null); } } public void a(f fVar) { } public abstract void b(t9.i iVar); } final class k extends o9.b { /* renamed from: b, reason: collision with root package name */ final boolean f14562b; /* renamed from: c, reason: collision with root package name */ final int f14563c; /* renamed from: d, reason: collision with root package name */ final int f14564d; k(boolean z10, int i10, int i11) { super("OkHttp %s ping %08x%08x", f.this.f14508d, Integer.valueOf(i10), Integer.valueOf(i11)); this.f14562b = z10; this.f14563c = i10; this.f14564d = i11; } @Override // o9.b public void k() { f.this.P0(this.f14562b, this.f14563c, this.f14564d); } } class l extends o9.b implements h.b { /* renamed from: b, reason: collision with root package name */ final t9.h f14566b; class a extends o9.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ t9.i f14568b; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ a(String str, Object[] objArr, t9.i iVar) { super(str, objArr); this.f14568b = iVar; } @Override // o9.b public void k() { try { f.this.f14506b.b(this.f14568b); } catch (IOException e10) { u9.j.l().s(4, "Http2Connection.Listener failure for " + f.this.f14508d, e10); try { this.f14568b.d(t9.b.PROTOCOL_ERROR, e10); } catch (IOException unused) { } } } } class b extends o9.b { /* renamed from: b, reason: collision with root package name */ final /* synthetic */ boolean f14570b; /* renamed from: c, reason: collision with root package name */ final /* synthetic */ m f14571c; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ b(String str, Object[] objArr, boolean z10, m mVar) { super(str, objArr); this.f14570b = z10; this.f14571c = mVar; } @Override // o9.b public void k() { l.this.l(this.f14570b, this.f14571c); } } class c extends o9.b { c(String str, Object... objArr) { super(str, objArr); } @Override // o9.b public void k() { f fVar = f.this; fVar.f14506b.a(fVar); } } l(t9.h hVar) { super("OkHttp %s", f.this.f14508d); this.f14566b = hVar; } @Override // t9.h.b public void a() { } @Override // t9.h.b public void b(boolean z10, int i10, int i11, List list) { if (f.this.G0(i10)) { f.this.D0(i10, list, z10); return; } synchronized (f.this) { t9.i m02 = f.this.m0(i10); if (m02 != null) { m02.n(o9.e.K(list), z10); return; } if (f.this.f14511g) { return; } f fVar = f.this; if (i10 <= fVar.f14509e) { return; } if (i10 % 2 == fVar.f14510f % 2) { return; } t9.i iVar = new t9.i(i10, f.this, false, z10, o9.e.K(list)); f fVar2 = f.this; fVar2.f14509e = i10; fVar2.f14507c.put(Integer.valueOf(i10), iVar); f.f14504z.execute(new a("OkHttp %s stream %d", new Object[]{f.this.f14508d, Integer.valueOf(i10)}, iVar)); } } @Override // t9.h.b public void c(int i10, long j10) { if (i10 == 0) { synchronized (f.this) { f fVar = f.this; fVar.f14523s += j10; fVar.notifyAll(); } return; } t9.i m02 = f.this.m0(i10); if (m02 != null) { synchronized (m02) { m02.a(j10); } } } @Override // t9.h.b public void d(boolean z10, m mVar) { try { f.this.f14512h.execute(new b("OkHttp %s ACK Settings", new Object[]{f.this.f14508d}, z10, mVar)); } catch (RejectedExecutionException unused) { } } @Override // t9.h.b public void e(boolean z10, int i10, int i11) { if (!z10) { try { f.this.f14512h.execute(f.this.new k(true, i10, i11)); return; } catch (RejectedExecutionException unused) { return; } } synchronized (f.this) { try { if (i10 == 1) { f.G(f.this); } else if (i10 == 2) { f.a0(f.this); } else if (i10 == 3) { f.d0(f.this); f.this.notifyAll(); } } finally { } } } @Override // t9.h.b public void f(int i10, int i11, int i12, boolean z10) { } @Override // t9.h.b public void g(boolean z10, int i10, x9.e eVar, int i11) { if (f.this.G0(i10)) { f.this.w0(i10, eVar, i11, z10); return; } t9.i m02 = f.this.m0(i10); if (m02 == null) { f.this.R0(i10, t9.b.PROTOCOL_ERROR); long j10 = i11; f.this.M0(j10); eVar.skip(j10); return; } m02.m(eVar, i11); if (z10) { m02.n(o9.e.f12828c, true); } } @Override // t9.h.b public void h(int i10, t9.b bVar) { if (f.this.G0(i10)) { f.this.F0(i10, bVar); return; } t9.i H0 = f.this.H0(i10); if (H0 != null) { H0.o(bVar); } } @Override // t9.h.b public void i(int i10, int i11, List list) { f.this.E0(i11, list); } @Override // t9.h.b public void j(int i10, t9.b bVar, x9.f fVar) { t9.i[] iVarArr; fVar.n(); synchronized (f.this) { iVarArr = (t9.i[]) f.this.f14507c.values().toArray(new t9.i[f.this.f14507c.size()]); f.this.f14511g = true; } for (t9.i iVar : iVarArr) { if (iVar.g() > i10 && iVar.j()) { iVar.o(t9.b.REFUSED_STREAM); f.this.H0(iVar.g()); } } } /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Type inference failed for: r0v0, types: [t9.b] */ /* JADX WARN: Type inference failed for: r0v3 */ /* JADX WARN: Type inference failed for: r0v5, types: [java.io.Closeable, t9.h] */ @Override // o9.b protected void k() { t9.b bVar; t9.b bVar2; t9.b bVar3 = t9.b.INTERNAL_ERROR; IOException e10 = null; try { try { this.f14566b.G(this); while (this.f14566b.z(false, this)) { } bVar2 = t9.b.NO_ERROR; } catch (IOException e11) { e10 = e11; } catch (Throwable th) { th = th; bVar = bVar3; f.this.f0(bVar, bVar3, e10); o9.e.g(this.f14566b); throw th; } try { f.this.f0(bVar2, t9.b.CANCEL, null); bVar = bVar2; } catch (IOException e12) { e10 = e12; t9.b bVar4 = t9.b.PROTOCOL_ERROR; f fVar = f.this; fVar.f0(bVar4, bVar4, e10); bVar = fVar; bVar3 = this.f14566b; o9.e.g(bVar3); } bVar3 = this.f14566b; o9.e.g(bVar3); } catch (Throwable th2) { th = th2; f.this.f0(bVar, bVar3, e10); o9.e.g(this.f14566b); throw th; } } void l(boolean z10, m mVar) { t9.i[] iVarArr; long j10; synchronized (f.this.f14527w) { synchronized (f.this) { int d10 = f.this.f14525u.d(); if (z10) { f.this.f14525u.a(); } f.this.f14525u.h(mVar); int d11 = f.this.f14525u.d(); iVarArr = null; if (d11 == -1 || d11 == d10) { j10 = 0; } else { j10 = d11 - d10; if (!f.this.f14507c.isEmpty()) { iVarArr = (t9.i[]) f.this.f14507c.values().toArray(new t9.i[f.this.f14507c.size()]); } } } try { f fVar = f.this; fVar.f14527w.c(fVar.f14525u); } catch (IOException e10) { f.this.j0(e10); } } if (iVarArr != null) { for (t9.i iVar : iVarArr) { synchronized (iVar) { iVar.a(j10); } } } f.f14504z.execute(new c("OkHttp %s settings", f.this.f14508d)); } } f(h hVar) { m mVar = new m(); this.f14525u = mVar; this.f14529y = new LinkedHashSet(); this.f14514j = hVar.f14557f; boolean z10 = hVar.f14558g; this.f14505a = z10; this.f14506b = hVar.f14556e; int i10 = z10 ? 1 : 2; this.f14510f = i10; if (z10) { this.f14510f = i10 + 2; } if (z10) { this.f14524t.i(7, 16777216); } String str = hVar.f14553b; this.f14508d = str; ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1, o9.e.I(o9.e.q("OkHttp %s Writer", str), false)); this.f14512h = scheduledThreadPoolExecutor; if (hVar.f14559h != 0) { i iVar = new i(); int i11 = hVar.f14559h; scheduledThreadPoolExecutor.scheduleAtFixedRate(iVar, i11, i11, TimeUnit.MILLISECONDS); } this.f14513i = new ThreadPoolExecutor(0, 1, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue(), o9.e.I(o9.e.q("OkHttp %s Push Observer", str), true)); mVar.i(7, 65535); mVar.i(5, 16384); this.f14523s = mVar.d(); this.f14526v = hVar.f14552a; this.f14527w = new t9.j(hVar.f14555d, z10); this.f14528x = new l(new t9.h(hVar.f14554c, z10)); } static /* synthetic */ long G(f fVar) { long j10 = fVar.f14516l; fVar.f14516l = 1 + j10; return j10; } static /* synthetic */ long O(f fVar) { long j10 = fVar.f14515k; fVar.f14515k = 1 + j10; return j10; } static /* synthetic */ long a0(f fVar) { long j10 = fVar.f14518n; fVar.f14518n = 1 + j10; return j10; } static /* synthetic */ long d0(f fVar) { long j10 = fVar.f14520p; fVar.f14520p = 1 + j10; return j10; } /* JADX INFO: Access modifiers changed from: private */ public void j0(IOException iOException) { t9.b bVar = t9.b.PROTOCOL_ERROR; f0(bVar, bVar, iOException); } /* 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 t9.i r0(int r11, java.util.List r12, boolean r13) { /* r10 = this; r6 = r13 ^ 1 r4 = 0 t9.j r7 = r10.f14527w monitor-enter(r7) monitor-enter(r10) // Catch: java.lang.Throwable -> L76 int r0 = r10.f14510f // Catch: java.lang.Throwable -> L73 r1 = 1073741823(0x3fffffff, float:1.9999999) if (r0 <= r1) goto L13 t9.b r0 = t9.b.REFUSED_STREAM // Catch: java.lang.Throwable -> L73 r10.J0(r0) // Catch: java.lang.Throwable -> L73 L13: boolean r0 = r10.f14511g // Catch: java.lang.Throwable -> L73 if (r0 != 0) goto L6d int r8 = r10.f14510f // Catch: java.lang.Throwable -> L73 int r0 = r8 + 2 r10.f14510f = r0 // Catch: java.lang.Throwable -> L73 t9.i r9 = new t9.i // Catch: java.lang.Throwable -> L73 r5 = 0 r0 = r9 r1 = r8 r2 = r10 r3 = r6 r0.(r1, r2, r3, r4, r5) // Catch: java.lang.Throwable -> L73 if (r13 == 0) goto L3a long r0 = r10.f14523s // Catch: java.lang.Throwable -> L73 r2 = 0 int r13 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1)) if (r13 == 0) goto L3a long r0 = r9.f14594b // 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.k() // Catch: java.lang.Throwable -> L73 if (r0 == 0) goto L4a java.util.Map r0 = r10.f14507c // 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 t9.j r11 = r10.f14527w // Catch: java.lang.Throwable -> L76 r11.R(r6, r8, r12) // Catch: java.lang.Throwable -> L76 goto L5c L53: boolean r0 = r10.f14505a // Catch: java.lang.Throwable -> L76 if (r0 != 0) goto L65 t9.j r0 = r10.f14527w // Catch: java.lang.Throwable -> L76 r0.a0(r11, r8, r12) // Catch: java.lang.Throwable -> L76 L5c: monitor-exit(r7) // Catch: java.lang.Throwable -> L76 if (r13 == 0) goto L64 t9.j r11 = r10.f14527w 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: t9.a r11 = new t9.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: t9.f.r0(int, java.util.List, boolean):t9.i"); } private synchronized void z0(o9.b bVar) { if (!this.f14511g) { this.f14513i.execute(bVar); } } void D0(int i10, List list, boolean z10) { try { z0(new e("OkHttp %s Push Headers[%s]", new Object[]{this.f14508d, Integer.valueOf(i10)}, i10, list, z10)); } catch (RejectedExecutionException unused) { } } void E0(int i10, List list) { synchronized (this) { if (this.f14529y.contains(Integer.valueOf(i10))) { R0(i10, t9.b.PROTOCOL_ERROR); return; } this.f14529y.add(Integer.valueOf(i10)); try { z0(new d("OkHttp %s Push Request[%s]", new Object[]{this.f14508d, Integer.valueOf(i10)}, i10, list)); } catch (RejectedExecutionException unused) { } } } void F0(int i10, t9.b bVar) { z0(new g("OkHttp %s Push Reset[%s]", new Object[]{this.f14508d, Integer.valueOf(i10)}, i10, bVar)); } boolean G0(int i10) { return i10 != 0 && (i10 & 1) == 0; } synchronized t9.i H0(int i10) { t9.i iVar; iVar = (t9.i) this.f14507c.remove(Integer.valueOf(i10)); notifyAll(); return iVar; } void I0() { synchronized (this) { long j10 = this.f14518n; long j11 = this.f14517m; if (j10 < j11) { return; } this.f14517m = j11 + 1; this.f14521q = System.nanoTime() + 1000000000; try { this.f14512h.execute(new c("OkHttp %s ping", this.f14508d)); } catch (RejectedExecutionException unused) { } } } public void J0(t9.b bVar) { synchronized (this.f14527w) { synchronized (this) { if (this.f14511g) { return; } this.f14511g = true; this.f14527w.P(this.f14509e, bVar, o9.e.f12826a); } } } public void K0() { L0(true); } void L0(boolean z10) { if (z10) { this.f14527w.z(); this.f14527w.f0(this.f14524t); if (this.f14524t.d() != 65535) { this.f14527w.j0(0, r5 - 65535); } } new Thread(this.f14528x).start(); } synchronized void M0(long j10) { long j11 = this.f14522r + j10; this.f14522r = j11; if (j11 >= this.f14524t.d() / 2) { S0(0, this.f14522r); this.f14522r = 0L; } } /* 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.f14527w.S()); r6 = r3; r8.f14523s -= r6; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public void N0(int r9, boolean r10, x9.c r11, long r12) { /* r8 = this; r0 = 0 r1 = 0 int r3 = (r12 > r1 ? 1 : (r12 == r1 ? 0 : -1)) if (r3 != 0) goto Ld t9.j r12 = r8.f14527w r12.G(r10, r9, r11, r0) return Ld: int r3 = (r12 > r1 ? 1 : (r12 == r1 ? 0 : -1)) if (r3 <= 0) goto L67 monitor-enter(r8) L12: long r3 = r8.f14523s // 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.f14507c // 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 t9.j r3 = r8.f14527w // Catch: java.lang.Throwable -> L56 int r3 = r3.S() // Catch: java.lang.Throwable -> L56 int r3 = java.lang.Math.min(r4, r3) // Catch: java.lang.Throwable -> L56 long r4 = r8.f14523s // Catch: java.lang.Throwable -> L56 long r6 = (long) r3 // Catch: java.lang.Throwable -> L56 long r4 = r4 - r6 r8.f14523s = r4 // Catch: java.lang.Throwable -> L56 monitor-exit(r8) // Catch: java.lang.Throwable -> L56 long r12 = r12 - r6 t9.j r4 = r8.f14527w 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.G(r5, r9, r11, r3) goto Ld L56: r9 = move-exception goto L65 L58: java.lang.Thread r9 = java.lang.Thread.currentThread() // Catch: java.lang.Throwable -> L56 r9.interrupt() // Catch: java.lang.Throwable -> L56 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 L65: monitor-exit(r8) // Catch: java.lang.Throwable -> L56 throw r9 L67: return */ throw new UnsupportedOperationException("Method not decompiled: t9.f.N0(int, boolean, x9.c, long):void"); } void O0(int i10, boolean z10, List list) { this.f14527w.R(z10, i10, list); } void P0(boolean z10, int i10, int i11) { try { this.f14527w.Y(z10, i10, i11); } catch (IOException e10) { j0(e10); } } void Q0(int i10, t9.b bVar) { this.f14527w.d0(i10, bVar); } void R0(int i10, t9.b bVar) { try { this.f14512h.execute(new a("OkHttp %s stream %d", new Object[]{this.f14508d, Integer.valueOf(i10)}, i10, bVar)); } catch (RejectedExecutionException unused) { } } void S0(int i10, long j10) { try { this.f14512h.execute(new b("OkHttp Window Update %s stream %d", new Object[]{this.f14508d, Integer.valueOf(i10)}, i10, j10)); } catch (RejectedExecutionException unused) { } } @Override // java.io.Closeable, java.lang.AutoCloseable public void close() { f0(t9.b.NO_ERROR, t9.b.CANCEL, null); } void f0(t9.b bVar, t9.b bVar2, IOException iOException) { t9.i[] iVarArr; try { J0(bVar); } catch (IOException unused) { } synchronized (this) { if (this.f14507c.isEmpty()) { iVarArr = null; } else { iVarArr = (t9.i[]) this.f14507c.values().toArray(new t9.i[this.f14507c.size()]); this.f14507c.clear(); } } if (iVarArr != null) { for (t9.i iVar : iVarArr) { try { iVar.d(bVar2, iOException); } catch (IOException unused2) { } } } try { this.f14527w.close(); } catch (IOException unused3) { } try { this.f14526v.close(); } catch (IOException unused4) { } this.f14512h.shutdown(); this.f14513i.shutdown(); } public void flush() { this.f14527w.flush(); } synchronized t9.i m0(int i10) { return (t9.i) this.f14507c.get(Integer.valueOf(i10)); } public synchronized boolean n0(long j10) { if (this.f14511g) { return false; } if (this.f14518n < this.f14517m) { if (j10 >= this.f14521q) { return false; } } return true; } public synchronized int q0() { return this.f14525u.e(Api.BaseClientBuilder.API_PRIORITY_OTHER); } public t9.i u0(List list, boolean z10) { return r0(0, list, z10); } void w0(int i10, x9.e eVar, int i11, boolean z10) { x9.c cVar = new x9.c(); long j10 = i11; eVar.s(j10); eVar.s0(cVar, j10); if (cVar.u0() == j10) { z0(new C0236f("OkHttp %s Push Data[%s]", new Object[]{this.f14508d, Integer.valueOf(i10)}, i10, cVar, i11, z10)); return; } throw new IOException(cVar.u0() + " != " + i11); } }