80 lines
1.7 KiB
Smali
80 lines
1.7 KiB
Smali
.class public Lorg/apache/http/protocol/RequestConnControl;
|
|
.super Ljava/lang/Object;
|
|
.source "RequestConnControl.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/apache/http/HttpRequestInterceptor;
|
|
|
|
|
|
# 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/HttpRequest;Lorg/apache/http/protocol/HttpContext;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lorg/apache/http/HttpException;,
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
.line 1
|
|
invoke-interface {p1}, Lorg/apache/http/HttpRequest;->getRequestLine()Lorg/apache/http/RequestLine;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p2}, Lorg/apache/http/RequestLine;->getMethod()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v0, "CONNECT"
|
|
|
|
.line 2
|
|
invoke-virtual {p2, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p2, "Connection"
|
|
|
|
.line 3
|
|
invoke-interface {p1, p2}, Lorg/apache/http/HttpMessage;->containsHeader(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const-string v0, "Keep-Alive"
|
|
|
|
.line 4
|
|
invoke-interface {p1, p2, v0}, Lorg/apache/http/HttpMessage;->addHeader(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
.line 5
|
|
:cond_2
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "HTTP request may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|