.class public final Lb/a/a/a;
.super Ljava/lang/Object;

# interfaces
.implements Lb/z;


# static fields
.field private static final b:Lb/ak;


# instance fields
.field final a:Lb/a/a/h;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    new-instance v0, Lb/a/a/i;

    invoke-direct {v0}, Lb/a/a/i;-><init>()V

    sput-object v0, Lb/a/a/a;->b:Lb/ak;

    return-void
.end method

.method public constructor <init>(Lb/a/a/h;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lb/a/a/a;->a:Lb/a/a/h;

    return-void
.end method

.method private static a(Lb/ai;Lb/af;Lb/a/a/h;)Lb/a/a/b;
    .locals 2

    const/4 v0, 0x0

    if-nez p2, :cond_1

    :cond_0
    :goto_0
    return-object v0

    :cond_1
    invoke-static {p0, p1}, Lb/a/a/c;->a(Lb/ai;Lb/af;)Z

    move-result v1

    if-nez v1, :cond_2

    invoke-virtual {p1}, Lb/af;->e()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lb/a/d/n;->a(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    :try_start_0
    invoke-interface {p2, p1}, Lb/a/a/h;->b(Lb/af;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v1

    goto :goto_0

    :cond_2
    invoke-interface {p2, p0}, Lb/a/a/h;->a(Lb/ai;)Lb/a/a/b;

    move-result-object v0

    goto :goto_0
.end method

.method private static a(Lb/ai;)Lb/ai;
    .locals 2

    if-eqz p0, :cond_0

    invoke-virtual {p0}, Lb/ai;->a()Lb/ak;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lb/ai;->f()Lb/aj;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lb/aj;->a(Lb/ak;)Lb/aj;

    move-result-object v0

    invoke-virtual {v0}, Lb/aj;->a()Lb/ai;

    move-result-object p0

    :cond_0
    return-object p0
.end method

.method private static a(Ljava/lang/String;)Z
    .locals 1

    const-string v0, "Connection"

    invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "Keep-Alive"

    invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "Proxy-Authenticate"

    invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "Proxy-Authorization"

    invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "TE"

    invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "Trailers"

    invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "Transfer-Encoding"

    invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "Upgrade"

    invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method


# virtual methods
.method public final a(Lb/aa;)Lb/ai;
    .locals 12

    const/4 v2, 0x1

    const/4 v1, 0x0

    iget-object v0, p0, Lb/a/a/a;->a:Lb/a/a/h;

    if-eqz v0, :cond_3

    iget-object v0, p0, Lb/a/a/a;->a:Lb/a/a/h;

    invoke-interface {p1}, Lb/aa;->a()Lb/af;

    move-result-object v3

    invoke-interface {v0, v3}, Lb/a/a/h;->a(Lb/af;)Lb/ai;

    move-result-object v0

    :goto_0
    new-instance v3, Lb/a/a/d;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    invoke-interface {p1}, Lb/aa;->a()Lb/af;

    move-result-object v6

    invoke-direct {v3, v4, v5, v6, v0}, Lb/a/a/d;-><init>(JLb/af;Lb/ai;)V

    invoke-virtual {v3}, Lb/a/a/d;->a()Lb/a/a/c;

    move-result-object v3

    iget-object v4, v3, Lb/a/a/c;->b:Lb/af;

    iget-object v5, v3, Lb/a/a/c;->a:Lb/ai;

    iget-object v6, p0, Lb/a/a/a;->a:Lb/a/a/h;

    if-eqz v6, :cond_0

    iget-object v6, p0, Lb/a/a/a;->a:Lb/a/a/h;

    invoke-interface {v6, v3}, Lb/a/a/h;->a(Lb/a/a/c;)V

    :cond_0
    if-eqz v0, :cond_1

    if-nez v5, :cond_1

    invoke-virtual {v0}, Lb/ai;->a()Lb/ak;

    move-result-object v3

    invoke-static {v3}, Lb/a/c;->a(Ljava/io/Closeable;)V

    :cond_1
    if-nez v4, :cond_4

    if-nez v5, :cond_4

    new-instance v0, Lb/aj;

    invoke-direct {v0}, Lb/aj;-><init>()V

    invoke-interface {p1}, Lb/aa;->a()Lb/af;

    move-result-object v1

    invoke-virtual {v0, v1}, Lb/aj;->a(Lb/af;)Lb/aj;

    move-result-object v0

    sget-object v1, Lb/ae;->b:Lb/ae;

    invoke-virtual {v0, v1}, Lb/aj;->a(Lb/ae;)Lb/aj;

    move-result-object v0

    const/16 v1, 0x1f8

    invoke-virtual {v0, v1}, Lb/aj;->a(I)Lb/aj;

    move-result-object v0

    const-string v1, "Unsatisfiable Request (only-if-cached)"

    invoke-virtual {v0, v1}, Lb/aj;->a(Ljava/lang/String;)Lb/aj;

    move-result-object v0

    sget-object v1, Lb/a/a/a;->b:Lb/ak;

    invoke-virtual {v0, v1}, Lb/aj;->a(Lb/ak;)Lb/aj;

    move-result-object v0

    const-wide/16 v2, -0x1

    invoke-virtual {v0, v2, v3}, Lb/aj;->b(J)Lb/aj;

    move-result-object v0

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    invoke-virtual {v0, v2, v3}, Lb/aj;->a(J)Lb/aj;

    move-result-object v0

    invoke-virtual {v0}, Lb/aj;->a()Lb/ai;

    move-result-object v0

    :cond_2
    :goto_1
    return-object v0

    :cond_3
    const/4 v0, 0x0

    goto :goto_0

    :cond_4
    if-nez v4, :cond_5

    invoke-virtual {v5}, Lb/ai;->f()Lb/aj;

    move-result-object v0

    invoke-static {v5}, Lb/a/a/a;->a(Lb/ai;)Lb/ai;

    move-result-object v1

    invoke-virtual {v0, v1}, Lb/aj;->a(Lb/ai;)Lb/aj;

    move-result-object v0

    invoke-virtual {v0}, Lb/aj;->a()Lb/ai;

    move-result-object v0

    goto :goto_1

    :cond_5
    :try_start_0
    invoke-interface {p1, v4}, Lb/aa;->a(Lb/af;)Lb/ai;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v3

    if-nez v3, :cond_6

    if-eqz v0, :cond_6

    invoke-virtual {v0}, Lb/ai;->a()Lb/ak;

    move-result-object v0

    invoke-static {v0}, Lb/a/c;->a(Ljava/io/Closeable;)V

    :cond_6
    if-eqz v5, :cond_11

    invoke-virtual {v3}, Lb/ai;->c()I

    move-result v0

    const/16 v4, 0x130

    if-ne v0, v4, :cond_b

    move v0, v2

    :goto_2
    if-eqz v0, :cond_10

    invoke-virtual {v5}, Lb/ai;->f()Lb/aj;

    move-result-object v2

    invoke-virtual {v5}, Lb/ai;->e()Lb/u;

    move-result-object v4

    invoke-virtual {v3}, Lb/ai;->e()Lb/u;

    move-result-object v6

    new-instance v7, Lb/v;

    invoke-direct {v7}, Lb/v;-><init>()V

    invoke-virtual {v4}, Lb/u;->b()I

    move-result v8

    move v0, v1

    :goto_3
    if-ge v0, v8, :cond_d

    invoke-virtual {v4, v0}, Lb/u;->a(I)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v4, v0}, Lb/u;->b(I)Ljava/lang/String;

    move-result-object v10

    const-string v11, "Warning"

    invoke-virtual {v11, v9}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v11

    if-eqz v11, :cond_7

    const-string v11, "1"

    invoke-virtual {v10, v11}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v11

    if-nez v11, :cond_9

    :cond_7
    invoke-static {v9}, Lb/a/a/a;->a(Ljava/lang/String;)Z

    move-result v11

    if-eqz v11, :cond_8

    invoke-virtual {v6, v9}, Lb/u;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    if-nez v11, :cond_9

    :cond_8
    sget-object v11, Lb/a/a;->a:Lb/a/a;

    invoke-virtual {v11, v7, v9, v10}, Lb/a/a;->a(Lb/v;Ljava/lang/String;Ljava/lang/String;)V

    :cond_9
    add-int/lit8 v0, v0, 0x1

    goto :goto_3

    :catchall_0
    move-exception v1

    if-eqz v0, :cond_a

    invoke-virtual {v0}, Lb/ai;->a()Lb/ak;

    move-result-object v0

    invoke-static {v0}, Lb/a/c;->a(Ljava/io/Closeable;)V

    :cond_a
    throw v1

    :cond_b
    invoke-virtual {v5}, Lb/ai;->e()Lb/u;

    move-result-object v0

    const-string v4, "Last-Modified"

    invoke-virtual {v0, v4}, Lb/u;->b(Ljava/lang/String;)Ljava/util/Date;

    move-result-object v0

    if-eqz v0, :cond_c

    invoke-virtual {v3}, Lb/ai;->e()Lb/u;

    move-result-object v4

    const-string v6, "Last-Modified"

    invoke-virtual {v4, v6}, Lb/u;->b(Ljava/lang/String;)Ljava/util/Date;

    move-result-object v4

    if-eqz v4, :cond_c

    invoke-virtual {v4}, Ljava/util/Date;->getTime()J

    move-result-wide v6

    invoke-virtual {v0}, Ljava/util/Date;->getTime()J

    move-result-wide v8

    cmp-long v0, v6, v8

    if-gez v0, :cond_c

    move v0, v2

    goto :goto_2

    :cond_c
    move v0, v1

    goto :goto_2

    :cond_d
    invoke-virtual {v6}, Lb/u;->b()I

    move-result v4

    move v0, v1

    :goto_4
    if-ge v0, v4, :cond_f

    invoke-virtual {v6, v0}, Lb/u;->a(I)Ljava/lang/String;

    move-result-object v1

    const-string v8, "Content-Length"

    invoke-virtual {v8, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v8

    if-nez v8, :cond_e

    invoke-static {v1}, Lb/a/a/a;->a(Ljava/lang/String;)Z

    move-result v8

    if-eqz v8, :cond_e

    sget-object v8, Lb/a/a;->a:Lb/a/a;

    invoke-virtual {v6, v0}, Lb/u;->b(I)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v7, v1, v9}, Lb/a/a;->a(Lb/v;Ljava/lang/String;Ljava/lang/String;)V

    :cond_e
    add-int/lit8 v0, v0, 0x1

    goto :goto_4

    :cond_f
    invoke-virtual {v7}, Lb/v;->a()Lb/u;

    move-result-object v0

    invoke-virtual {v2, v0}, Lb/aj;->a(Lb/u;)Lb/aj;

    move-result-object v0

    invoke-static {v5}, Lb/a/a/a;->a(Lb/ai;)Lb/ai;

    move-result-object v1

    invoke-virtual {v0, v1}, Lb/aj;->a(Lb/ai;)Lb/aj;

    move-result-object v0

    invoke-static {v3}, Lb/a/a/a;->a(Lb/ai;)Lb/ai;

    move-result-object v1

    invoke-virtual {v0, v1}, Lb/aj;->b(Lb/ai;)Lb/aj;

    move-result-object v0

    invoke-virtual {v0}, Lb/aj;->a()Lb/ai;

    move-result-object v0

    invoke-virtual {v3}, Lb/ai;->a()Lb/ak;

    move-result-object v1

    invoke-virtual {v1}, Lb/ak;->close()V

    iget-object v1, p0, Lb/a/a/a;->a:Lb/a/a/h;

    invoke-interface {v1}, Lb/a/a/h;->a()V

    iget-object v1, p0, Lb/a/a/a;->a:Lb/a/a/h;

    invoke-interface {v1, v5, v0}, Lb/a/a/h;->a(Lb/ai;Lb/ai;)V

    goto/16 :goto_1

    :cond_10
    invoke-virtual {v5}, Lb/ai;->a()Lb/ak;

    move-result-object v0

    invoke-static {v0}, Lb/a/c;->a(Ljava/io/Closeable;)V

    :cond_11
    invoke-virtual {v3}, Lb/ai;->f()Lb/aj;

    move-result-object v0

    invoke-static {v5}, Lb/a/a/a;->a(Lb/ai;)Lb/ai;

    move-result-object v1

    invoke-virtual {v0, v1}, Lb/aj;->a(Lb/ai;)Lb/aj;

    move-result-object v0

    invoke-static {v3}, Lb/a/a/a;->a(Lb/ai;)Lb/ai;

    move-result-object v1

    invoke-virtual {v0, v1}, Lb/aj;->b(Lb/ai;)Lb/aj;

    move-result-object v0

    invoke-virtual {v0}, Lb/aj;->a()Lb/ai;

    move-result-object v0

    invoke-static {v0}, Lb/a/d/m;->b(Lb/ai;)Z

    move-result v1

    if-eqz v1, :cond_2

    invoke-virtual {v3}, Lb/ai;->h()Lb/af;

    move-result-object v1

    iget-object v2, p0, Lb/a/a/a;->a:Lb/a/a/h;

    invoke-static {v0, v1, v2}, Lb/a/a/a;->a(Lb/ai;Lb/af;Lb/a/a/h;)Lb/a/a/b;

    move-result-object v1

    if-eqz v1, :cond_2

    invoke-interface {v1}, Lb/a/a/b;->b()Lc/m;

    move-result-object v2

    if-eqz v2, :cond_2

    new-instance v3, Lb/a/a/j;

    invoke-virtual {v0}, Lb/ai;->a()Lb/ak;

    move-result-object v4

    invoke-virtual {v4}, Lb/ak;->b()Lc/e;

    move-result-object v4

    invoke-static {v2}, Lc/l;->a(Lc/m;)Lc/d;

    move-result-object v2

    invoke-direct {v3, p0, v4, v1, v2}, Lb/a/a/j;-><init>(Lb/a/a/a;Lc/e;Lb/a/a/b;Lc/d;)V

    invoke-virtual {v0}, Lb/ai;->f()Lb/aj;

    move-result-object v1

    new-instance v2, Lb/a/d/q;

    invoke-virtual {v0}, Lb/ai;->e()Lb/u;

    move-result-object v0

    invoke-static {v3}, Lc/l;->a(Lc/n;)Lc/e;

    move-result-object v3

    invoke-direct {v2, v0, v3}, Lb/a/d/q;-><init>(Lb/u;Lc/e;)V

    invoke-virtual {v1, v2}, Lb/aj;->a(Lb/ak;)Lb/aj;

    move-result-object v0

    invoke-virtual {v0}, Lb/aj;->a()Lb/ai;

    move-result-object v0

    goto/16 :goto_1
.end method
