AdaptedHttpStack.smali
.class Lcom/mopub/volley/toolbox/AdaptedHttpStack;
.super Lcom/mopub/volley/toolbox/BaseHttpStack;
.source "SourceFile"
# instance fields
.field private final mHttpStack:Lcom/mopub/volley/toolbox/HttpStack;
# direct methods
.method constructor <init>(Lcom/mopub/volley/toolbox/HttpStack;)V
.registers 2
.line 41
invoke-direct {p0}, Lcom/mopub/volley/toolbox/BaseHttpStack;-><init>()V
.line 42
iput-object p1, p0, Lcom/mopub/volley/toolbox/AdaptedHttpStack;->mHttpStack:Lcom/mopub/volley/toolbox/HttpStack;
return-void
.end method
# virtual methods
.method public executeRequest(Lcom/mopub/volley/Request;Ljava/util/Map;)Lcom/mopub/volley/toolbox/HttpResponse;
.registers 10
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/mopub/volley/Request<",
"*>;",
"Ljava/util/Map<",
"Ljava/lang/String;",
"Ljava/lang/String;",
">;)",
"Lcom/mopub/volley/toolbox/HttpResponse;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;,
Lcom/mopub/volley/AuthFailureError;
}
.end annotation
.line 51
:try_start_0
iget-object v0, p0, Lcom/mopub/volley/toolbox/AdaptedHttpStack;->mHttpStack:Lcom/mopub/volley/toolbox/HttpStack;
invoke-interface {v0, p1, p2}, Lcom/mopub/volley/toolbox/HttpStack;->performRequest(Lcom/mopub/volley/Request;Ljava/util/Map;)Lorg/apache/http/HttpResponse;
move-result-object p1
:try_end_6
.catch Lorg/apache/http/conn/ConnectTimeoutException; {:try_start_0 .. :try_end_6} :catch_72
.line 58
invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;
move-result-object p2
invoke-interface {p2}, Lorg/apache/http/StatusLine;->getStatusCode()I
move-result p2
.line 60
invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getAllHeaders()[Lorg/apache/http/Header;
move-result-object v0
.line 61
new-instance v1, Ljava/util/ArrayList;
array-length v2, v0
invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(I)V
.line 62
array-length v2, v0
const/4 v3, 0x0
:goto_1a
if-ge v3, v2, :cond_31
aget-object v4, v0, v3
.line 63
new-instance v5, Lcom/mopub/volley/Header;
invoke-interface {v4}, Lorg/apache/http/Header;->getName()Ljava/lang/String;
move-result-object v6
invoke-interface {v4}, Lorg/apache/http/Header;->getValue()Ljava/lang/String;
move-result-object v4
invoke-direct {v5, v6, v4}, Lcom/mopub/volley/Header;-><init>(Ljava/lang/String;Ljava/lang/String;)V
invoke-interface {v1, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z
add-int/lit8 v3, v3, 0x1
goto :goto_1a
.line 66
:cond_31
invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;
move-result-object v0
if-nez v0, :cond_3d
.line 67
new-instance p1, Lcom/mopub/volley/toolbox/HttpResponse;
invoke-direct {p1, p2, v1}, Lcom/mopub/volley/toolbox/HttpResponse;-><init>(ILjava/util/List;)V
return-object p1
.line 70
:cond_3d
invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;
move-result-object v0
invoke-interface {v0}, Lorg/apache/http/HttpEntity;->getContentLength()J
move-result-wide v2
long-to-int v0, v2
int-to-long v4, v0
cmp-long v0, v4, v2
if-nez v0, :cond_62
.line 75
new-instance v0, Lcom/mopub/volley/toolbox/HttpResponse;
.line 78
invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;
move-result-object v2
invoke-interface {v2}, Lorg/apache/http/HttpEntity;->getContentLength()J
move-result-wide v2
long-to-int v3, v2
.line 79
invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;
move-result-object p1
invoke-interface {p1}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;
move-result-object p1
invoke-direct {v0, p2, v1, v3, p1}, Lcom/mopub/volley/toolbox/HttpResponse;-><init>(ILjava/util/List;ILjava/io/InputStream;)V
return-object v0
.line 72
:cond_62
new-instance p1, Ljava/io/IOException;
invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object p2
const-string v0, "Response too large: "
invoke-virtual {v0, p2}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p1
:catch_72
move-exception p1
.line 55
new-instance p2, Ljava/net/SocketTimeoutException;
invoke-virtual {p1}, Lorg/apache/http/conn/ConnectTimeoutException;->getMessage()Ljava/lang/String;
move-result-object p1
invoke-direct {p2, p1}, Ljava/net/SocketTimeoutException;-><init>(Ljava/lang/String;)V
goto :goto_7e
:goto_7d
throw p2
:goto_7e
goto :goto_7d
.end method