package okhttp3.n0.http2;

import java.io.IOException;
import kotlin.Metadata;
import okhttp3.n0.concurrent.Task;
import okio.Buffer;

/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016¨\u0006\u0004¸\u0006\u0000"}, d2 = {"okhttp3/internal/concurrent/TaskQueue$execute$1", "Lokhttp3/internal/concurrent/Task;", "runOnce", "", "okhttp"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class h extends Task {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ Http2Connection f9950e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ int f9951f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final /* synthetic */ Buffer f9952g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final /* synthetic */ int f9953h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final /* synthetic */ boolean f9954i;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public h(String str, boolean z2, Http2Connection http2Connection, int i2, Buffer buffer, int i3, boolean z3) {
        super(str, z2);
        this.f9950e = http2Connection;
        this.f9951f = i2;
        this.f9952g = buffer;
        this.f9953h = i3;
        this.f9954i = z3;
    }

    @Override // okhttp3.n0.concurrent.Task
    public long a() {
        try {
            boolean zD = this.f9950e.f9920y.d(this.f9951f, this.f9952g, this.f9953h, this.f9954i);
            if (zD) {
                this.f9950e.M.j(this.f9951f, ErrorCode.CANCEL);
            }
            if (!zD && !this.f9954i) {
                return -1L;
            }
            synchronized (this.f9950e) {
                this.f9950e.O.remove(Integer.valueOf(this.f9951f));
            }
            return -1L;
        } catch (IOException unused) {
            return -1L;
        }
    }
}
