apkfuckery/com.discord/smali/okhttp3/internal/framed/FramedStream.smali
2019-02-04 21:05:16 +01:00

1413 lines
38 KiB
Smali

.class public final Lokhttp3/internal/framed/FramedStream;
.super Ljava/lang/Object;
.source "FramedStream.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokhttp3/internal/framed/FramedStream$StreamTimeout;,
Lokhttp3/internal/framed/FramedStream$FramedDataSink;,
Lokhttp3/internal/framed/FramedStream$FramedDataSource;
}
.end annotation
# static fields
.field static final synthetic $assertionsDisabled:Z
# instance fields
.field bytesLeftInWriteWindow:J
.field private final connection:Lokhttp3/internal/framed/FramedConnection;
.field private errorCode:Lokhttp3/internal/framed/ErrorCode;
.field private final id:I
.field private final readTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
.field private final requestHeaders:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List",
"<",
"Lokhttp3/internal/framed/Header;",
">;"
}
.end annotation
.end field
.field private responseHeaders:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List",
"<",
"Lokhttp3/internal/framed/Header;",
">;"
}
.end annotation
.end field
.field final sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
.field private final source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
.field unacknowledgedBytesRead:J
.field private final writeTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
const-class v0, Lokhttp3/internal/framed/FramedStream;
invoke-virtual {v0}, Ljava/lang/Class;->desiredAssertionStatus()Z
move-result v0
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
sput-boolean v0, Lokhttp3/internal/framed/FramedStream;->$assertionsDisabled:Z
return-void
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method constructor <init>(ILokhttp3/internal/framed/FramedConnection;ZZLjava/util/List;)V
.locals 5
.param p1, "id" # I
.param p2, "connection" # Lokhttp3/internal/framed/FramedConnection;
.param p3, "outFinished" # Z
.param p4, "inFinished" # Z
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Lokhttp3/internal/framed/FramedConnection;",
"ZZ",
"Ljava/util/List",
"<",
"Lokhttp3/internal/framed/Header;",
">;)V"
}
.end annotation
.prologue
.local p5, "requestHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/framed/Header;>;"
const/4 v4, 0x0
const/high16 v2, 0x10000
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const-wide/16 v0, 0x0
iput-wide v0, p0, Lokhttp3/internal/framed/FramedStream;->unacknowledgedBytesRead:J
new-instance v0, Lokhttp3/internal/framed/FramedStream$StreamTimeout;
invoke-direct {v0, p0}, Lokhttp3/internal/framed/FramedStream$StreamTimeout;-><init>(Lokhttp3/internal/framed/FramedStream;)V
iput-object v0, p0, Lokhttp3/internal/framed/FramedStream;->readTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
new-instance v0, Lokhttp3/internal/framed/FramedStream$StreamTimeout;
invoke-direct {v0, p0}, Lokhttp3/internal/framed/FramedStream$StreamTimeout;-><init>(Lokhttp3/internal/framed/FramedStream;)V
iput-object v0, p0, Lokhttp3/internal/framed/FramedStream;->writeTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
iput-object v4, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
if-nez p2, :cond_0
new-instance v0, Ljava/lang/NullPointerException;
const-string v1, "connection == null"
invoke-direct {v0, v1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw v0
:cond_0
if-nez p5, :cond_1
new-instance v0, Ljava/lang/NullPointerException;
const-string v1, "requestHeaders == null"
invoke-direct {v0, v1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw v0
:cond_1
iput p1, p0, Lokhttp3/internal/framed/FramedStream;->id:I
iput-object p2, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
iget-object v0, p2, Lokhttp3/internal/framed/FramedConnection;->peerSettings:Lokhttp3/internal/framed/Settings;
invoke-virtual {v0, v2}, Lokhttp3/internal/framed/Settings;->getInitialWindowSize(I)I
move-result v0
int-to-long v0, v0
iput-wide v0, p0, Lokhttp3/internal/framed/FramedStream;->bytesLeftInWriteWindow:J
new-instance v0, Lokhttp3/internal/framed/FramedStream$FramedDataSource;
iget-object v1, p2, Lokhttp3/internal/framed/FramedConnection;->okHttpSettings:Lokhttp3/internal/framed/Settings;
invoke-virtual {v1, v2}, Lokhttp3/internal/framed/Settings;->getInitialWindowSize(I)I
move-result v1
int-to-long v2, v1
invoke-direct {v0, p0, v2, v3, v4}, Lokhttp3/internal/framed/FramedStream$FramedDataSource;-><init>(Lokhttp3/internal/framed/FramedStream;JLokhttp3/internal/framed/FramedStream$1;)V
iput-object v0, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
new-instance v0, Lokhttp3/internal/framed/FramedStream$FramedDataSink;
invoke-direct {v0, p0}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;-><init>(Lokhttp3/internal/framed/FramedStream;)V
iput-object v0, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
invoke-static {v0, p4}, Lokhttp3/internal/framed/FramedStream$FramedDataSource;->access$102(Lokhttp3/internal/framed/FramedStream$FramedDataSource;Z)Z
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
invoke-static {v0, p3}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;->access$202(Lokhttp3/internal/framed/FramedStream$FramedDataSink;Z)Z
iput-object p5, p0, Lokhttp3/internal/framed/FramedStream;->requestHeaders:Ljava/util/List;
return-void
.end method
.method static synthetic access$1000(Lokhttp3/internal/framed/FramedStream;)V
.locals 0
.param p0, "x0" # Lokhttp3/internal/framed/FramedStream;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
invoke-direct {p0}, Lokhttp3/internal/framed/FramedStream;->cancelStreamIfNecessary()V
return-void
.end method
.method static synthetic access$1100(Lokhttp3/internal/framed/FramedStream;)Lokhttp3/internal/framed/FramedStream$StreamTimeout;
.locals 1
.param p0, "x0" # Lokhttp3/internal/framed/FramedStream;
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->writeTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
return-object v0
.end method
.method static synthetic access$1200(Lokhttp3/internal/framed/FramedStream;)V
.locals 0
.param p0, "x0" # Lokhttp3/internal/framed/FramedStream;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
invoke-direct {p0}, Lokhttp3/internal/framed/FramedStream;->checkOutNotClosed()V
return-void
.end method
.method static synthetic access$500(Lokhttp3/internal/framed/FramedStream;)Lokhttp3/internal/framed/FramedConnection;
.locals 1
.param p0, "x0" # Lokhttp3/internal/framed/FramedStream;
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
return-object v0
.end method
.method static synthetic access$600(Lokhttp3/internal/framed/FramedStream;)I
.locals 1
.param p0, "x0" # Lokhttp3/internal/framed/FramedStream;
.prologue
iget v0, p0, Lokhttp3/internal/framed/FramedStream;->id:I
return v0
.end method
.method static synthetic access$700(Lokhttp3/internal/framed/FramedStream;)Lokhttp3/internal/framed/FramedStream$StreamTimeout;
.locals 1
.param p0, "x0" # Lokhttp3/internal/framed/FramedStream;
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->readTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
return-object v0
.end method
.method static synthetic access$800(Lokhttp3/internal/framed/FramedStream;)Lokhttp3/internal/framed/ErrorCode;
.locals 1
.param p0, "x0" # Lokhttp3/internal/framed/FramedStream;
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
return-object v0
.end method
.method static synthetic access$900(Lokhttp3/internal/framed/FramedStream;)V
.locals 0
.param p0, "x0" # Lokhttp3/internal/framed/FramedStream;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/InterruptedIOException;
}
.end annotation
.prologue
invoke-direct {p0}, Lokhttp3/internal/framed/FramedStream;->waitForIo()V
return-void
.end method
.method private cancelStreamIfNecessary()V
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
sget-boolean v2, Lokhttp3/internal/framed/FramedStream;->$assertionsDisabled:Z
if-nez v2, :cond_0
invoke-static {p0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
new-instance v2, Ljava/lang/AssertionError;
invoke-direct {v2}, Ljava/lang/AssertionError;-><init>()V
throw v2
:cond_0
monitor-enter p0
:try_start_0
iget-object v2, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
invoke-static {v2}, Lokhttp3/internal/framed/FramedStream$FramedDataSource;->access$100(Lokhttp3/internal/framed/FramedStream$FramedDataSource;)Z
move-result v2
if-nez v2, :cond_3
iget-object v2, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
invoke-static {v2}, Lokhttp3/internal/framed/FramedStream$FramedDataSource;->access$300(Lokhttp3/internal/framed/FramedStream$FramedDataSource;)Z
move-result v2
if-eqz v2, :cond_3
iget-object v2, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
invoke-static {v2}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;->access$200(Lokhttp3/internal/framed/FramedStream$FramedDataSink;)Z
move-result v2
if-nez v2, :cond_1
iget-object v2, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
invoke-static {v2}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;->access$400(Lokhttp3/internal/framed/FramedStream$FramedDataSink;)Z
move-result v2
if-eqz v2, :cond_3
:cond_1
const/4 v0, 0x1
.local v0, "cancel":Z
:goto_0
invoke-virtual {p0}, Lokhttp3/internal/framed/FramedStream;->isOpen()Z
move-result v1
.local v1, "open":Z
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v0, :cond_4
sget-object v2, Lokhttp3/internal/framed/ErrorCode;->CANCEL:Lokhttp3/internal/framed/ErrorCode;
invoke-virtual {p0, v2}, Lokhttp3/internal/framed/FramedStream;->close(Lokhttp3/internal/framed/ErrorCode;)V
:cond_2
:goto_1
return-void
.end local v0 # "cancel":Z
.end local v1 # "open":Z
:cond_3
const/4 v0, 0x0
goto :goto_0
:catchall_0
move-exception v2
:try_start_1
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v2
.restart local v0 # "cancel":Z
.restart local v1 # "open":Z
:cond_4
if-nez v1, :cond_2
iget-object v2, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
iget v3, p0, Lokhttp3/internal/framed/FramedStream;->id:I
invoke-virtual {v2, v3}, Lokhttp3/internal/framed/FramedConnection;->removeStream(I)Lokhttp3/internal/framed/FramedStream;
goto :goto_1
.end method
.method private checkOutNotClosed()V
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
invoke-static {v0}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;->access$400(Lokhttp3/internal/framed/FramedStream$FramedDataSink;)Z
move-result v0
if-eqz v0, :cond_0
new-instance v0, Ljava/io/IOException;
const-string v1, "stream closed"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
:cond_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
invoke-static {v0}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;->access$200(Lokhttp3/internal/framed/FramedStream$FramedDataSink;)Z
move-result v0
if-eqz v0, :cond_1
new-instance v0, Ljava/io/IOException;
const-string v1, "stream finished"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
:cond_1
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
if-eqz v0, :cond_2
new-instance v0, Ljava/io/IOException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "stream was reset: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
:cond_2
return-void
.end method
.method private closeInternal(Lokhttp3/internal/framed/ErrorCode;)Z
.locals 2
.param p1, "errorCode" # Lokhttp3/internal/framed/ErrorCode;
.prologue
const/4 v0, 0x0
sget-boolean v1, Lokhttp3/internal/framed/FramedStream;->$assertionsDisabled:Z
if-nez v1, :cond_0
invoke-static {p0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:cond_0
monitor-enter p0
:try_start_0
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
if-eqz v1, :cond_1
monitor-exit p0
:goto_0
return v0
:cond_1
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
invoke-static {v1}, Lokhttp3/internal/framed/FramedStream$FramedDataSource;->access$100(Lokhttp3/internal/framed/FramedStream$FramedDataSource;)Z
move-result v1
if-eqz v1, :cond_2
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
invoke-static {v1}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;->access$200(Lokhttp3/internal/framed/FramedStream$FramedDataSink;)Z
move-result v1
if-eqz v1, :cond_2
monitor-exit p0
goto :goto_0
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
:cond_2
:try_start_1
iput-object p1, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
iget v1, p0, Lokhttp3/internal/framed/FramedStream;->id:I
invoke-virtual {v0, v1}, Lokhttp3/internal/framed/FramedConnection;->removeStream(I)Lokhttp3/internal/framed/FramedStream;
const/4 v0, 0x1
goto :goto_0
.end method
.method private waitForIo()V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/InterruptedIOException;
}
.end annotation
.prologue
:try_start_0
invoke-virtual {p0}, Ljava/lang/Object;->wait()V
:try_end_0
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
return-void
:catch_0
move-exception v0
.local v0, "e":Ljava/lang/InterruptedException;
new-instance v1, Ljava/io/InterruptedIOException;
invoke-direct {v1}, Ljava/io/InterruptedIOException;-><init>()V
throw v1
.end method
# virtual methods
.method addBytesToWriteWindow(J)V
.locals 3
.param p1, "delta" # J
.prologue
iget-wide v0, p0, Lokhttp3/internal/framed/FramedStream;->bytesLeftInWriteWindow:J
add-long/2addr v0, p1
iput-wide v0, p0, Lokhttp3/internal/framed/FramedStream;->bytesLeftInWriteWindow:J
const-wide/16 v0, 0x0
cmp-long v0, p1, v0
if-lez v0, :cond_0
invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
:cond_0
return-void
.end method
.method public close(Lokhttp3/internal/framed/ErrorCode;)V
.locals 2
.param p1, "rstStatusCode" # Lokhttp3/internal/framed/ErrorCode;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
invoke-direct {p0, p1}, Lokhttp3/internal/framed/FramedStream;->closeInternal(Lokhttp3/internal/framed/ErrorCode;)Z
move-result v0
if-nez v0, :cond_0
:goto_0
return-void
:cond_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
iget v1, p0, Lokhttp3/internal/framed/FramedStream;->id:I
invoke-virtual {v0, v1, p1}, Lokhttp3/internal/framed/FramedConnection;->writeSynReset(ILokhttp3/internal/framed/ErrorCode;)V
goto :goto_0
.end method
.method public closeLater(Lokhttp3/internal/framed/ErrorCode;)V
.locals 2
.param p1, "errorCode" # Lokhttp3/internal/framed/ErrorCode;
.prologue
invoke-direct {p0, p1}, Lokhttp3/internal/framed/FramedStream;->closeInternal(Lokhttp3/internal/framed/ErrorCode;)Z
move-result v0
if-nez v0, :cond_0
:goto_0
return-void
:cond_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
iget v1, p0, Lokhttp3/internal/framed/FramedStream;->id:I
invoke-virtual {v0, v1, p1}, Lokhttp3/internal/framed/FramedConnection;->writeSynResetLater(ILokhttp3/internal/framed/ErrorCode;)V
goto :goto_0
.end method
.method public getConnection()Lokhttp3/internal/framed/FramedConnection;
.locals 1
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
return-object v0
.end method
.method public declared-synchronized getErrorCode()Lokhttp3/internal/framed/ErrorCode;
.locals 1
.prologue
monitor-enter p0
:try_start_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-object v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public getId()I
.locals 1
.prologue
iget v0, p0, Lokhttp3/internal/framed/FramedStream;->id:I
return v0
.end method
.method public getRequestHeaders()Ljava/util/List;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List",
"<",
"Lokhttp3/internal/framed/Header;",
">;"
}
.end annotation
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->requestHeaders:Ljava/util/List;
return-object v0
.end method
.method public declared-synchronized getResponseHeaders()Ljava/util/List;
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List",
"<",
"Lokhttp3/internal/framed/Header;",
">;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
monitor-enter p0
:try_start_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->readTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
invoke-virtual {v0}, Lokhttp3/internal/framed/FramedStream$StreamTimeout;->enter()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
:goto_0
:try_start_1
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
if-nez v0, :cond_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
if-nez v0, :cond_0
invoke-direct {p0}, Lokhttp3/internal/framed/FramedStream;->waitForIo()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
goto :goto_0
:catchall_0
move-exception v0
:try_start_2
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->readTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
invoke-virtual {v1}, Lokhttp3/internal/framed/FramedStream$StreamTimeout;->exitAndThrowIfTimedOut()V
throw v0
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
:catchall_1
move-exception v0
monitor-exit p0
throw v0
:cond_0
:try_start_3
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->readTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
invoke-virtual {v0}, Lokhttp3/internal/framed/FramedStream$StreamTimeout;->exitAndThrowIfTimedOut()V
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
if-eqz v0, :cond_1
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
monitor-exit p0
return-object v0
:cond_1
:try_start_4
new-instance v0, Ljava/io/IOException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "stream was reset: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_1
.end method
.method public getSink()Lokio/Sink;
.locals 2
.prologue
monitor-enter p0
:try_start_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
if-nez v0, :cond_0
invoke-virtual {p0}, Lokhttp3/internal/framed/FramedStream;->isLocallyInitiated()Z
move-result v0
if-nez v0, :cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "reply before requesting the sink"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
:cond_0
:try_start_1
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
return-object v0
.end method
.method public getSource()Lokio/Source;
.locals 1
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
return-object v0
.end method
.method public isLocallyInitiated()Z
.locals 4
.prologue
const/4 v2, 0x0
const/4 v1, 0x1
iget v3, p0, Lokhttp3/internal/framed/FramedStream;->id:I
and-int/lit8 v3, v3, 0x1
if-ne v3, v1, :cond_0
move v0, v1
.local v0, "streamIsClient":Z
:goto_0
iget-object v3, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
iget-boolean v3, v3, Lokhttp3/internal/framed/FramedConnection;->client:Z
if-ne v3, v0, :cond_1
:goto_1
return v1
.end local v0 # "streamIsClient":Z
:cond_0
move v0, v2
goto :goto_0
.restart local v0 # "streamIsClient":Z
:cond_1
move v1, v2
goto :goto_1
.end method
.method public declared-synchronized isOpen()Z
.locals 2
.prologue
const/4 v0, 0x0
monitor-enter p0
:try_start_0
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v1, :cond_1
:cond_0
:goto_0
monitor-exit p0
return v0
:cond_1
:try_start_1
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
invoke-static {v1}, Lokhttp3/internal/framed/FramedStream$FramedDataSource;->access$100(Lokhttp3/internal/framed/FramedStream$FramedDataSource;)Z
move-result v1
if-nez v1, :cond_2
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
invoke-static {v1}, Lokhttp3/internal/framed/FramedStream$FramedDataSource;->access$300(Lokhttp3/internal/framed/FramedStream$FramedDataSource;)Z
move-result v1
if-eqz v1, :cond_4
:cond_2
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
invoke-static {v1}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;->access$200(Lokhttp3/internal/framed/FramedStream$FramedDataSink;)Z
move-result v1
if-nez v1, :cond_3
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
invoke-static {v1}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;->access$400(Lokhttp3/internal/framed/FramedStream$FramedDataSink;)Z
move-result v1
if-eqz v1, :cond_4
:cond_3
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
if-nez v1, :cond_0
:cond_4
const/4 v0, 0x1
goto :goto_0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public readTimeout()Lokio/Timeout;
.locals 1
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->readTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
return-object v0
.end method
.method receiveData(Lokio/BufferedSource;I)V
.locals 4
.param p1, "in" # Lokio/BufferedSource;
.param p2, "length" # I
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
sget-boolean v0, Lokhttp3/internal/framed/FramedStream;->$assertionsDisabled:Z
if-nez v0, :cond_0
invoke-static {p0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_0
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:cond_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
int-to-long v2, p2
invoke-virtual {v0, p1, v2, v3}, Lokhttp3/internal/framed/FramedStream$FramedDataSource;->receive(Lokio/BufferedSource;J)V
return-void
.end method
.method receiveFin()V
.locals 3
.prologue
sget-boolean v1, Lokhttp3/internal/framed/FramedStream;->$assertionsDisabled:Z
if-nez v1, :cond_0
invoke-static {p0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
new-instance v1, Ljava/lang/AssertionError;
invoke-direct {v1}, Ljava/lang/AssertionError;-><init>()V
throw v1
:cond_0
monitor-enter p0
:try_start_0
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->source:Lokhttp3/internal/framed/FramedStream$FramedDataSource;
const/4 v2, 0x1
invoke-static {v1, v2}, Lokhttp3/internal/framed/FramedStream$FramedDataSource;->access$102(Lokhttp3/internal/framed/FramedStream$FramedDataSource;Z)Z
invoke-virtual {p0}, Lokhttp3/internal/framed/FramedStream;->isOpen()Z
move-result v0
.local v0, "open":Z
invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-nez v0, :cond_1
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
iget v2, p0, Lokhttp3/internal/framed/FramedStream;->id:I
invoke-virtual {v1, v2}, Lokhttp3/internal/framed/FramedConnection;->removeStream(I)Lokhttp3/internal/framed/FramedStream;
:cond_1
return-void
.end local v0 # "open":Z
:catchall_0
move-exception v1
:try_start_1
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v1
.end method
.method receiveHeaders(Ljava/util/List;Lokhttp3/internal/framed/HeadersMode;)V
.locals 5
.param p2, "headersMode" # Lokhttp3/internal/framed/HeadersMode;
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<",
"Lokhttp3/internal/framed/Header;",
">;",
"Lokhttp3/internal/framed/HeadersMode;",
")V"
}
.end annotation
.prologue
.local p1, "headers":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/framed/Header;>;"
sget-boolean v3, Lokhttp3/internal/framed/FramedStream;->$assertionsDisabled:Z
if-nez v3, :cond_0
invoke-static {p0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_0
new-instance v3, Ljava/lang/AssertionError;
invoke-direct {v3}, Ljava/lang/AssertionError;-><init>()V
throw v3
:cond_0
const/4 v0, 0x0
.local v0, "errorCode":Lokhttp3/internal/framed/ErrorCode;
const/4 v2, 0x1
.local v2, "open":Z
monitor-enter p0
:try_start_0
iget-object v3, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
if-nez v3, :cond_3
invoke-virtual {p2}, Lokhttp3/internal/framed/HeadersMode;->failIfHeadersAbsent()Z
move-result v3
if-eqz v3, :cond_2
sget-object v0, Lokhttp3/internal/framed/ErrorCode;->PROTOCOL_ERROR:Lokhttp3/internal/framed/ErrorCode;
:goto_0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v0, :cond_5
invoke-virtual {p0, v0}, Lokhttp3/internal/framed/FramedStream;->closeLater(Lokhttp3/internal/framed/ErrorCode;)V
:cond_1
:goto_1
return-void
:cond_2
:try_start_1
iput-object p1, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
invoke-virtual {p0}, Lokhttp3/internal/framed/FramedStream;->isOpen()Z
move-result v2
invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
goto :goto_0
:catchall_0
move-exception v3
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v3
:cond_3
:try_start_2
invoke-virtual {p2}, Lokhttp3/internal/framed/HeadersMode;->failIfHeadersPresent()Z
move-result v3
if-eqz v3, :cond_4
sget-object v0, Lokhttp3/internal/framed/ErrorCode;->STREAM_IN_USE:Lokhttp3/internal/framed/ErrorCode;
goto :goto_0
:cond_4
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
.local v1, "newHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/framed/Header;>;"
iget-object v3, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
invoke-interface {v1, v3}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
invoke-interface {v1, p1}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
iput-object v1, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
goto :goto_0
.end local v1 # "newHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/framed/Header;>;"
:cond_5
if-nez v2, :cond_1
iget-object v3, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
iget v4, p0, Lokhttp3/internal/framed/FramedStream;->id:I
invoke-virtual {v3, v4}, Lokhttp3/internal/framed/FramedConnection;->removeStream(I)Lokhttp3/internal/framed/FramedStream;
goto :goto_1
.end method
.method declared-synchronized receiveRstStream(Lokhttp3/internal/framed/ErrorCode;)V
.locals 1
.param p1, "errorCode" # Lokhttp3/internal/framed/ErrorCode;
.prologue
monitor-enter p0
:try_start_0
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
if-nez v0, :cond_0
iput-object p1, p0, Lokhttp3/internal/framed/FramedStream;->errorCode:Lokhttp3/internal/framed/ErrorCode;
invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_0
monitor-exit p0
return-void
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public reply(Ljava/util/List;Z)V
.locals 3
.param p2, "out" # Z
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<",
"Lokhttp3/internal/framed/Header;",
">;Z)V"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
.local p1, "responseHeaders":Ljava/util/List;, "Ljava/util/List<Lokhttp3/internal/framed/Header;>;"
sget-boolean v1, Lokhttp3/internal/framed/FramedStream;->$assertionsDisabled:Z
if-nez v1, :cond_0
invoke-static {p0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
new-instance v1, Ljava/lang/AssertionError;
invoke-direct {v1}, Ljava/lang/AssertionError;-><init>()V
throw v1
:cond_0
const/4 v0, 0x0
.local v0, "outFinished":Z
monitor-enter p0
if-nez p1, :cond_1
:try_start_0
new-instance v1, Ljava/lang/NullPointerException;
const-string v2, "responseHeaders == null"
invoke-direct {v1, v2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw v1
:catchall_0
move-exception v1
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v1
:cond_1
:try_start_1
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
if-eqz v1, :cond_2
new-instance v1, Ljava/lang/IllegalStateException;
const-string v2, "reply already sent"
invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v1
:cond_2
iput-object p1, p0, Lokhttp3/internal/framed/FramedStream;->responseHeaders:Ljava/util/List;
if-nez p2, :cond_3
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->sink:Lokhttp3/internal/framed/FramedStream$FramedDataSink;
const/4 v2, 0x1
invoke-static {v1, v2}, Lokhttp3/internal/framed/FramedStream$FramedDataSink;->access$202(Lokhttp3/internal/framed/FramedStream$FramedDataSink;Z)Z
const/4 v0, 0x1
:cond_3
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
iget v2, p0, Lokhttp3/internal/framed/FramedStream;->id:I
invoke-virtual {v1, v2, v0, p1}, Lokhttp3/internal/framed/FramedConnection;->writeSynReply(IZLjava/util/List;)V
if-eqz v0, :cond_4
iget-object v1, p0, Lokhttp3/internal/framed/FramedStream;->connection:Lokhttp3/internal/framed/FramedConnection;
invoke-virtual {v1}, Lokhttp3/internal/framed/FramedConnection;->flush()V
:cond_4
return-void
.end method
.method public writeTimeout()Lokio/Timeout;
.locals 1
.prologue
iget-object v0, p0, Lokhttp3/internal/framed/FramedStream;->writeTimeout:Lokhttp3/internal/framed/FramedStream$StreamTimeout;
return-object v0
.end method