117 lines
3.8 KiB
Smali
117 lines
3.8 KiB
Smali
.class public Lorg/apache/http/impl/io/HttpResponseParser;
|
|
.super Lorg/apache/http/impl/io/AbstractMessageParser;
|
|
.source "HttpResponseParser.java"
|
|
|
|
|
|
# instance fields
|
|
.field private final lineBuf:Lorg/apache/http/util/CharArrayBuffer;
|
|
|
|
.field private final responseFactory:Lorg/apache/http/HttpResponseFactory;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lorg/apache/http/io/SessionInputBuffer;Lorg/apache/http/message/LineParser;Lorg/apache/http/HttpResponseFactory;Lorg/apache/http/params/HttpParams;)V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0, p1, p2, p4}, Lorg/apache/http/impl/io/AbstractMessageParser;-><init>(Lorg/apache/http/io/SessionInputBuffer;Lorg/apache/http/message/LineParser;Lorg/apache/http/params/HttpParams;)V
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
.line 2
|
|
iput-object p3, p0, Lorg/apache/http/impl/io/HttpResponseParser;->responseFactory:Lorg/apache/http/HttpResponseFactory;
|
|
|
|
.line 3
|
|
new-instance p1, Lorg/apache/http/util/CharArrayBuffer;
|
|
|
|
const/16 p2, 0x80
|
|
|
|
invoke-direct {p1, p2}, Lorg/apache/http/util/CharArrayBuffer;-><init>(I)V
|
|
|
|
iput-object p1, p0, Lorg/apache/http/impl/io/HttpResponseParser;->lineBuf:Lorg/apache/http/util/CharArrayBuffer;
|
|
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Response factory may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public parseHead(Lorg/apache/http/io/SessionInputBuffer;)Lorg/apache/http/HttpMessage;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;,
|
|
Lorg/apache/http/HttpException;,
|
|
Lorg/apache/http/ParseException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lorg/apache/http/impl/io/HttpResponseParser;->lineBuf:Lorg/apache/http/util/CharArrayBuffer;
|
|
|
|
invoke-virtual {v0}, Lorg/apache/http/util/CharArrayBuffer;->clear()V
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lorg/apache/http/impl/io/HttpResponseParser;->lineBuf:Lorg/apache/http/util/CharArrayBuffer;
|
|
|
|
invoke-interface {p1, v0}, Lorg/apache/http/io/SessionInputBuffer;->readLine(Lorg/apache/http/util/CharArrayBuffer;)I
|
|
|
|
move-result p1
|
|
|
|
const/4 v0, -0x1
|
|
|
|
if-eq p1, v0, :cond_0
|
|
|
|
.line 3
|
|
new-instance p1, Lorg/apache/http/message/ParserCursor;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iget-object v1, p0, Lorg/apache/http/impl/io/HttpResponseParser;->lineBuf:Lorg/apache/http/util/CharArrayBuffer;
|
|
|
|
invoke-virtual {v1}, Lorg/apache/http/util/CharArrayBuffer;->length()I
|
|
|
|
move-result v1
|
|
|
|
invoke-direct {p1, v0, v1}, Lorg/apache/http/message/ParserCursor;-><init>(II)V
|
|
|
|
.line 4
|
|
iget-object v0, p0, Lorg/apache/http/impl/io/AbstractMessageParser;->lineParser:Lorg/apache/http/message/LineParser;
|
|
|
|
iget-object v1, p0, Lorg/apache/http/impl/io/HttpResponseParser;->lineBuf:Lorg/apache/http/util/CharArrayBuffer;
|
|
|
|
invoke-interface {v0, v1, p1}, Lorg/apache/http/message/LineParser;->parseStatusLine(Lorg/apache/http/util/CharArrayBuffer;Lorg/apache/http/message/ParserCursor;)Lorg/apache/http/StatusLine;
|
|
|
|
move-result-object p1
|
|
|
|
.line 5
|
|
iget-object v0, p0, Lorg/apache/http/impl/io/HttpResponseParser;->responseFactory:Lorg/apache/http/HttpResponseFactory;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-interface {v0, p1, v1}, Lorg/apache/http/HttpResponseFactory;->newHttpResponse(Lorg/apache/http/StatusLine;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
.line 6
|
|
:cond_0
|
|
new-instance p1, Lorg/apache/http/NoHttpResponseException;
|
|
|
|
const-string v0, "The target server failed to respond"
|
|
|
|
invoke-direct {p1, v0}, Lorg/apache/http/NoHttpResponseException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|