106 lines
2.4 KiB
Smali
106 lines
2.4 KiB
Smali
.class public Lorg/apache/http/impl/client/DefaultConnectionKeepAliveStrategy;
|
|
.super Ljava/lang/Object;
|
|
.source "DefaultConnectionKeepAliveStrategy.java"
|
|
|
|
# interfaces
|
|
.implements Lorg/apache/http/conn/ConnectionKeepAliveStrategy;
|
|
|
|
|
|
# annotations
|
|
.annotation build Lorg/apache/http/annotation/Immutable;
|
|
.end annotation
|
|
|
|
|
|
# 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 getKeepAliveDuration(Lorg/apache/http/HttpResponse;Lorg/apache/http/protocol/HttpContext;)J
|
|
.locals 2
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
.line 1
|
|
new-instance p2, Lorg/apache/http/message/BasicHeaderElementIterator;
|
|
|
|
const-string v0, "Keep-Alive"
|
|
|
|
invoke-interface {p1, v0}, Lorg/apache/http/HttpMessage;->headerIterator(Ljava/lang/String;)Lorg/apache/http/HeaderIterator;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Lorg/apache/http/message/BasicHeaderElementIterator;-><init>(Lorg/apache/http/HeaderIterator;)V
|
|
|
|
.line 2
|
|
:catch_0
|
|
:cond_0
|
|
invoke-interface {p2}, Lorg/apache/http/HeaderElementIterator;->hasNext()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 3
|
|
invoke-interface {p2}, Lorg/apache/http/HeaderElementIterator;->nextElement()Lorg/apache/http/HeaderElement;
|
|
|
|
move-result-object p1
|
|
|
|
.line 4
|
|
invoke-interface {p1}, Lorg/apache/http/HeaderElement;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 5
|
|
invoke-interface {p1}, Lorg/apache/http/HeaderElement;->getValue()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const-string v1, "timeout"
|
|
|
|
.line 6
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 7
|
|
:try_start_0
|
|
invoke-static {p1}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
|
|
|
|
move-result-wide p1
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const-wide/16 v0, 0x3e8
|
|
|
|
mul-long/2addr p1, v0
|
|
|
|
return-wide p1
|
|
|
|
:cond_1
|
|
const-wide/16 p1, -0x1
|
|
|
|
return-wide p1
|
|
|
|
.line 8
|
|
:cond_2
|
|
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
|