.class public Lorg/apache/http/impl/DefaultConnectionReuseStrategy; .super Ljava/lang/Object; .source "DefaultConnectionReuseStrategy.java" # interfaces .implements Lorg/apache/http/ConnectionReuseStrategy; # static fields .field public static final INSTANCE:Lorg/apache/http/impl/DefaultConnectionReuseStrategy; # direct methods .method static constructor ()V .registers 1 .line 70 new-instance v0, Lorg/apache/http/impl/DefaultConnectionReuseStrategy; invoke-direct {v0}, Lorg/apache/http/impl/DefaultConnectionReuseStrategy;->()V sput-object v0, Lorg/apache/http/impl/DefaultConnectionReuseStrategy;->INSTANCE:Lorg/apache/http/impl/DefaultConnectionReuseStrategy; return-void .end method .method public constructor ()V .registers 1 .line 73 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method private canResponseHaveBody(Lorg/apache/http/HttpRequest;Lorg/apache/http/HttpResponse;)Z .registers 5 const/4 v0, 0x0 if-eqz p1, :cond_14 .line 223 invoke-interface {p1}, Lorg/apache/http/HttpRequest;->getRequestLine()Lorg/apache/http/RequestLine; move-result-object p1 invoke-interface {p1}, Lorg/apache/http/RequestLine;->getMethod()Ljava/lang/String; move-result-object p1 const-string v1, "HEAD" invoke-virtual {p1, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result p1 if-eqz p1, :cond_14 return v0 .line 226 :cond_14 invoke-interface {p2}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine; move-result-object p1 invoke-interface {p1}, Lorg/apache/http/StatusLine;->getStatusCode()I move-result p1 const/16 p2, 0xc8 if-lt p1, p2, :cond_2d const/16 p2, 0xcc if-eq p1, p2, :cond_2d const/16 p2, 0x130 if-eq p1, p2, :cond_2d const/16 p2, 0xcd if-eq p1, p2, :cond_2d const/4 v0, 0x1 :cond_2d return v0 .end method # virtual methods .method protected createTokenIterator(Lorg/apache/http/HeaderIterator;)Lorg/apache/http/TokenIterator; .registers 3 .line 219 new-instance v0, Lorg/apache/http/message/BasicTokenIterator; invoke-direct {v0, p1}, Lorg/apache/http/message/BasicTokenIterator;->(Lorg/apache/http/HeaderIterator;)V return-object v0 .end method .method public keepAlive(Lorg/apache/http/HttpResponse;Lorg/apache/http/protocol/HttpContext;)Z .registers 10 .line 80 const-string v0, "HTTP response" invoke-static {p1, v0}, Lorg/apache/http/util/Args;->notNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 81 const-string v0, "HTTP context" invoke-static {p2, v0}, Lorg/apache/http/util/Args;->notNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; .line 86 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, 0xcc const-string v2, "Transfer-Encoding" const-string v3, "Content-Length" const/4 v4, 0x0 if-ne v0, v1, :cond_33 .line 87 invoke-interface {p1, v3}, Lorg/apache/http/HttpResponse;->getFirstHeader(Ljava/lang/String;)Lorg/apache/http/Header; move-result-object v0 if-eqz v0, :cond_2c .line 90 :try_start_21 invoke-interface {v0}, Lorg/apache/http/Header;->getValue()Ljava/lang/String; move-result-object v0 invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I move-result v0 :try_end_29 .catch Ljava/lang/NumberFormatException; {:try_start_21 .. :try_end_29} :catch_2c if-lez v0, :cond_2c return v4 .line 99 :catch_2c :cond_2c invoke-interface {p1, v2}, Lorg/apache/http/HttpResponse;->getFirstHeader(Ljava/lang/String;)Lorg/apache/http/Header; move-result-object v0 if-eqz v0, :cond_33 return v4 .line 105 :cond_33 const-string v0, "http.request" 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; .line 106 const-string v0, "Close" const-string v1, "Connection" if-eqz p2, :cond_5b .line 108 :try_start_41 new-instance v5, Lorg/apache/http/message/BasicTokenIterator; invoke-interface {p2, v1}, Lorg/apache/http/HttpRequest;->headerIterator(Ljava/lang/String;)Lorg/apache/http/HeaderIterator; move-result-object v6 invoke-direct {v5, v6}, Lorg/apache/http/message/BasicTokenIterator;->(Lorg/apache/http/HeaderIterator;)V .line 109 :cond_4a invoke-interface {v5}, Lorg/apache/http/TokenIterator;->hasNext()Z move-result v6 if-eqz v6, :cond_5b .line 110 invoke-interface {v5}, Lorg/apache/http/TokenIterator;->nextToken()Ljava/lang/String; move-result-object v6 .line 111 invoke-virtual {v0, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v6 :try_end_58 .catch Lorg/apache/http/ParseException; {:try_start_41 .. :try_end_58} :catch_5a if-eqz v6, :cond_4a :catch_5a return v4 .line 123 :cond_5b invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine; move-result-object v5 invoke-interface {v5}, Lorg/apache/http/StatusLine;->getProtocolVersion()Lorg/apache/http/ProtocolVersion; move-result-object v5 .line 124 invoke-interface {p1, v2}, Lorg/apache/http/HttpResponse;->getFirstHeader(Ljava/lang/String;)Lorg/apache/http/Header; move-result-object v2 const/4 v6, 0x1 if-eqz v2, :cond_77 .line 126 const-string p2, "chunked" invoke-interface {v2}, Lorg/apache/http/Header;->getValue()Ljava/lang/String; move-result-object v2 invoke-virtual {p2, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result p2 if-nez p2, :cond_91 return v4 .line 130 :cond_77 invoke-direct {p0, p2, p1}, Lorg/apache/http/impl/DefaultConnectionReuseStrategy;->canResponseHaveBody(Lorg/apache/http/HttpRequest;Lorg/apache/http/HttpResponse;)Z move-result p2 if-eqz p2, :cond_91 .line 131 invoke-interface {p1, v3}, Lorg/apache/http/HttpResponse;->getHeaders(Ljava/lang/String;)[Lorg/apache/http/Header; move-result-object p2 .line 133 array-length v2, p2 if-ne v2, v6, :cond_90 .line 134 aget-object p2, p2, v4 .line 136 :try_start_86 invoke-interface {p2}, Lorg/apache/http/Header;->getValue()Ljava/lang/String; move-result-object p2 invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I move-result p2 :try_end_8e .catch Ljava/lang/NumberFormatException; {:try_start_86 .. :try_end_8e} :catch_90 if-gez p2, :cond_91 :catch_90 :cond_90 return v4 .line 152 :cond_91 invoke-interface {p1, v1}, Lorg/apache/http/HttpResponse;->headerIterator(Ljava/lang/String;)Lorg/apache/http/HeaderIterator; move-result-object p2 .line 153 invoke-interface {p2}, Lorg/apache/http/HeaderIterator;->hasNext()Z move-result v1 if-nez v1, :cond_a1 .line 154 const-string p2, "Proxy-Connection" invoke-interface {p1, p2}, Lorg/apache/http/HttpResponse;->headerIterator(Ljava/lang/String;)Lorg/apache/http/HeaderIterator; move-result-object p2 .line 180 :cond_a1 invoke-interface {p2}, Lorg/apache/http/HeaderIterator;->hasNext()Z move-result p1 if-eqz p1, :cond_cc .line 182 :try_start_a7 new-instance p1, Lorg/apache/http/message/BasicTokenIterator; invoke-direct {p1, p2}, Lorg/apache/http/message/BasicTokenIterator;->(Lorg/apache/http/HeaderIterator;)V move p2, v4 .line 184 :cond_ad :goto_ad invoke-interface {p1}, Lorg/apache/http/TokenIterator;->hasNext()Z move-result v1 if-eqz v1, :cond_c8 .line 185 invoke-interface {p1}, Lorg/apache/http/TokenIterator;->nextToken()Ljava/lang/String; move-result-object v1 .line 186 invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v2 if-eqz v2, :cond_be return v4 .line 188 :cond_be const-string v2, "Keep-Alive" invoke-virtual {v2, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result v1 :try_end_c4 .catch Lorg/apache/http/ParseException; {:try_start_a7 .. :try_end_c4} :catch_cb if-eqz v1, :cond_ad move p2, v6 goto :goto_ad :cond_c8 if-eqz p2, :cond_cc return v6 :catch_cb return v4 .line 205 :cond_cc sget-object p1, Lorg/apache/http/HttpVersion;->HTTP_1_0:Lorg/apache/http/HttpVersion; invoke-virtual {v5, p1}, Lorg/apache/http/ProtocolVersion;->lessEquals(Lorg/apache/http/ProtocolVersion;)Z move-result p1 xor-int/2addr p1, v6 return p1 .end method