Http2Connection.smali
.class public final Lokhttp3/internal/http2/Http2Connection;
.super Ljava/lang/Object;
.source "Http2Connection.java"
# interfaces
.implements Ljava/io/Closeable;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokhttp3/internal/http2/Http2Connection$Listener;,
Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;,
Lokhttp3/internal/http2/Http2Connection$Builder;,
Lokhttp3/internal/http2/Http2Connection$PingRunnable;
}
.end annotation
# static fields
.field static final synthetic $assertionsDisabled:Z = false
.field static final OKHTTP_CLIENT_WINDOW_SIZE:I = 0x1000000
.field private static final listenerExecutor:Ljava/util/concurrent/ExecutorService;
# instance fields
.field private awaitingPong:Z
.field bytesLeftInWriteWindow:J
.field final client:Z
.field final currentPushRequests:Ljava/util/Set;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Set<",
"Ljava/lang/Integer;",
">;"
}
.end annotation
.end field
.field final hostname:Ljava/lang/String;
.field lastGoodStreamId:I
.field final listener:Lokhttp3/internal/http2/Http2Connection$Listener;
.field nextStreamId:I
.field okHttpSettings:Lokhttp3/internal/http2/Settings;
.field final peerSettings:Lokhttp3/internal/http2/Settings;
.field private final pushExecutor:Ljava/util/concurrent/ExecutorService;
.field final pushObserver:Lokhttp3/internal/http2/PushObserver;
.field final readerRunnable:Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;
.field receivedInitialPeerSettings:Z
.field shutdown:Z
.field final socket:Ljava/net/Socket;
.field final streams:Ljava/util/Map;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Map<",
"Ljava/lang/Integer;",
"Lokhttp3/internal/http2/Http2Stream;",
">;"
}
.end annotation
.end field
.field unacknowledgedBytesRead:J
.field final writer:Lokhttp3/internal/http2/Http2Writer;
.field private final writerExecutor:Ljava/util/concurrent/ScheduledExecutorService;
# direct methods
.method static constructor <clinit>()V
.registers 9
.line 60
nop
.line 80
new-instance v8, Ljava/util/concurrent/ThreadPoolExecutor;
const/4 v1, 0x0
const v2, 0x7fffffff
const-wide/16 v3, 0x3c
sget-object v5, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
new-instance v6, Ljava/util/concurrent/SynchronousQueue;
invoke-direct {v6}, Ljava/util/concurrent/SynchronousQueue;-><init>()V
const/4 v0, 0x1
.line 82
const-string v7, "OkHttp Http2Connection"
invoke-static {v7, v0}, Lokhttp3/internal/Util;->threadFactory(Ljava/lang/String;Z)Ljava/util/concurrent/ThreadFactory;
move-result-object v7
move-object v0, v8
invoke-direct/range {v0 .. v7}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
sput-object v8, Lokhttp3/internal/http2/Http2Connection;->listenerExecutor:Ljava/util/concurrent/ExecutorService;
.line 80
return-void
.end method
.method constructor <init>(Lokhttp3/internal/http2/Http2Connection$Builder;)V
.registers 23
.param p1, "builder" # Lokhttp3/internal/http2/Http2Connection$Builder;
.line 137
move-object/from16 v0, p0
move-object/from16 v1, p1
invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V
.line 92
new-instance v2, Ljava/util/LinkedHashMap;
invoke-direct {v2}, Ljava/util/LinkedHashMap;-><init>()V
iput-object v2, v0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
.line 115
const-wide/16 v2, 0x0
iput-wide v2, v0, Lokhttp3/internal/http2/Http2Connection;->unacknowledgedBytesRead:J
.line 124
new-instance v2, Lokhttp3/internal/http2/Settings;
invoke-direct {v2}, Lokhttp3/internal/http2/Settings;-><init>()V
iput-object v2, v0, Lokhttp3/internal/http2/Http2Connection;->okHttpSettings:Lokhttp3/internal/http2/Settings;
.line 128
new-instance v2, Lokhttp3/internal/http2/Settings;
invoke-direct {v2}, Lokhttp3/internal/http2/Settings;-><init>()V
iput-object v2, v0, Lokhttp3/internal/http2/Http2Connection;->peerSettings:Lokhttp3/internal/http2/Settings;
.line 130
const/4 v2, 0x0
iput-boolean v2, v0, Lokhttp3/internal/http2/Http2Connection;->receivedInitialPeerSettings:Z
.line 829
new-instance v3, Ljava/util/LinkedHashSet;
invoke-direct {v3}, Ljava/util/LinkedHashSet;-><init>()V
iput-object v3, v0, Lokhttp3/internal/http2/Http2Connection;->currentPushRequests:Ljava/util/Set;
.line 138
iget-object v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->pushObserver:Lokhttp3/internal/http2/PushObserver;
iput-object v3, v0, Lokhttp3/internal/http2/Http2Connection;->pushObserver:Lokhttp3/internal/http2/PushObserver;
.line 139
iget-boolean v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->client:Z
iput-boolean v3, v0, Lokhttp3/internal/http2/Http2Connection;->client:Z
.line 140
iget-object v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->listener:Lokhttp3/internal/http2/Http2Connection$Listener;
iput-object v3, v0, Lokhttp3/internal/http2/Http2Connection;->listener:Lokhttp3/internal/http2/Http2Connection$Listener;
.line 142
iget-boolean v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->client:Z
const/4 v4, 0x2
const/4 v5, 0x1
if-eqz v3, :cond_3e
const/4 v3, 0x1
goto :goto_3f
:cond_3e
const/4 v3, 0x2
:goto_3f
iput v3, v0, Lokhttp3/internal/http2/Http2Connection;->nextStreamId:I
.line 143
iget-boolean v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->client:Z
if-eqz v3, :cond_4a
.line 144
iget v3, v0, Lokhttp3/internal/http2/Http2Connection;->nextStreamId:I
add-int/2addr v3, v4
iput v3, v0, Lokhttp3/internal/http2/Http2Connection;->nextStreamId:I
.line 151
:cond_4a
iget-boolean v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->client:Z
const/4 v4, 0x7
if-eqz v3, :cond_56
.line 152
iget-object v3, v0, Lokhttp3/internal/http2/Http2Connection;->okHttpSettings:Lokhttp3/internal/http2/Settings;
const/high16 v6, 0x1000000
invoke-virtual {v3, v4, v6}, Lokhttp3/internal/http2/Settings;->set(II)Lokhttp3/internal/http2/Settings;
.line 155
:cond_56
iget-object v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->hostname:Ljava/lang/String;
iput-object v3, v0, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
.line 157
new-instance v3, Ljava/util/concurrent/ScheduledThreadPoolExecutor;
new-array v6, v5, [Ljava/lang/Object;
iget-object v7, v0, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
aput-object v7, v6, v2
.line 158
const-string v7, "OkHttp %s Writer"
invoke-static {v7, v6}, Lokhttp3/internal/Util;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v6
invoke-static {v6, v2}, Lokhttp3/internal/Util;->threadFactory(Ljava/lang/String;Z)Ljava/util/concurrent/ThreadFactory;
move-result-object v6
invoke-direct {v3, v5, v6}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;-><init>(ILjava/util/concurrent/ThreadFactory;)V
iput-object v3, v0, Lokhttp3/internal/http2/Http2Connection;->writerExecutor:Ljava/util/concurrent/ScheduledExecutorService;
.line 159
iget v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->pingIntervalMillis:I
if-eqz v3, :cond_87
.line 160
iget-object v6, v0, Lokhttp3/internal/http2/Http2Connection;->writerExecutor:Ljava/util/concurrent/ScheduledExecutorService;
new-instance v7, Lokhttp3/internal/http2/Http2Connection$PingRunnable;
invoke-direct {v7, v0, v2, v2, v2}, Lokhttp3/internal/http2/Http2Connection$PingRunnable;-><init>(Lokhttp3/internal/http2/Http2Connection;ZII)V
iget v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->pingIntervalMillis:I
int-to-long v8, v3
iget v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->pingIntervalMillis:I
int-to-long v10, v3
sget-object v12, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invoke-interface/range {v6 .. v12}, Ljava/util/concurrent/ScheduledExecutorService;->scheduleAtFixedRate(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
.line 165
:cond_87
new-instance v3, Ljava/util/concurrent/ThreadPoolExecutor;
const/4 v14, 0x0
const/4 v15, 0x1
const-wide/16 v16, 0x3c
sget-object v18, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
new-instance v19, Ljava/util/concurrent/LinkedBlockingQueue;
invoke-direct/range {v19 .. v19}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V
new-array v6, v5, [Ljava/lang/Object;
iget-object v7, v0, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
aput-object v7, v6, v2
.line 167
const-string v2, "OkHttp %s Push Observer"
invoke-static {v2, v6}, Lokhttp3/internal/Util;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v2
invoke-static {v2, v5}, Lokhttp3/internal/Util;->threadFactory(Ljava/lang/String;Z)Ljava/util/concurrent/ThreadFactory;
move-result-object v20
move-object v13, v3
invoke-direct/range {v13 .. v20}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
iput-object v3, v0, Lokhttp3/internal/http2/Http2Connection;->pushExecutor:Ljava/util/concurrent/ExecutorService;
.line 168
iget-object v2, v0, Lokhttp3/internal/http2/Http2Connection;->peerSettings:Lokhttp3/internal/http2/Settings;
const v3, 0xffff
invoke-virtual {v2, v4, v3}, Lokhttp3/internal/http2/Settings;->set(II)Lokhttp3/internal/http2/Settings;
.line 169
iget-object v2, v0, Lokhttp3/internal/http2/Http2Connection;->peerSettings:Lokhttp3/internal/http2/Settings;
const/4 v3, 0x5
const/16 v4, 0x4000
invoke-virtual {v2, v3, v4}, Lokhttp3/internal/http2/Settings;->set(II)Lokhttp3/internal/http2/Settings;
.line 170
iget-object v2, v0, Lokhttp3/internal/http2/Http2Connection;->peerSettings:Lokhttp3/internal/http2/Settings;
invoke-virtual {v2}, Lokhttp3/internal/http2/Settings;->getInitialWindowSize()I
move-result v2
int-to-long v2, v2
iput-wide v2, v0, Lokhttp3/internal/http2/Http2Connection;->bytesLeftInWriteWindow:J
.line 171
iget-object v2, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->socket:Ljava/net/Socket;
iput-object v2, v0, Lokhttp3/internal/http2/Http2Connection;->socket:Ljava/net/Socket;
.line 172
new-instance v2, Lokhttp3/internal/http2/Http2Writer;
iget-object v3, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->sink:Lokio/BufferedSink;
iget-boolean v4, v0, Lokhttp3/internal/http2/Http2Connection;->client:Z
invoke-direct {v2, v3, v4}, Lokhttp3/internal/http2/Http2Writer;-><init>(Lokio/BufferedSink;Z)V
iput-object v2, v0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
.line 174
new-instance v2, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;
new-instance v3, Lokhttp3/internal/http2/Http2Reader;
iget-object v4, v1, Lokhttp3/internal/http2/Http2Connection$Builder;->source:Lokio/BufferedSource;
iget-boolean v5, v0, Lokhttp3/internal/http2/Http2Connection;->client:Z
invoke-direct {v3, v4, v5}, Lokhttp3/internal/http2/Http2Reader;-><init>(Lokio/BufferedSource;Z)V
invoke-direct {v2, v0, v3}, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;-><init>(Lokhttp3/internal/http2/Http2Connection;Lokhttp3/internal/http2/Http2Reader;)V
iput-object v2, v0, Lokhttp3/internal/http2/Http2Connection;->readerRunnable:Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;
.line 175
return-void
.end method
.method static synthetic access$000(Lokhttp3/internal/http2/Http2Connection;)V
.registers 1
.param p0, "x0" # Lokhttp3/internal/http2/Http2Connection;
.line 60
invoke-direct {p0}, Lokhttp3/internal/http2/Http2Connection;->failConnection()V
return-void
.end method
.method static synthetic access$100()Ljava/util/concurrent/ExecutorService;
.registers 1
.line 60
sget-object v0, Lokhttp3/internal/http2/Http2Connection;->listenerExecutor:Ljava/util/concurrent/ExecutorService;
return-object v0
.end method
.method static synthetic access$200(Lokhttp3/internal/http2/Http2Connection;)Ljava/util/concurrent/ScheduledExecutorService;
.registers 2
.param p0, "x0" # Lokhttp3/internal/http2/Http2Connection;
.line 60
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writerExecutor:Ljava/util/concurrent/ScheduledExecutorService;
return-object v0
.end method
.method static synthetic access$302(Lokhttp3/internal/http2/Http2Connection;Z)Z
.registers 2
.param p0, "x0" # Lokhttp3/internal/http2/Http2Connection;
.param p1, "x1" # Z
.line 60
iput-boolean p1, p0, Lokhttp3/internal/http2/Http2Connection;->awaitingPong:Z
return p1
.end method
.method private failConnection()V
.registers 3
.line 494
:try_start_0
sget-object v0, Lokhttp3/internal/http2/ErrorCode;->PROTOCOL_ERROR:Lokhttp3/internal/http2/ErrorCode;
sget-object v1, Lokhttp3/internal/http2/ErrorCode;->PROTOCOL_ERROR:Lokhttp3/internal/http2/ErrorCode;
invoke-virtual {p0, v0, v1}, Lokhttp3/internal/http2/Http2Connection;->close(Lokhttp3/internal/http2/ErrorCode;Lokhttp3/internal/http2/ErrorCode;)V
:try_end_7
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_7} :catch_8
.line 496
goto :goto_9
.line 495
:catch_8
move-exception v0
.line 497
:goto_9
return-void
.end method
.method private newStream(ILjava/util/List;Z)Lokhttp3/internal/http2/Http2Stream;
.registers 15
.param p1, "associatedStreamId" # I
.param p3, "out" # Z
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Ljava/util/List<",
"Lokhttp3/internal/http2/Header;",
">;Z)",
"Lokhttp3/internal/http2/Http2Stream;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 235
.local p2, "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
xor-int/lit8 v0, p3, 0x1
.line 236
.local v0, "outFinished":Z
const/4 v7, 0x0
.line 241
.local v7, "inFinished":Z
iget-object v8, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
monitor-enter v8
.line 242
:try_start_6
monitor-enter p0
:try_end_7
.catchall {:try_start_6 .. :try_end_7} :catchall_7b
.line 243
:try_start_7
iget v1, p0, Lokhttp3/internal/http2/Http2Connection;->nextStreamId:I
const v2, 0x3fffffff # 1.9999999f
if-le v1, v2, :cond_13
.line 244
sget-object v1, Lokhttp3/internal/http2/ErrorCode;->REFUSED_STREAM:Lokhttp3/internal/http2/ErrorCode;
invoke-virtual {p0, v1}, Lokhttp3/internal/http2/Http2Connection;->shutdown(Lokhttp3/internal/http2/ErrorCode;)V
.line 246
:cond_13
iget-boolean v1, p0, Lokhttp3/internal/http2/Http2Connection;->shutdown:Z
if-nez v1, :cond_72
.line 249
iget v1, p0, Lokhttp3/internal/http2/Http2Connection;->nextStreamId:I
move v9, v1
.line 250
.local v9, "streamId":I
iget v1, p0, Lokhttp3/internal/http2/Http2Connection;->nextStreamId:I
add-int/lit8 v1, v1, 0x2
iput v1, p0, Lokhttp3/internal/http2/Http2Connection;->nextStreamId:I
.line 251
new-instance v10, Lokhttp3/internal/http2/Http2Stream;
move-object v1, v10
move v2, v9
move-object v3, p0
move v4, v0
move v5, v7
move-object v6, p2
invoke-direct/range {v1 .. v6}, Lokhttp3/internal/http2/Http2Stream;-><init>(ILokhttp3/internal/http2/Http2Connection;ZZLjava/util/List;)V
move-object v1, v10
.line 252
.local v1, "stream":Lokhttp3/internal/http2/Http2Stream;
if-eqz p3, :cond_3f
iget-wide v2, p0, Lokhttp3/internal/http2/Http2Connection;->bytesLeftInWriteWindow:J
const-wide/16 v4, 0x0
cmp-long v6, v2, v4
if-eqz v6, :cond_3f
iget-wide v2, v1, Lokhttp3/internal/http2/Http2Stream;->bytesLeftInWriteWindow:J
cmp-long v6, v2, v4
if-nez v6, :cond_3d
goto :goto_3f
:cond_3d
const/4 v2, 0x0
goto :goto_40
:cond_3f
:goto_3f
const/4 v2, 0x1
.line 253
.local v2, "flushHeaders":Z
:goto_40
invoke-virtual {v1}, Lokhttp3/internal/http2/Http2Stream;->isOpen()Z
move-result v3
if-eqz v3, :cond_4f
.line 254
iget-object v3, p0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
invoke-interface {v3, v4, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 256
:cond_4f
monitor-exit p0
:try_end_50
.catchall {:try_start_7 .. :try_end_50} :catchall_78
.line 257
if-nez p1, :cond_58
.line 258
:try_start_52
iget-object v3, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v3, v0, v9, p1, p2}, Lokhttp3/internal/http2/Http2Writer;->synStream(ZIILjava/util/List;)V
goto :goto_61
.line 259
:cond_58
iget-boolean v3, p0, Lokhttp3/internal/http2/Http2Connection;->client:Z
if-nez v3, :cond_6a
.line 262
iget-object v3, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v3, p1, v9, p2}, Lokhttp3/internal/http2/Http2Writer;->pushPromise(IILjava/util/List;)V
.line 264
:goto_61
monitor-exit v8
:try_end_62
.catchall {:try_start_52 .. :try_end_62} :catchall_7b
.line 266
if-eqz v2, :cond_69
.line 267
iget-object v3, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v3}, Lokhttp3/internal/http2/Http2Writer;->flush()V
.line 270
:cond_69
return-object v1
.line 260
:cond_6a
:try_start_6a
new-instance v3, Ljava/lang/IllegalArgumentException;
const-string v4, "client streams shouldn\'t have associated stream IDs"
invoke-direct {v3, v4}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
.end local v0 # "outFinished":Z
.end local v7 # "inFinished":Z
.end local p1 # "associatedStreamId":I
.end local p2 # "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
.end local p3 # "out":Z
throw v3
:try_end_72
.catchall {:try_start_6a .. :try_end_72} :catchall_7b
.line 247
.end local v1 # "stream":Lokhttp3/internal/http2/Http2Stream;
.end local v2 # "flushHeaders":Z
.end local v9 # "streamId":I
.restart local v0 # "outFinished":Z
.restart local v7 # "inFinished":Z
.restart local p1 # "associatedStreamId":I
.restart local p2 # "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
.restart local p3 # "out":Z
:cond_72
:try_start_72
new-instance v1, Lokhttp3/internal/http2/ConnectionShutdownException;
invoke-direct {v1}, Lokhttp3/internal/http2/ConnectionShutdownException;-><init>()V
.end local v0 # "outFinished":Z
.end local v7 # "inFinished":Z
.end local p1 # "associatedStreamId":I
.end local p2 # "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
.end local p3 # "out":Z
throw v1
.line 256
.restart local v0 # "outFinished":Z
.restart local v7 # "inFinished":Z
.restart local p1 # "associatedStreamId":I
.restart local p2 # "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
.restart local p3 # "out":Z
:catchall_78
move-exception v1
monitor-exit p0
:try_end_7a
.catchall {:try_start_72 .. :try_end_7a} :catchall_78
.end local v0 # "outFinished":Z
.end local v7 # "inFinished":Z
.end local p1 # "associatedStreamId":I
.end local p2 # "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
.end local p3 # "out":Z
:try_start_7a
throw v1
.line 264
.restart local v0 # "outFinished":Z
.restart local v7 # "inFinished":Z
.restart local p1 # "associatedStreamId":I
.restart local p2 # "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
.restart local p3 # "out":Z
:catchall_7b
move-exception v1
monitor-exit v8
:try_end_7d
.catchall {:try_start_7a .. :try_end_7d} :catchall_7b
throw v1
.end method
.method private declared-synchronized pushExecutorExecute(Lokhttp3/internal/NamedRunnable;)V
.registers 3
.param p1, "namedRunnable" # Lokhttp3/internal/NamedRunnable;
monitor-enter p0
.line 919
:try_start_1
invoke-virtual {p0}, Lokhttp3/internal/http2/Http2Connection;->isShutdown()Z
move-result v0
if-nez v0, :cond_c
.line 920
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->pushExecutor:Ljava/util/concurrent/ExecutorService;
invoke-interface {v0, p1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
:try_end_c
.catchall {:try_start_1 .. :try_end_c} :catchall_e
.line 922
.end local p0 # "this":Lokhttp3/internal/http2/Http2Connection;
:cond_c
monitor-exit p0
return-void
.line 918
.end local p1 # "namedRunnable":Lokhttp3/internal/NamedRunnable;
:catchall_e
move-exception p1
monitor-exit p0
throw p1
.end method
# virtual methods
.method declared-synchronized awaitPong()V
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
monitor-enter p0
.line 406
:goto_1
:try_start_1
iget-boolean v0, p0, Lokhttp3/internal/http2/Http2Connection;->awaitingPong:Z
if-eqz v0, :cond_9
.line 407
invoke-virtual {p0}, Ljava/lang/Object;->wait()V
:try_end_8
.catchall {:try_start_1 .. :try_end_8} :catchall_b
goto :goto_1
.line 409
.end local p0 # "this":Lokhttp3/internal/http2/Http2Connection;
:cond_9
monitor-exit p0
return-void
.line 405
:catchall_b
move-exception v0
monitor-exit p0
goto :goto_f
:goto_e
throw v0
:goto_f
goto :goto_e
.end method
.method public close()V
.registers 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 441
sget-object v0, Lokhttp3/internal/http2/ErrorCode;->NO_ERROR:Lokhttp3/internal/http2/ErrorCode;
sget-object v1, Lokhttp3/internal/http2/ErrorCode;->CANCEL:Lokhttp3/internal/http2/ErrorCode;
invoke-virtual {p0, v0, v1}, Lokhttp3/internal/http2/Http2Connection;->close(Lokhttp3/internal/http2/ErrorCode;Lokhttp3/internal/http2/ErrorCode;)V
.line 442
return-void
.end method
.method close(Lokhttp3/internal/http2/ErrorCode;Lokhttp3/internal/http2/ErrorCode;)V
.registers 9
.param p1, "connectionCode" # Lokhttp3/internal/http2/ErrorCode;
.param p2, "streamCode" # Lokhttp3/internal/http2/ErrorCode;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 445
nop
.line 446
const/4 v0, 0x0
.line 448
.local v0, "thrown":Ljava/io/IOException;
:try_start_2
invoke-virtual {p0, p1}, Lokhttp3/internal/http2/Http2Connection;->shutdown(Lokhttp3/internal/http2/ErrorCode;)V
:try_end_5
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_5} :catch_6
.line 451
goto :goto_8
.line 449
:catch_6
move-exception v1
.line 450
.local v1, "e":Ljava/io/IOException;
move-object v0, v1
.line 453
.end local v1 # "e":Ljava/io/IOException;
:goto_8
const/4 v1, 0x0
.line 454
.local v1, "streamsToClose":[Lokhttp3/internal/http2/Http2Stream;
monitor-enter p0
.line 455
:try_start_a
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
invoke-interface {v2}, Ljava/util/Map;->isEmpty()Z
move-result v2
if-nez v2, :cond_2c
.line 456
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
invoke-interface {v2}, Ljava/util/Map;->values()Ljava/util/Collection;
move-result-object v2
iget-object v3, p0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
invoke-interface {v3}, Ljava/util/Map;->size()I
move-result v3
new-array v3, v3, [Lokhttp3/internal/http2/Http2Stream;
invoke-interface {v2, v3}, Ljava/util/Collection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object v2
check-cast v2, [Lokhttp3/internal/http2/Http2Stream;
move-object v1, v2
.line 457
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
invoke-interface {v2}, Ljava/util/Map;->clear()V
.line 459
:cond_2c
monitor-exit p0
:try_end_2d
.catchall {:try_start_a .. :try_end_2d} :catchall_60
.line 461
if-eqz v1, :cond_40
.line 462
array-length v2, v1
const/4 v3, 0x0
:goto_31
if-ge v3, v2, :cond_40
aget-object v4, v1, v3
.line 464
.local v4, "stream":Lokhttp3/internal/http2/Http2Stream;
:try_start_35
invoke-virtual {v4, p2}, Lokhttp3/internal/http2/Http2Stream;->close(Lokhttp3/internal/http2/ErrorCode;)V
:try_end_38
.catch Ljava/io/IOException; {:try_start_35 .. :try_end_38} :catch_39
.line 467
goto :goto_3d
.line 465
:catch_39
move-exception v5
.line 466
.local v5, "e":Ljava/io/IOException;
if-eqz v0, :cond_3d
move-object v0, v5
.line 462
.end local v4 # "stream":Lokhttp3/internal/http2/Http2Stream;
.end local v5 # "e":Ljava/io/IOException;
:cond_3d
:goto_3d
add-int/lit8 v3, v3, 0x1
goto :goto_31
.line 473
:cond_40
:try_start_40
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v2}, Lokhttp3/internal/http2/Http2Writer;->close()V
:try_end_45
.catch Ljava/io/IOException; {:try_start_40 .. :try_end_45} :catch_46
.line 476
goto :goto_4a
.line 474
:catch_46
move-exception v2
.line 475
.local v2, "e":Ljava/io/IOException;
if-nez v0, :cond_4a
move-object v0, v2
.line 480
.end local v2 # "e":Ljava/io/IOException;
:cond_4a
:goto_4a
:try_start_4a
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->socket:Ljava/net/Socket;
invoke-virtual {v2}, Ljava/net/Socket;->close()V
:try_end_4f
.catch Ljava/io/IOException; {:try_start_4a .. :try_end_4f} :catch_50
.line 483
goto :goto_52
.line 481
:catch_50
move-exception v2
.line 482
.restart local v2 # "e":Ljava/io/IOException;
move-object v0, v2
.line 486
.end local v2 # "e":Ljava/io/IOException;
:goto_52
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->writerExecutor:Ljava/util/concurrent/ScheduledExecutorService;
invoke-interface {v2}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V
.line 487
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->pushExecutor:Ljava/util/concurrent/ExecutorService;
invoke-interface {v2}, Ljava/util/concurrent/ExecutorService;->shutdown()V
.line 489
if-nez v0, :cond_5f
.line 490
return-void
.line 489
:cond_5f
throw v0
.line 459
:catchall_60
move-exception v2
:try_start_61
monitor-exit p0
:try_end_62
.catchall {:try_start_61 .. :try_end_62} :catchall_60
goto :goto_64
:goto_63
throw v2
:goto_64
goto :goto_63
.end method
.method public flush()V
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 412
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Writer;->flush()V
.line 413
return-void
.end method
.method public getProtocol()Lokhttp3/Protocol;
.registers 2
.line 179
sget-object v0, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
return-object v0
.end method
.method declared-synchronized getStream(I)Lokhttp3/internal/http2/Http2Stream;
.registers 4
.param p1, "id" # I
monitor-enter p0
.line 190
:try_start_1
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lokhttp3/internal/http2/Http2Stream;
:try_end_d
.catchall {:try_start_1 .. :try_end_d} :catchall_f
monitor-exit p0
return-object v0
.end local p0 # "this":Lokhttp3/internal/http2/Http2Connection;
.end local p1 # "id":I
:catchall_f
move-exception p1
monitor-exit p0
throw p1
.end method
.method public declared-synchronized isShutdown()Z
.registers 2
monitor-enter p0
.line 537
:try_start_1
iget-boolean v0, p0, Lokhttp3/internal/http2/Http2Connection;->shutdown:Z
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
.end local p0 # "this":Lokhttp3/internal/http2/Http2Connection;
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method public declared-synchronized maxConcurrentStreams()I
.registers 3
monitor-enter p0
.line 200
:try_start_1
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->peerSettings:Lokhttp3/internal/http2/Settings;
const v1, 0x7fffffff
invoke-virtual {v0, v1}, Lokhttp3/internal/http2/Settings;->getMaxConcurrentStreams(I)I
move-result v0
:try_end_a
.catchall {:try_start_1 .. :try_end_a} :catchall_c
monitor-exit p0
return v0
.end local p0 # "this":Lokhttp3/internal/http2/Http2Connection;
:catchall_c
move-exception v0
monitor-exit p0
throw v0
.end method
.method public newStream(Ljava/util/List;Z)Lokhttp3/internal/http2/Http2Stream;
.registers 4
.param p2, "out" # Z
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Lokhttp3/internal/http2/Header;",
">;Z)",
"Lokhttp3/internal/http2/Http2Stream;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 230
.local p1, "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
const/4 v0, 0x0
invoke-direct {p0, v0, p1, p2}, Lokhttp3/internal/http2/Http2Connection;->newStream(ILjava/util/List;Z)Lokhttp3/internal/http2/Http2Stream;
move-result-object v0
return-object v0
.end method
.method public declared-synchronized openStreamCount()I
.registers 2
monitor-enter p0
.line 186
:try_start_1
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
invoke-interface {v0}, Ljava/util/Map;->size()I
move-result v0
:try_end_7
.catchall {:try_start_1 .. :try_end_7} :catchall_9
monitor-exit p0
return v0
.end local p0 # "this":Lokhttp3/internal/http2/Http2Connection;
:catchall_9
move-exception v0
monitor-exit p0
throw v0
.end method
.method pushDataLater(ILokio/BufferedSource;IZ)V
.registers 15
.param p1, "streamId" # I
.param p2, "source" # Lokio/BufferedSource;
.param p3, "byteCount" # I
.param p4, "inFinished" # Z
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 887
new-instance v0, Lokio/Buffer;
invoke-direct {v0}, Lokio/Buffer;-><init>()V
.line 888
.local v0, "buffer":Lokio/Buffer;
int-to-long v1, p3
invoke-interface {p2, v1, v2}, Lokio/BufferedSource;->require(J)V
.line 889
int-to-long v1, p3
invoke-interface {p2, v0, v1, v2}, Lokio/BufferedSource;->read(Lokio/Buffer;J)J
.line 890
invoke-virtual {v0}, Lokio/Buffer;->size()J
move-result-wide v1
int-to-long v3, p3
cmp-long v5, v1, v3
if-nez v5, :cond_36
.line 891
new-instance v9, Lokhttp3/internal/http2/Http2Connection$5;
const/4 v1, 0x2
new-array v4, v1, [Ljava/lang/Object;
const/4 v1, 0x0
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
aput-object v2, v4, v1
const/4 v1, 0x1
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v4, v1
const-string v3, "OkHttp %s Push Data[%s]"
move-object v1, v9
move-object v2, p0
move v5, p1
move-object v6, v0
move v7, p3
move v8, p4
invoke-direct/range {v1 .. v8}, Lokhttp3/internal/http2/Http2Connection$5;-><init>(Lokhttp3/internal/http2/Http2Connection;Ljava/lang/String;[Ljava/lang/Object;ILokio/Buffer;IZ)V
invoke-direct {p0, v9}, Lokhttp3/internal/http2/Http2Connection;->pushExecutorExecute(Lokhttp3/internal/NamedRunnable;)V
.line 905
return-void
.line 890
:cond_36
new-instance v1, Ljava/io/IOException;
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0}, Lokio/Buffer;->size()J
move-result-wide v3
invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
const-string v3, " != "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-direct {v1, v2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v1
.end method
.method pushHeadersLater(ILjava/util/List;Z)V
.registers 12
.param p1, "streamId" # I
.param p3, "inFinished" # Z
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Ljava/util/List<",
"Lokhttp3/internal/http2/Header;",
">;Z)V"
}
.end annotation
.line 862
.local p2, "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
:try_start_0
new-instance v7, Lokhttp3/internal/http2/Http2Connection$4;
const-string v2, "OkHttp %s Push Headers[%s]"
const/4 v0, 0x2
new-array v3, v0, [Ljava/lang/Object;
const/4 v0, 0x0
iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
aput-object v1, v3, v0
const/4 v0, 0x1
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
aput-object v1, v3, v0
move-object v0, v7
move-object v1, p0
move v4, p1
move-object v5, p2
move v6, p3
invoke-direct/range {v0 .. v6}, Lokhttp3/internal/http2/Http2Connection$4;-><init>(Lokhttp3/internal/http2/Http2Connection;Ljava/lang/String;[Ljava/lang/Object;ILjava/util/List;Z)V
invoke-direct {p0, v7}, Lokhttp3/internal/http2/Http2Connection;->pushExecutorExecute(Lokhttp3/internal/NamedRunnable;)V
:try_end_1e
.catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_0 .. :try_end_1e} :catch_1f
.line 878
goto :goto_20
.line 876
:catch_1f
move-exception v0
.line 879
:goto_20
return-void
.end method
.method pushRequestLater(ILjava/util/List;)V
.registers 11
.param p1, "streamId" # I
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Ljava/util/List<",
"Lokhttp3/internal/http2/Header;",
">;)V"
}
.end annotation
.line 832
.local p2, "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
monitor-enter p0
.line 833
:try_start_1
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->currentPushRequests:Ljava/util/Set;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_14
.line 834
sget-object v0, Lokhttp3/internal/http2/ErrorCode;->PROTOCOL_ERROR:Lokhttp3/internal/http2/ErrorCode;
invoke-virtual {p0, p1, v0}, Lokhttp3/internal/http2/Http2Connection;->writeSynResetLater(ILokhttp3/internal/http2/ErrorCode;)V
.line 835
monitor-exit p0
return-void
.line 837
:cond_14
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->currentPushRequests:Ljava/util/Set;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-interface {v0, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
.line 838
monitor-exit p0
:try_end_1e
.catchall {:try_start_1 .. :try_end_1e} :catchall_3e
.line 840
:try_start_1e
new-instance v0, Lokhttp3/internal/http2/Http2Connection$3;
const-string v4, "OkHttp %s Push Request[%s]"
const/4 v1, 0x2
new-array v5, v1, [Ljava/lang/Object;
const/4 v1, 0x0
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
aput-object v2, v5, v1
const/4 v1, 0x1
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v5, v1
move-object v2, v0
move-object v3, p0
move v6, p1
move-object v7, p2
invoke-direct/range {v2 .. v7}, Lokhttp3/internal/http2/Http2Connection$3;-><init>(Lokhttp3/internal/http2/Http2Connection;Ljava/lang/String;[Ljava/lang/Object;ILjava/util/List;)V
invoke-direct {p0, v0}, Lokhttp3/internal/http2/Http2Connection;->pushExecutorExecute(Lokhttp3/internal/NamedRunnable;)V
:try_end_3b
.catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_1e .. :try_end_3b} :catch_3c
.line 856
goto :goto_3d
.line 854
:catch_3c
move-exception v0
.line 857
:goto_3d
return-void
.line 838
:catchall_3e
move-exception v0
:try_start_3f
monitor-exit p0
:try_end_40
.catchall {:try_start_3f .. :try_end_40} :catchall_3e
throw v0
.end method
.method pushResetLater(ILokhttp3/internal/http2/ErrorCode;)V
.registers 10
.param p1, "streamId" # I
.param p2, "errorCode" # Lokhttp3/internal/http2/ErrorCode;
.line 908
new-instance v6, Lokhttp3/internal/http2/Http2Connection$6;
const/4 v0, 0x2
new-array v3, v0, [Ljava/lang/Object;
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
const/4 v1, 0x0
aput-object v0, v3, v1
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
const/4 v1, 0x1
aput-object v0, v3, v1
const-string v2, "OkHttp %s Push Reset[%s]"
move-object v0, v6
move-object v1, p0
move v4, p1
move-object v5, p2
invoke-direct/range {v0 .. v5}, Lokhttp3/internal/http2/Http2Connection$6;-><init>(Lokhttp3/internal/http2/Http2Connection;Ljava/lang/String;[Ljava/lang/Object;ILokhttp3/internal/http2/ErrorCode;)V
invoke-direct {p0, v6}, Lokhttp3/internal/http2/Http2Connection;->pushExecutorExecute(Lokhttp3/internal/NamedRunnable;)V
.line 916
return-void
.end method
.method public pushStream(ILjava/util/List;Z)Lokhttp3/internal/http2/Http2Stream;
.registers 6
.param p1, "associatedStreamId" # I
.param p3, "out" # Z
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Ljava/util/List<",
"Lokhttp3/internal/http2/Header;",
">;Z)",
"Lokhttp3/internal/http2/Http2Stream;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 220
.local p2, "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
iget-boolean v0, p0, Lokhttp3/internal/http2/Http2Connection;->client:Z
if-nez v0, :cond_9
.line 221
invoke-direct {p0, p1, p2, p3}, Lokhttp3/internal/http2/Http2Connection;->newStream(ILjava/util/List;Z)Lokhttp3/internal/http2/Http2Stream;
move-result-object v0
return-object v0
.line 220
:cond_9
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Client cannot push requests."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method pushedStream(I)Z
.registers 3
.param p1, "streamId" # I
.line 825
if-eqz p1, :cond_8
and-int/lit8 v0, p1, 0x1
if-nez v0, :cond_8
const/4 v0, 0x1
goto :goto_9
:cond_8
const/4 v0, 0x0
:goto_9
return v0
.end method
.method declared-synchronized removeStream(I)Lokhttp3/internal/http2/Http2Stream;
.registers 4
.param p1, "streamId" # I
monitor-enter p0
.line 194
:try_start_1
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-interface {v0, v1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lokhttp3/internal/http2/Http2Stream;
.line 195
.local v0, "stream":Lokhttp3/internal/http2/Http2Stream;
invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
:try_end_10
.catchall {:try_start_1 .. :try_end_10} :catchall_12
.line 196
monitor-exit p0
return-object v0
.line 193
.end local v0 # "stream":Lokhttp3/internal/http2/Http2Stream;
.end local p0 # "this":Lokhttp3/internal/http2/Http2Connection;
.end local p1 # "streamId":I
:catchall_12
move-exception p1
monitor-exit p0
throw p1
.end method
.method public setSettings(Lokhttp3/internal/http2/Settings;)V
.registers 4
.param p1, "settings" # Lokhttp3/internal/http2/Settings;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 525
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
monitor-enter v0
.line 526
:try_start_3
monitor-enter p0
:try_end_4
.catchall {:try_start_3 .. :try_end_4} :catchall_1e
.line 527
:try_start_4
iget-boolean v1, p0, Lokhttp3/internal/http2/Http2Connection;->shutdown:Z
if-nez v1, :cond_15
.line 530
iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection;->okHttpSettings:Lokhttp3/internal/http2/Settings;
invoke-virtual {v1, p1}, Lokhttp3/internal/http2/Settings;->merge(Lokhttp3/internal/http2/Settings;)V
.line 531
monitor-exit p0
:try_end_e
.catchall {:try_start_4 .. :try_end_e} :catchall_1b
.line 532
:try_start_e
iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v1, p1}, Lokhttp3/internal/http2/Http2Writer;->settings(Lokhttp3/internal/http2/Settings;)V
.line 533
monitor-exit v0
:try_end_14
.catchall {:try_start_e .. :try_end_14} :catchall_1e
.line 534
return-void
.line 528
:cond_15
:try_start_15
new-instance v1, Lokhttp3/internal/http2/ConnectionShutdownException;
invoke-direct {v1}, Lokhttp3/internal/http2/ConnectionShutdownException;-><init>()V
.end local p1 # "settings":Lokhttp3/internal/http2/Settings;
throw v1
.line 531
.restart local p1 # "settings":Lokhttp3/internal/http2/Settings;
:catchall_1b
move-exception v1
monitor-exit p0
:try_end_1d
.catchall {:try_start_15 .. :try_end_1d} :catchall_1b
.end local p1 # "settings":Lokhttp3/internal/http2/Settings;
:try_start_1d
throw v1
.line 533
.restart local p1 # "settings":Lokhttp3/internal/http2/Settings;
:catchall_1e
move-exception v1
monitor-exit v0
:try_end_20
.catchall {:try_start_1d .. :try_end_20} :catchall_1e
throw v1
.end method
.method public shutdown(Lokhttp3/internal/http2/ErrorCode;)V
.registers 6
.param p1, "statusCode" # Lokhttp3/internal/http2/ErrorCode;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 421
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
monitor-enter v0
.line 423
:try_start_3
monitor-enter p0
:try_end_4
.catchall {:try_start_3 .. :try_end_4} :catchall_1d
.line 424
:try_start_4
iget-boolean v1, p0, Lokhttp3/internal/http2/Http2Connection;->shutdown:Z
if-eqz v1, :cond_b
.line 425
monitor-exit p0
:try_end_9
.catchall {:try_start_4 .. :try_end_9} :catchall_1a
:try_start_9
monitor-exit v0
:try_end_a
.catchall {:try_start_9 .. :try_end_a} :catchall_1d
return-void
.line 427
:cond_b
const/4 v1, 0x1
:try_start_c
iput-boolean v1, p0, Lokhttp3/internal/http2/Http2Connection;->shutdown:Z
.line 428
iget v1, p0, Lokhttp3/internal/http2/Http2Connection;->lastGoodStreamId:I
.line 429
.local v1, "lastGoodStreamId":I
monitor-exit p0
:try_end_11
.catchall {:try_start_c .. :try_end_11} :catchall_1a
.line 432
:try_start_11
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
sget-object v3, Lokhttp3/internal/Util;->EMPTY_BYTE_ARRAY:[B
invoke-virtual {v2, v1, p1, v3}, Lokhttp3/internal/http2/Http2Writer;->goAway(ILokhttp3/internal/http2/ErrorCode;[B)V
.line 433
.end local v1 # "lastGoodStreamId":I
monitor-exit v0
:try_end_19
.catchall {:try_start_11 .. :try_end_19} :catchall_1d
.line 434
return-void
.line 429
:catchall_1a
move-exception v1
:try_start_1b
monitor-exit p0
:try_end_1c
.catchall {:try_start_1b .. :try_end_1c} :catchall_1a
.end local p1 # "statusCode":Lokhttp3/internal/http2/ErrorCode;
:try_start_1c
throw v1
.line 433
.restart local p1 # "statusCode":Lokhttp3/internal/http2/ErrorCode;
:catchall_1d
move-exception v1
monitor-exit v0
:try_end_1f
.catchall {:try_start_1c .. :try_end_1f} :catchall_1d
throw v1
.end method
.method public start()V
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 504
const/4 v0, 0x1
invoke-virtual {p0, v0}, Lokhttp3/internal/http2/Http2Connection;->start(Z)V
.line 505
return-void
.end method
.method start(Z)V
.registers 8
.param p1, "sendConnectionPreface" # Z
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 512
if-eqz p1, :cond_22
.line 513
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Writer;->connectionPreface()V
.line 514
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection;->okHttpSettings:Lokhttp3/internal/http2/Settings;
invoke-virtual {v0, v1}, Lokhttp3/internal/http2/Http2Writer;->settings(Lokhttp3/internal/http2/Settings;)V
.line 515
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->okHttpSettings:Lokhttp3/internal/http2/Settings;
invoke-virtual {v0}, Lokhttp3/internal/http2/Settings;->getInitialWindowSize()I
move-result v0
.line 516
.local v0, "windowSize":I
const v1, 0xffff
if-eq v0, v1, :cond_22
.line 517
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
const/4 v3, 0x0
sub-int v1, v0, v1
int-to-long v4, v1
invoke-virtual {v2, v3, v4, v5}, Lokhttp3/internal/http2/Http2Writer;->windowUpdate(IJ)V
.line 520
.end local v0 # "windowSize":I
:cond_22
new-instance v0, Ljava/lang/Thread;
iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection;->readerRunnable:Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;
invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V
invoke-virtual {v0}, Ljava/lang/Thread;->start()V
.line 521
return-void
.end method
.method declared-synchronized updateConnectionFlowControl(J)V
.registers 8
.param p1, "read" # J
monitor-enter p0
.line 204
:try_start_1
iget-wide v0, p0, Lokhttp3/internal/http2/Http2Connection;->unacknowledgedBytesRead:J
add-long/2addr v0, p1
iput-wide v0, p0, Lokhttp3/internal/http2/Http2Connection;->unacknowledgedBytesRead:J
.line 205
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->okHttpSettings:Lokhttp3/internal/http2/Settings;
invoke-virtual {v2}, Lokhttp3/internal/http2/Settings;->getInitialWindowSize()I
move-result v2
div-int/lit8 v2, v2, 0x2
int-to-long v2, v2
cmp-long v4, v0, v2
if-ltz v4, :cond_1d
.line 206
const/4 v0, 0x0
iget-wide v1, p0, Lokhttp3/internal/http2/Http2Connection;->unacknowledgedBytesRead:J
invoke-virtual {p0, v0, v1, v2}, Lokhttp3/internal/http2/Http2Connection;->writeWindowUpdateLater(IJ)V
.line 207
const-wide/16 v0, 0x0
iput-wide v0, p0, Lokhttp3/internal/http2/Http2Connection;->unacknowledgedBytesRead:J
:try_end_1d
.catchall {:try_start_1 .. :try_end_1d} :catchall_1f
.line 209
.end local p0 # "this":Lokhttp3/internal/http2/Http2Connection;
:cond_1d
monitor-exit p0
return-void
.line 203
.end local p1 # "read":J
:catchall_1f
move-exception p1
monitor-exit p0
throw p1
.end method
.method public writeData(IZLokio/Buffer;J)V
.registers 14
.param p1, "streamId" # I
.param p2, "outFinished" # Z
.param p3, "buffer" # Lokio/Buffer;
.param p4, "byteCount" # J
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 292
const/4 v0, 0x0
const-wide/16 v1, 0x0
cmp-long v3, p4, v1
if-nez v3, :cond_d
.line 293
iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v1, p2, p1, p3, v0}, Lokhttp3/internal/http2/Http2Writer;->data(ZILokio/Buffer;I)V
.line 294
return-void
.line 297
:cond_d
:goto_d
cmp-long v3, p4, v1
if-lez v3, :cond_6c
.line 299
monitor-enter p0
.line 301
:goto_12
:try_start_12
iget-wide v3, p0, Lokhttp3/internal/http2/Http2Connection;->bytesLeftInWriteWindow:J
cmp-long v5, v3, v1
if-gtz v5, :cond_30
.line 304
iget-object v3, p0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
invoke-interface {v3, v4}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_28
.line 307
invoke-virtual {p0}, Ljava/lang/Object;->wait()V
goto :goto_12
.line 305
:cond_28
new-instance v0, Ljava/io/IOException;
const-string v1, "stream closed"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
.end local p1 # "streamId":I
.end local p2 # "outFinished":Z
.end local p3 # "buffer":Lokio/Buffer;
.end local p4 # "byteCount":J
throw v0
:try_end_30
.catch Ljava/lang/InterruptedException; {:try_start_12 .. :try_end_30} :catch_5c
.catchall {:try_start_12 .. :try_end_30} :catchall_5a
.line 312
.restart local p1 # "streamId":I
.restart local p2 # "outFinished":Z
.restart local p3 # "buffer":Lokio/Buffer;
.restart local p4 # "byteCount":J
:cond_30
nop
.line 314
:try_start_31
iget-wide v3, p0, Lokhttp3/internal/http2/Http2Connection;->bytesLeftInWriteWindow:J
invoke-static {p4, p5, v3, v4}, Ljava/lang/Math;->min(JJ)J
move-result-wide v3
long-to-int v4, v3
.line 315
.local v4, "toWrite":I
iget-object v3, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v3}, Lokhttp3/internal/http2/Http2Writer;->maxDataLength()I
move-result v3
invoke-static {v4, v3}, Ljava/lang/Math;->min(II)I
move-result v3
.line 316
.end local v4 # "toWrite":I
.local v3, "toWrite":I
iget-wide v4, p0, Lokhttp3/internal/http2/Http2Connection;->bytesLeftInWriteWindow:J
int-to-long v6, v3
sub-long/2addr v4, v6
iput-wide v4, p0, Lokhttp3/internal/http2/Http2Connection;->bytesLeftInWriteWindow:J
.line 317
monitor-exit p0
:try_end_49
.catchall {:try_start_31 .. :try_end_49} :catchall_5a
.line 319
int-to-long v4, v3
sub-long/2addr p4, v4
.line 320
iget-object v4, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
if-eqz p2, :cond_55
cmp-long v5, p4, v1
if-nez v5, :cond_55
const/4 v5, 0x1
goto :goto_56
:cond_55
const/4 v5, 0x0
:goto_56
invoke-virtual {v4, v5, p1, p3, v3}, Lokhttp3/internal/http2/Http2Writer;->data(ZILokio/Buffer;I)V
.line 321
.end local v3 # "toWrite":I
goto :goto_d
.line 317
:catchall_5a
move-exception v0
goto :goto_6a
.line 309
:catch_5c
move-exception v0
.line 310
.local v0, "e":Ljava/lang/InterruptedException;
:try_start_5d
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Thread;->interrupt()V
.line 311
new-instance v1, Ljava/io/InterruptedIOException;
invoke-direct {v1}, Ljava/io/InterruptedIOException;-><init>()V
.end local p1 # "streamId":I
.end local p2 # "outFinished":Z
.end local p3 # "buffer":Lokio/Buffer;
.end local p4 # "byteCount":J
throw v1
.line 317
.end local v0 # "e":Ljava/lang/InterruptedException;
.restart local p1 # "streamId":I
.restart local p2 # "outFinished":Z
.restart local p3 # "buffer":Lokio/Buffer;
.restart local p4 # "byteCount":J
:goto_6a
monitor-exit p0
:try_end_6b
.catchall {:try_start_5d .. :try_end_6b} :catchall_5a
throw v0
.line 322
:cond_6c
return-void
.end method
.method writePing(ZII)V
.registers 6
.param p1, "reply" # Z
.param p2, "payload1" # I
.param p3, "payload2" # I
.line 379
if-nez p1, :cond_12
.line 381
monitor-enter p0
.line 382
:try_start_3
iget-boolean v0, p0, Lokhttp3/internal/http2/Http2Connection;->awaitingPong:Z
.line 383
.local v0, "failedDueToMissingPong":Z
const/4 v1, 0x1
iput-boolean v1, p0, Lokhttp3/internal/http2/Http2Connection;->awaitingPong:Z
.line 384
monitor-exit p0
:try_end_9
.catchall {:try_start_3 .. :try_end_9} :catchall_f
.line 385
if-eqz v0, :cond_12
.line 386
invoke-direct {p0}, Lokhttp3/internal/http2/Http2Connection;->failConnection()V
.line 387
return-void
.line 384
.end local v0 # "failedDueToMissingPong":Z
:catchall_f
move-exception v0
:try_start_10
monitor-exit p0
:try_end_11
.catchall {:try_start_10 .. :try_end_11} :catchall_f
throw v0
.line 392
:cond_12
:try_start_12
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v0, p1, p2, p3}, Lokhttp3/internal/http2/Http2Writer;->ping(ZII)V
:try_end_17
.catch Ljava/io/IOException; {:try_start_12 .. :try_end_17} :catch_18
.line 395
goto :goto_1c
.line 393
:catch_18
move-exception v0
.line 394
.local v0, "e":Ljava/io/IOException;
invoke-direct {p0}, Lokhttp3/internal/http2/Http2Connection;->failConnection()V
.line 396
.end local v0 # "e":Ljava/io/IOException;
:goto_1c
return-void
.end method
.method writePingAndAwaitPong()V
.registers 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
.line 400
const/4 v0, 0x0
const v1, 0x4f4b6f6b
const v2, -0xf607257
invoke-virtual {p0, v0, v1, v2}, Lokhttp3/internal/http2/Http2Connection;->writePing(ZII)V
.line 401
invoke-virtual {p0}, Lokhttp3/internal/http2/Http2Connection;->awaitPong()V
.line 402
return-void
.end method
.method writeSynReply(IZLjava/util/List;)V
.registers 5
.param p1, "streamId" # I
.param p2, "outFinished" # Z
.annotation system Ldalvik/annotation/Signature;
value = {
"(IZ",
"Ljava/util/List<",
"Lokhttp3/internal/http2/Header;",
">;)V"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 275
.local p3, "alternating":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/http2/Header;>;"
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v0, p2, p1, p3}, Lokhttp3/internal/http2/Http2Writer;->synReply(ZILjava/util/List;)V
.line 276
return-void
.end method
.method writeSynReset(ILokhttp3/internal/http2/ErrorCode;)V
.registers 4
.param p1, "streamId" # I
.param p2, "statusCode" # Lokhttp3/internal/http2/ErrorCode;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 341
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writer:Lokhttp3/internal/http2/Http2Writer;
invoke-virtual {v0, p1, p2}, Lokhttp3/internal/http2/Http2Writer;->rstStream(ILokhttp3/internal/http2/ErrorCode;)V
.line 342
return-void
.end method
.method writeSynResetLater(ILokhttp3/internal/http2/ErrorCode;)V
.registers 11
.param p1, "streamId" # I
.param p2, "errorCode" # Lokhttp3/internal/http2/ErrorCode;
.line 326
:try_start_0
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writerExecutor:Ljava/util/concurrent/ScheduledExecutorService;
new-instance v7, Lokhttp3/internal/http2/Http2Connection$1;
const-string v3, "OkHttp %s stream %d"
const/4 v1, 0x2
new-array v4, v1, [Ljava/lang/Object;
const/4 v1, 0x0
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
aput-object v2, v4, v1
const/4 v1, 0x1
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v4, v1
move-object v1, v7
move-object v2, p0
move v5, p1
move-object v6, p2
invoke-direct/range {v1 .. v6}, Lokhttp3/internal/http2/Http2Connection$1;-><init>(Lokhttp3/internal/http2/Http2Connection;Ljava/lang/String;[Ljava/lang/Object;ILokhttp3/internal/http2/ErrorCode;)V
invoke-interface {v0, v7}, Ljava/util/concurrent/ScheduledExecutorService;->execute(Ljava/lang/Runnable;)V
:try_end_1f
.catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_0 .. :try_end_1f} :catch_20
.line 337
goto :goto_21
.line 335
:catch_20
move-exception v0
.line 338
:goto_21
return-void
.end method
.method writeWindowUpdateLater(IJ)V
.registers 13
.param p1, "streamId" # I
.param p2, "unacknowledgedBytesRead" # J
.line 346
:try_start_0
iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection;->writerExecutor:Ljava/util/concurrent/ScheduledExecutorService;
new-instance v8, Lokhttp3/internal/http2/Http2Connection$2;
const-string v3, "OkHttp Window Update %s stream %d"
const/4 v1, 0x2
new-array v4, v1, [Ljava/lang/Object;
const/4 v1, 0x0
iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
aput-object v2, v4, v1
const/4 v1, 0x1
.line 347
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
aput-object v2, v4, v1
move-object v1, v8
move-object v2, p0
move v5, p1
move-wide v6, p2
invoke-direct/range {v1 .. v7}, Lokhttp3/internal/http2/Http2Connection$2;-><init>(Lokhttp3/internal/http2/Http2Connection;Ljava/lang/String;[Ljava/lang/Object;IJ)V
.line 346
invoke-interface {v0, v8}, Ljava/util/concurrent/ScheduledExecutorService;->execute(Ljava/lang/Runnable;)V
:try_end_1f
.catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_0 .. :try_end_1f} :catch_20
.line 358
goto :goto_21
.line 356
:catch_20
move-exception v0
.line 359
:goto_21
return-void
.end method