107 lines
2.5 KiB
Smali
107 lines
2.5 KiB
Smali
.class public Lorg/apache/http/protocol/RequestExpectContinue;
|
|
.super Ljava/lang/Object;
|
|
.source "RequestExpectContinue.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 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lorg/apache/http/HttpException;,
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 1
|
|
instance-of p2, p1, Lorg/apache/http/HttpEntityEnclosingRequest;
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
.line 2
|
|
move-object p2, p1
|
|
|
|
check-cast p2, Lorg/apache/http/HttpEntityEnclosingRequest;
|
|
|
|
invoke-interface {p2}, Lorg/apache/http/HttpEntityEnclosingRequest;->getEntity()Lorg/apache/http/HttpEntity;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
.line 3
|
|
invoke-interface {p2}, Lorg/apache/http/HttpEntity;->getContentLength()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long p2, v0, v2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
.line 4
|
|
invoke-interface {p1}, Lorg/apache/http/HttpRequest;->getRequestLine()Lorg/apache/http/RequestLine;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p2}, Lorg/apache/http/RequestLine;->getProtocolVersion()Lorg/apache/http/ProtocolVersion;
|
|
|
|
move-result-object p2
|
|
|
|
.line 5
|
|
invoke-interface {p1}, Lorg/apache/http/HttpMessage;->getParams()Lorg/apache/http/params/HttpParams;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lorg/apache/http/params/HttpProtocolParams;->useExpectContinue(Lorg/apache/http/params/HttpParams;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
sget-object v0, Lorg/apache/http/HttpVersion;->HTTP_1_0:Lorg/apache/http/HttpVersion;
|
|
|
|
invoke-virtual {p2, v0}, Lorg/apache/http/ProtocolVersion;->lessEquals(Lorg/apache/http/ProtocolVersion;)Z
|
|
|
|
move-result p2
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
const-string p2, "Expect"
|
|
|
|
const-string v0, "100-Continue"
|
|
|
|
.line 6
|
|
invoke-interface {p1, p2, v0}, Lorg/apache/http/HttpMessage;->addHeader(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
.line 7
|
|
:cond_1
|
|
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
|