181 lines
3.9 KiB
Smali
181 lines
3.9 KiB
Smali
.class public Lorg/apache/http/protocol/ResponseConnControl;
|
|
.super Ljava/lang/Object;
|
|
.source "ResponseConnControl.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/apache/http/HttpResponseInterceptor;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public process(Lorg/apache/http/HttpResponse;Lorg/apache/http/protocol/HttpContext;)V
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lorg/apache/http/HttpException;,
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
if-eqz p2, :cond_5
|
|
|
|
.line 1
|
|
invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Lorg/apache/http/StatusLine;->getStatusCode()I
|
|
|
|
move-result v0
|
|
|
|
const/16 v1, 0x190
|
|
|
|
const-string v2, "Close"
|
|
|
|
const-string v3, "Connection"
|
|
|
|
if-eq v0, v1, :cond_4
|
|
|
|
const/16 v1, 0x198
|
|
|
|
if-eq v0, v1, :cond_4
|
|
|
|
const/16 v1, 0x19b
|
|
|
|
if-eq v0, v1, :cond_4
|
|
|
|
const/16 v1, 0x19d
|
|
|
|
if-eq v0, v1, :cond_4
|
|
|
|
const/16 v1, 0x19e
|
|
|
|
if-eq v0, v1, :cond_4
|
|
|
|
const/16 v1, 0x1f7
|
|
|
|
if-eq v0, v1, :cond_4
|
|
|
|
const/16 v1, 0x1f5
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 2
|
|
:cond_0
|
|
invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 3
|
|
invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Lorg/apache/http/StatusLine;->getProtocolVersion()Lorg/apache/http/ProtocolVersion;
|
|
|
|
move-result-object v1
|
|
|
|
.line 4
|
|
invoke-interface {v0}, Lorg/apache/http/HttpEntity;->getContentLength()J
|
|
|
|
move-result-wide v4
|
|
|
|
const-wide/16 v6, 0x0
|
|
|
|
cmp-long v4, v4, v6
|
|
|
|
if-gez v4, :cond_2
|
|
|
|
invoke-interface {v0}, Lorg/apache/http/HttpEntity;->isChunked()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
sget-object v0, Lorg/apache/http/HttpVersion;->HTTP_1_0:Lorg/apache/http/HttpVersion;
|
|
|
|
invoke-virtual {v1, v0}, Lorg/apache/http/ProtocolVersion;->lessEquals(Lorg/apache/http/ProtocolVersion;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 5
|
|
:cond_1
|
|
invoke-interface {p1, v3, v2}, Lorg/apache/http/HttpMessage;->setHeader(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
const-string v0, "http.request"
|
|
|
|
.line 6
|
|
invoke-interface {p2, v0}, Lorg/apache/http/protocol/HttpContext;->getAttribute(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lorg/apache/http/HttpRequest;
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
.line 7
|
|
invoke-interface {p2, v3}, Lorg/apache/http/HttpMessage;->getFirstHeader(Ljava/lang/String;)Lorg/apache/http/Header;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
.line 8
|
|
invoke-interface {p2}, Lorg/apache/http/Header;->getValue()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p1, v3, p2}, Lorg/apache/http/HttpMessage;->setHeader(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:cond_3
|
|
return-void
|
|
|
|
.line 9
|
|
:cond_4
|
|
:goto_0
|
|
invoke-interface {p1, v3, v2}, Lorg/apache/http/HttpMessage;->setHeader(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 10
|
|
:cond_5
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "HTTP context may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 11
|
|
:cond_6
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "HTTP response may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|