.class public final Lokhttp3/internal/connection/RealConnection; .super Lokhttp3/internal/http2/Http2Connection$Listener; .source "RealConnection.java" # interfaces .implements Lokhttp3/Connection; # static fields .field private static final NPE_THROW_WITH_NULL:Ljava/lang/String; = "throw with null exception" # instance fields .field public allocationLimit:I .field public final allocations:Ljava/util/List; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/List<", "Ljava/lang/ref/Reference<", "Lokhttp3/internal/connection/StreamAllocation;", ">;>;" } .end annotation .end field .field private final connectionPool:Lokhttp3/ConnectionPool; .field private handshake:Lokhttp3/Handshake; .field private http2Connection:Lokhttp3/internal/http2/Http2Connection; .field public idleAtNanos:J .field public noNewStreams:Z .field private protocol:Lokhttp3/Protocol; .field private rawSocket:Ljava/net/Socket; .field private final route:Lokhttp3/Route; .field private sink:Lokio/BufferedSink; .field private socket:Ljava/net/Socket; .field private source:Lokio/BufferedSource; .field public successCount:I # direct methods .method public constructor (Lokhttp3/ConnectionPool;Lokhttp3/Route;)V .locals 2 .line 111 invoke-direct {p0}, Lokhttp3/internal/http2/Http2Connection$Listener;->()V const/4 v0, 0x1 .line 103 iput v0, p0, Lokhttp3/internal/connection/RealConnection;->allocationLimit:I .line 106 new-instance v0, Ljava/util/ArrayList; invoke-direct {v0}, Ljava/util/ArrayList;->()V iput-object v0, p0, Lokhttp3/internal/connection/RealConnection;->allocations:Ljava/util/List; const-wide v0, 0x7fffffffffffffffL .line 109 iput-wide v0, p0, Lokhttp3/internal/connection/RealConnection;->idleAtNanos:J .line 112 iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->connectionPool:Lokhttp3/ConnectionPool; .line 113 iput-object p2, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; return-void .end method .method private connectSocket(II)V .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 214 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v0}, Lokhttp3/Route;->proxy()Ljava/net/Proxy; move-result-object v0 .line 215 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 .line 217 invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type; move-result-object v2 sget-object v3, Ljava/net/Proxy$Type;->DIRECT:Ljava/net/Proxy$Type; if-eq v2, v3, :cond_1 invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type; move-result-object v2 sget-object v3, Ljava/net/Proxy$Type;->HTTP:Ljava/net/Proxy$Type; if-ne v2, v3, :cond_0 goto :goto_0 .line 219 :cond_0 new-instance v1, Ljava/net/Socket; invoke-direct {v1, v0}, Ljava/net/Socket;->(Ljava/net/Proxy;)V goto :goto_1 .line 218 :cond_1 :goto_0 invoke-virtual {v1}, Lokhttp3/Address;->socketFactory()Ljavax/net/SocketFactory; move-result-object v0 invoke-virtual {v0}, Ljavax/net/SocketFactory;->createSocket()Ljava/net/Socket; move-result-object v1 .line 219 :goto_1 iput-object v1, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; .line 221 invoke-virtual {v1, p2}, Ljava/net/Socket;->setSoTimeout(I)V .line 223 :try_start_0 invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform; move-result-object p2 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v1}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress; move-result-object v1 invoke-virtual {p2, v0, v1, p1}, Lokhttp3/internal/platform/Platform;->connectSocket(Ljava/net/Socket;Ljava/net/InetSocketAddress;I)V :try_end_0 .catch Ljava/net/ConnectException; {:try_start_0 .. :try_end_0} :catch_1 .line 235 :try_start_1 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; invoke-static {p1}, Lokio/Okio;->source(Ljava/net/Socket;)Lokio/Source; move-result-object p1 invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource; move-result-object p1 iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; .line 236 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; invoke-static {p1}, Lokio/Okio;->sink(Ljava/net/Socket;)Lokio/Sink; move-result-object p1 invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink; move-result-object p1 iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; :try_end_1 .catch Ljava/lang/NullPointerException; {:try_start_1 .. :try_end_1} :catch_0 goto :goto_2 :catch_0 move-exception p1 .line 238 invoke-virtual {p1}, Ljava/lang/NullPointerException;->getMessage()Ljava/lang/String; move-result-object p2 const-string v0, "throw with null exception" invoke-virtual {v0, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result p2 if-nez p2, :cond_2 :goto_2 return-void .line 239 :cond_2 new-instance p2, Ljava/io/IOException; invoke-direct {p2, p1}, Ljava/io/IOException;->(Ljava/lang/Throwable;)V throw p2 :catch_1 move-exception p1 .line 225 new-instance p2, Ljava/net/ConnectException; new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v1, "Failed to connect to " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v1}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {p2, v0}, Ljava/net/ConnectException;->(Ljava/lang/String;)V .line 226 invoke-virtual {p2, p1}, Ljava/net/ConnectException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable; .line 227 throw p2 .end method .method private connectTls(Lokhttp3/internal/connection/ConnectionSpecSelector;)V .locals 7 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 264 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v0 .line 265 invoke-virtual {v0}, Lokhttp3/Address;->sslSocketFactory()Ljavax/net/ssl/SSLSocketFactory; move-result-object v1 const/4 v2, 0x0 .line 270 :try_start_0 iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; .line 271 invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v4 invoke-virtual {v4}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v4 invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v5 invoke-virtual {v5}, Lokhttp3/HttpUrl;->port()I move-result v5 const/4 v6, 0x1 .line 270 invoke-virtual {v1, v3, v4, v5, v6}, Ljavax/net/ssl/SSLSocketFactory;->createSocket(Ljava/net/Socket;Ljava/lang/String;IZ)Ljava/net/Socket; move-result-object v1 check-cast v1, Ljavax/net/ssl/SSLSocket; :try_end_0 .catch Ljava/lang/AssertionError; {:try_start_0 .. :try_end_0} :catch_1 .catchall {:try_start_0 .. :try_end_0} :catchall_1 .line 274 :try_start_1 invoke-virtual {p1, v1}, Lokhttp3/internal/connection/ConnectionSpecSelector;->configureSecureSocket(Ljavax/net/ssl/SSLSocket;)Lokhttp3/ConnectionSpec; move-result-object p1 .line 275 invoke-virtual {p1}, Lokhttp3/ConnectionSpec;->supportsTlsExtensions()Z move-result v3 if-eqz v3, :cond_0 .line 276 invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform; move-result-object v3 .line 277 invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v4 invoke-virtual {v4}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v4 invoke-virtual {v0}, Lokhttp3/Address;->protocols()Ljava/util/List; move-result-object v5 .line 276 invoke-virtual {v3, v1, v4, v5}, Lokhttp3/internal/platform/Platform;->configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V .line 281 :cond_0 invoke-virtual {v1}, Ljavax/net/ssl/SSLSocket;->startHandshake()V .line 282 invoke-virtual {v1}, Ljavax/net/ssl/SSLSocket;->getSession()Ljavax/net/ssl/SSLSession; move-result-object v3 invoke-static {v3}, Lokhttp3/Handshake;->get(Ljavax/net/ssl/SSLSession;)Lokhttp3/Handshake; move-result-object v3 .line 285 invoke-virtual {v0}, Lokhttp3/Address;->hostnameVerifier()Ljavax/net/ssl/HostnameVerifier; move-result-object v4 invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v5 invoke-virtual {v5}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v5 invoke-virtual {v1}, Ljavax/net/ssl/SSLSocket;->getSession()Ljavax/net/ssl/SSLSession; move-result-object v6 invoke-interface {v4, v5, v6}, Ljavax/net/ssl/HostnameVerifier;->verify(Ljava/lang/String;Ljavax/net/ssl/SSLSession;)Z move-result v4 if-eqz v4, :cond_4 .line 294 invoke-virtual {v0}, Lokhttp3/Address;->certificatePinner()Lokhttp3/CertificatePinner; move-result-object v4 invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v0 invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v0 .line 295 invoke-virtual {v3}, Lokhttp3/Handshake;->peerCertificates()Ljava/util/List; move-result-object v5 .line 294 invoke-virtual {v4, v0, v5}, Lokhttp3/CertificatePinner;->check(Ljava/lang/String;Ljava/util/List;)V .line 298 invoke-virtual {p1}, Lokhttp3/ConnectionSpec;->supportsTlsExtensions()Z move-result p1 if-eqz p1, :cond_1 .line 299 invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform; move-result-object p1 invoke-virtual {p1, v1}, Lokhttp3/internal/platform/Platform;->getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String; move-result-object v2 .line 301 :cond_1 iput-object v1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; .line 302 invoke-static {v1}, Lokio/Okio;->source(Ljava/net/Socket;)Lokio/Source; move-result-object p1 invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource; move-result-object p1 iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; .line 303 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-static {p1}, Lokio/Okio;->sink(Ljava/net/Socket;)Lokio/Sink; move-result-object p1 invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink; move-result-object p1 iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; .line 304 iput-object v3, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake; if-eqz v2, :cond_2 .line 306 invoke-static {v2}, Lokhttp3/Protocol;->get(Ljava/lang/String;)Lokhttp3/Protocol; move-result-object p1 goto :goto_0 .line 307 :cond_2 sget-object p1, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol; :goto_0 iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol; :try_end_1 .catch Ljava/lang/AssertionError; {:try_start_1 .. :try_end_1} :catch_0 .catchall {:try_start_1 .. :try_end_1} :catchall_0 if-eqz v1, :cond_3 .line 314 invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform; move-result-object p1 invoke-virtual {p1, v1}, Lokhttp3/internal/platform/Platform;->afterHandshake(Ljavax/net/ssl/SSLSocket;)V :cond_3 return-void .line 286 :cond_4 :try_start_2 invoke-virtual {v3}, Lokhttp3/Handshake;->peerCertificates()Ljava/util/List; move-result-object p1 const/4 v2, 0x0 invoke-interface {p1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object p1 check-cast p1, Ljava/security/cert/X509Certificate; .line 287 new-instance v2, Ljavax/net/ssl/SSLPeerUnverifiedException; new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;->()V const-string v4, "Hostname " invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v0 invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v0 invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v3, " not verified:\n certificate: " invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 .line 288 invoke-static {p1}, Lokhttp3/CertificatePinner;->pin(Ljava/security/cert/Certificate;)Ljava/lang/String; move-result-object v3 invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v3, "\n DN: " invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 .line 289 invoke-virtual {p1}, Ljava/security/cert/X509Certificate;->getSubjectDN()Ljava/security/Principal; move-result-object v3 invoke-interface {v3}, Ljava/security/Principal;->getName()Ljava/lang/String; move-result-object v3 invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v3, "\n subjectAltNames: " invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 .line 290 invoke-static {p1}, Lokhttp3/internal/tls/OkHostnameVerifier;->allSubjectAltNames(Ljava/security/cert/X509Certificate;)Ljava/util/List; move-result-object p1 invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object p1 invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {v2, p1}, Ljavax/net/ssl/SSLPeerUnverifiedException;->(Ljava/lang/String;)V throw v2 :try_end_2 .catch Ljava/lang/AssertionError; {:try_start_2 .. :try_end_2} :catch_0 .catchall {:try_start_2 .. :try_end_2} :catchall_0 :catchall_0 move-exception p1 move-object v2, v1 goto :goto_2 :catch_0 move-exception p1 move-object v2, v1 goto :goto_1 :catchall_1 move-exception p1 goto :goto_2 :catch_1 move-exception p1 .line 310 :goto_1 :try_start_3 invoke-static {p1}, Lokhttp3/internal/Util;->isAndroidGetsocknameError(Ljava/lang/AssertionError;)Z move-result v0 if-eqz v0, :cond_5 new-instance v0, Ljava/io/IOException; invoke-direct {v0, p1}, Ljava/io/IOException;->(Ljava/lang/Throwable;)V throw v0 .line 311 :cond_5 throw p1 :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_1 :goto_2 if-eqz v2, :cond_6 .line 314 invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform; move-result-object v0 invoke-virtual {v0, v2}, Lokhttp3/internal/platform/Platform;->afterHandshake(Ljavax/net/ssl/SSLSocket;)V .line 317 :cond_6 invoke-static {v2}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V throw p1 .end method .method private connectTunnel(III)V .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 189 invoke-direct {p0}, Lokhttp3/internal/connection/RealConnection;->createTunnelRequest()Lokhttp3/Request; move-result-object v0 .line 190 invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl; move-result-object v1 const/4 v2, 0x0 :goto_0 add-int/lit8 v2, v2, 0x1 const/16 v3, 0x15 if-gt v2, v3, :cond_1 .line 198 invoke-direct {p0, p1, p2}, Lokhttp3/internal/connection/RealConnection;->connectSocket(II)V .line 199 invoke-direct {p0, p2, p3, v0, v1}, Lokhttp3/internal/connection/RealConnection;->createTunnel(IILokhttp3/Request;Lokhttp3/HttpUrl;)Lokhttp3/Request; move-result-object v0 if-nez v0, :cond_0 return-void .line 205 :cond_0 iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; invoke-static {v3}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V const/4 v3, 0x0 .line 206 iput-object v3, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; .line 207 iput-object v3, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; .line 208 iput-object v3, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; goto :goto_0 .line 195 :cond_1 new-instance p1, Ljava/net/ProtocolException; new-instance p2, Ljava/lang/StringBuilder; invoke-direct {p2}, Ljava/lang/StringBuilder;->()V const-string p3, "Too many tunnel connections attempted: " invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p2 invoke-virtual {p2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object p2 invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p2 invoke-direct {p1, p2}, Ljava/net/ProtocolException;->(Ljava/lang/String;)V throw p1 .end method .method private createTunnel(IILokhttp3/Request;Lokhttp3/HttpUrl;)Lokhttp3/Request; .locals 6 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 329 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v1, "CONNECT " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const/4 v1, 0x1 invoke-static {p4, v1}, Lokhttp3/internal/Util;->hostHeader(Lokhttp3/HttpUrl;Z)Ljava/lang/String; move-result-object p4 invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p4 const-string v0, " HTTP/1.1" invoke-virtual {p4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p4 invoke-virtual {p4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p4 .line 331 :goto_0 new-instance v0, Lokhttp3/internal/http1/Http1Codec; iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; iget-object v2, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; const/4 v3, 0x0 invoke-direct {v0, v3, v3, v1, v2}, Lokhttp3/internal/http1/Http1Codec;->(Lokhttp3/OkHttpClient;Lokhttp3/internal/connection/StreamAllocation;Lokio/BufferedSource;Lokio/BufferedSink;)V .line 332 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; invoke-interface {v1}, Lokio/BufferedSource;->timeout()Lokio/Timeout; move-result-object v1 int-to-long v4, p1 sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit; invoke-virtual {v1, v4, v5, v2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout; .line 333 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; invoke-interface {v1}, Lokio/BufferedSink;->timeout()Lokio/Timeout; move-result-object v1 int-to-long v4, p2 sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit; invoke-virtual {v1, v4, v5, v2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout; .line 334 invoke-virtual {p3}, Lokhttp3/Request;->headers()Lokhttp3/Headers; move-result-object v1 invoke-virtual {v0, v1, p4}, Lokhttp3/internal/http1/Http1Codec;->writeRequest(Lokhttp3/Headers;Ljava/lang/String;)V .line 335 invoke-virtual {v0}, Lokhttp3/internal/http1/Http1Codec;->finishRequest()V const/4 v1, 0x0 .line 336 invoke-virtual {v0, v1}, Lokhttp3/internal/http1/Http1Codec;->readResponseHeaders(Z)Lokhttp3/Response$Builder; move-result-object v1 .line 337 invoke-virtual {v1, p3}, Lokhttp3/Response$Builder;->request(Lokhttp3/Request;)Lokhttp3/Response$Builder; move-result-object p3 .line 338 invoke-virtual {p3}, Lokhttp3/Response$Builder;->build()Lokhttp3/Response; move-result-object p3 .line 341 invoke-static {p3}, Lokhttp3/internal/http/HttpHeaders;->contentLength(Lokhttp3/Response;)J move-result-wide v1 const-wide/16 v4, -0x1 cmp-long v4, v1, v4 if-nez v4, :cond_0 const-wide/16 v1, 0x0 .line 345 :cond_0 invoke-virtual {v0, v1, v2}, Lokhttp3/internal/http1/Http1Codec;->newFixedLengthSource(J)Lokio/Source; move-result-object v0 const v1, 0x7fffffff .line 346 sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit; invoke-static {v0, v1, v2}, Lokhttp3/internal/Util;->skipAll(Lokio/Source;ILjava/util/concurrent/TimeUnit;)Z .line 347 invoke-interface {v0}, Lokio/Source;->close()V .line 349 invoke-virtual {p3}, Lokhttp3/Response;->code()I move-result v0 const/16 v1, 0xc8 if-eq v0, v1, :cond_4 const/16 v1, 0x197 if-ne v0, v1, :cond_3 .line 361 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v0 invoke-virtual {v0}, Lokhttp3/Address;->proxyAuthenticator()Lokhttp3/Authenticator; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-interface {v0, v1, p3}, Lokhttp3/Authenticator;->authenticate(Lokhttp3/Route;Lokhttp3/Response;)Lokhttp3/Request; move-result-object v0 if-eqz v0, :cond_2 const-string v1, "Connection" .line 364 invoke-virtual {p3, v1}, Lokhttp3/Response;->header(Ljava/lang/String;)Ljava/lang/String; move-result-object p3 const-string v1, "close" invoke-virtual {v1, p3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z move-result p3 if-eqz p3, :cond_1 return-object v0 :cond_1 move-object p3, v0 goto/16 :goto_0 .line 362 :cond_2 new-instance p1, Ljava/io/IOException; const-string p2, "Failed to authenticate with proxy" invoke-direct {p1, p2}, Ljava/io/IOException;->(Ljava/lang/String;)V throw p1 .line 370 :cond_3 new-instance p1, Ljava/io/IOException; new-instance p2, Ljava/lang/StringBuilder; invoke-direct {p2}, Ljava/lang/StringBuilder;->()V const-string p4, "Unexpected response code for CONNECT: " invoke-virtual {p2, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p2 .line 371 invoke-virtual {p3}, Lokhttp3/Response;->code()I move-result p3 invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object p2 invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p2 invoke-direct {p1, p2}, Ljava/io/IOException;->(Ljava/lang/String;)V throw p1 .line 355 :cond_4 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; invoke-interface {p1}, Lokio/BufferedSource;->buffer()Lokio/Buffer; move-result-object p1 invoke-virtual {p1}, Lokio/Buffer;->exhausted()Z move-result p1 if-eqz p1, :cond_5 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; invoke-interface {p1}, Lokio/BufferedSink;->buffer()Lokio/Buffer; move-result-object p1 invoke-virtual {p1}, Lokio/Buffer;->exhausted()Z move-result p1 if-eqz p1, :cond_5 return-object v3 .line 356 :cond_5 new-instance p1, Ljava/io/IOException; const-string p2, "TLS tunnel buffered too many bytes!" invoke-direct {p1, p2}, Ljava/io/IOException;->(Ljava/lang/String;)V throw p1 .end method .method private createTunnelRequest()Lokhttp3/Request; .locals 3 .line 382 new-instance v0, Lokhttp3/Request$Builder; invoke-direct {v0}, Lokhttp3/Request$Builder;->()V iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; .line 383 invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v1 invoke-virtual {v0, v1}, Lokhttp3/Request$Builder;->url(Lokhttp3/HttpUrl;)Lokhttp3/Request$Builder; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; .line 384 invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v1 const/4 v2, 0x1 invoke-static {v1, v2}, Lokhttp3/internal/Util;->hostHeader(Lokhttp3/HttpUrl;Z)Ljava/lang/String; move-result-object v1 const-string v2, "Host" invoke-virtual {v0, v2, v1}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; move-result-object v0 const-string v1, "Proxy-Connection" const-string v2, "Keep-Alive" .line 385 invoke-virtual {v0, v1, v2}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; move-result-object v0 .line 386 invoke-static {}, Lokhttp3/internal/Version;->userAgent()Ljava/lang/String; move-result-object v1 const-string v2, "User-Agent" invoke-virtual {v0, v2, v1}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; move-result-object v0 .line 387 invoke-virtual {v0}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request; move-result-object v0 return-object v0 .end method .method private establishProtocol(Lokhttp3/internal/connection/ConnectionSpecSelector;)V .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 245 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v0 invoke-virtual {v0}, Lokhttp3/Address;->sslSocketFactory()Ljavax/net/ssl/SSLSocketFactory; move-result-object v0 if-nez v0, :cond_0 .line 246 sget-object p1, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol; iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol; .line 247 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; return-void .line 251 :cond_0 invoke-direct {p0, p1}, Lokhttp3/internal/connection/RealConnection;->connectTls(Lokhttp3/internal/connection/ConnectionSpecSelector;)V .line 253 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol; sget-object v0, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol; if-ne p1, v0, :cond_1 .line 254 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; const/4 v0, 0x0 invoke-virtual {p1, v0}, Ljava/net/Socket;->setSoTimeout(I)V .line 255 new-instance p1, Lokhttp3/internal/http2/Http2Connection$Builder; const/4 v0, 0x1 invoke-direct {p1, v0}, Lokhttp3/internal/http2/Http2Connection$Builder;->(Z)V iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; .line 256 invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v1 invoke-virtual {v1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v1 iget-object v2, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; invoke-virtual {p1, v0, v1, v2, v3}, Lokhttp3/internal/http2/Http2Connection$Builder;->socket(Ljava/net/Socket;Ljava/lang/String;Lokio/BufferedSource;Lokio/BufferedSink;)Lokhttp3/internal/http2/Http2Connection$Builder; move-result-object p1 .line 257 invoke-virtual {p1, p0}, Lokhttp3/internal/http2/Http2Connection$Builder;->listener(Lokhttp3/internal/http2/Http2Connection$Listener;)Lokhttp3/internal/http2/Http2Connection$Builder; move-result-object p1 .line 258 invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Connection$Builder;->build()Lokhttp3/internal/http2/Http2Connection; move-result-object p1 iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection; .line 259 invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Connection;->start()V :cond_1 return-void .end method .method public static testConnection(Lokhttp3/ConnectionPool;Lokhttp3/Route;Ljava/net/Socket;J)Lokhttp3/internal/connection/RealConnection; .locals 1 .line 118 new-instance v0, Lokhttp3/internal/connection/RealConnection; invoke-direct {v0, p0, p1}, Lokhttp3/internal/connection/RealConnection;->(Lokhttp3/ConnectionPool;Lokhttp3/Route;)V .line 119 iput-object p2, v0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; .line 120 iput-wide p3, v0, Lokhttp3/internal/connection/RealConnection;->idleAtNanos:J return-object v0 .end method # virtual methods .method public cancel()V .locals 1 .line 476 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; invoke-static {v0}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V return-void .end method .method public connect(IIIZ)V .locals 5 .line 126 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol; if-nez v0, :cond_7 .line 129 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v0 invoke-virtual {v0}, Lokhttp3/Address;->connectionSpecs()Ljava/util/List; move-result-object v0 .line 130 new-instance v1, Lokhttp3/internal/connection/ConnectionSpecSelector; invoke-direct {v1, v0}, Lokhttp3/internal/connection/ConnectionSpecSelector;->(Ljava/util/List;)V .line 132 iget-object v2, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v2}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v2 invoke-virtual {v2}, Lokhttp3/Address;->sslSocketFactory()Ljavax/net/ssl/SSLSocketFactory; move-result-object v2 if-nez v2, :cond_2 .line 133 sget-object v2, Lokhttp3/ConnectionSpec;->CLEARTEXT:Lokhttp3/ConnectionSpec; invoke-interface {v0, v2}, Ljava/util/List;->contains(Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_1 .line 137 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v0 invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v0 invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v0 .line 138 invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform; move-result-object v2 invoke-virtual {v2, v0}, Lokhttp3/internal/platform/Platform;->isCleartextTrafficPermitted(Ljava/lang/String;)Z move-result v2 if-eqz v2, :cond_0 goto :goto_0 .line 139 :cond_0 new-instance p1, Lokhttp3/internal/connection/RouteException; new-instance p2, Ljava/net/UnknownServiceException; new-instance p3, Ljava/lang/StringBuilder; invoke-direct {p3}, Ljava/lang/StringBuilder;->()V const-string p4, "CLEARTEXT communication to " invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p3 invoke-virtual {p3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p3 const-string p4, " not permitted by network security policy" invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p3 invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p3 invoke-direct {p2, p3}, Ljava/net/UnknownServiceException;->(Ljava/lang/String;)V invoke-direct {p1, p2}, Lokhttp3/internal/connection/RouteException;->(Ljava/io/IOException;)V throw p1 .line 134 :cond_1 new-instance p1, Lokhttp3/internal/connection/RouteException; new-instance p2, Ljava/net/UnknownServiceException; const-string p3, "CLEARTEXT communication not enabled for client" invoke-direct {p2, p3}, Ljava/net/UnknownServiceException;->(Ljava/lang/String;)V invoke-direct {p1, p2}, Lokhttp3/internal/connection/RouteException;->(Ljava/io/IOException;)V throw p1 :cond_2 :goto_0 const/4 v0, 0x0 move-object v2, v0 .line 146 :goto_1 :try_start_0 iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v3}, Lokhttp3/Route;->requiresTunnel()Z move-result v3 if-eqz v3, :cond_3 .line 147 invoke-direct {p0, p1, p2, p3}, Lokhttp3/internal/connection/RealConnection;->connectTunnel(III)V goto :goto_2 .line 149 :cond_3 invoke-direct {p0, p1, p2}, Lokhttp3/internal/connection/RealConnection;->connectSocket(II)V .line 151 :goto_2 invoke-direct {p0, v1}, Lokhttp3/internal/connection/RealConnection;->establishProtocol(Lokhttp3/internal/connection/ConnectionSpecSelector;)V :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0 .line 176 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection; if-eqz p1, :cond_4 .line 177 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->connectionPool:Lokhttp3/ConnectionPool; monitor-enter p1 .line 178 :try_start_1 iget-object p2, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection; invoke-virtual {p2}, Lokhttp3/internal/http2/Http2Connection;->maxConcurrentStreams()I move-result p2 iput p2, p0, Lokhttp3/internal/connection/RealConnection;->allocationLimit:I .line 179 monitor-exit p1 goto :goto_3 :catchall_0 move-exception p2 monitor-exit p1 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 throw p2 :cond_4 :goto_3 return-void :catch_0 move-exception v3 .line 154 iget-object v4, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-static {v4}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V .line 155 iget-object v4, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; invoke-static {v4}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V .line 156 iput-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; .line 157 iput-object v0, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket; .line 158 iput-object v0, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; .line 159 iput-object v0, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; .line 160 iput-object v0, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake; .line 161 iput-object v0, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol; .line 162 iput-object v0, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection; if-nez v2, :cond_5 .line 165 new-instance v2, Lokhttp3/internal/connection/RouteException; invoke-direct {v2, v3}, Lokhttp3/internal/connection/RouteException;->(Ljava/io/IOException;)V goto :goto_4 .line 167 :cond_5 invoke-virtual {v2, v3}, Lokhttp3/internal/connection/RouteException;->addConnectException(Ljava/io/IOException;)V :goto_4 if-eqz p4, :cond_6 .line 170 invoke-virtual {v1, v3}, Lokhttp3/internal/connection/ConnectionSpecSelector;->connectionFailed(Ljava/io/IOException;)Z move-result v3 if-eqz v3, :cond_6 goto :goto_1 .line 171 :cond_6 throw v2 .line 126 :cond_7 new-instance p1, Ljava/lang/IllegalStateException; const-string p2, "already connected" invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p1 .end method .method public handshake()Lokhttp3/Handshake; .locals 1 .line 528 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake; return-object v0 .end method .method public isEligible(Lokhttp3/Address;Lokhttp3/Route;)Z .locals 4 .param p2 # Lokhttp3/Route; .annotation runtime Ljavax/annotation/Nullable; .end annotation .end param .line 396 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->allocations:Ljava/util/List; invoke-interface {v0}, Ljava/util/List;->size()I move-result v0 iget v1, p0, Lokhttp3/internal/connection/RealConnection;->allocationLimit:I const/4 v2, 0x0 if-ge v0, v1, :cond_a iget-boolean v0, p0, Lokhttp3/internal/connection/RealConnection;->noNewStreams:Z if-eqz v0, :cond_0 goto/16 :goto_0 .line 399 :cond_0 sget-object v0, Lokhttp3/internal/Internal;->instance:Lokhttp3/internal/Internal; iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 invoke-virtual {v0, v1, p1}, Lokhttp3/internal/Internal;->equalsNonHost(Lokhttp3/Address;Lokhttp3/Address;)Z move-result v0 if-nez v0, :cond_1 return v2 .line 402 :cond_1 invoke-virtual {p1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v0 invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v0 invoke-virtual {p0}, Lokhttp3/internal/connection/RealConnection;->route()Lokhttp3/Route; move-result-object v1 invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v1 invoke-virtual {v1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v0 const/4 v1, 0x1 if-eqz v0, :cond_2 return v1 .line 412 :cond_2 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection; if-nez v0, :cond_3 return v2 :cond_3 if-nez p2, :cond_4 return v2 .line 418 :cond_4 invoke-virtual {p2}, Lokhttp3/Route;->proxy()Ljava/net/Proxy; move-result-object v0 invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type; move-result-object v0 sget-object v3, Ljava/net/Proxy$Type;->DIRECT:Ljava/net/Proxy$Type; if-eq v0, v3, :cond_5 return v2 .line 419 :cond_5 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v0}, Lokhttp3/Route;->proxy()Ljava/net/Proxy; move-result-object v0 invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type; move-result-object v0 sget-object v3, Ljava/net/Proxy$Type;->DIRECT:Ljava/net/Proxy$Type; if-eq v0, v3, :cond_6 return v2 .line 420 :cond_6 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v0}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress; move-result-object v0 invoke-virtual {p2}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress; move-result-object v3 invoke-virtual {v0, v3}, Ljava/net/InetSocketAddress;->equals(Ljava/lang/Object;)Z move-result v0 if-nez v0, :cond_7 return v2 .line 423 :cond_7 invoke-virtual {p2}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object p2 invoke-virtual {p2}, Lokhttp3/Address;->hostnameVerifier()Ljavax/net/ssl/HostnameVerifier; move-result-object p2 sget-object v0, Lokhttp3/internal/tls/OkHostnameVerifier;->INSTANCE:Lokhttp3/internal/tls/OkHostnameVerifier; if-eq p2, v0, :cond_8 return v2 .line 424 :cond_8 invoke-virtual {p1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object p2 invoke-virtual {p0, p2}, Lokhttp3/internal/connection/RealConnection;->supportsUrl(Lokhttp3/HttpUrl;)Z move-result p2 if-nez p2, :cond_9 return v2 .line 428 :cond_9 :try_start_0 invoke-virtual {p1}, Lokhttp3/Address;->certificatePinner()Lokhttp3/CertificatePinner; move-result-object p2 invoke-virtual {p1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object p1 invoke-virtual {p1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object p1 invoke-virtual {p0}, Lokhttp3/internal/connection/RealConnection;->handshake()Lokhttp3/Handshake; move-result-object v0 invoke-virtual {v0}, Lokhttp3/Handshake;->peerCertificates()Ljava/util/List; move-result-object v0 invoke-virtual {p2, p1, v0}, Lokhttp3/CertificatePinner;->check(Ljava/lang/String;Ljava/util/List;)V :try_end_0 .catch Ljavax/net/ssl/SSLPeerUnverifiedException; {:try_start_0 .. :try_end_0} :catch_0 return v1 :catch_0 :cond_a :goto_0 return v2 .end method .method public isHealthy(Z)Z .locals 4 .line 485 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-virtual {v0}, Ljava/net/Socket;->isClosed()Z move-result v0 const/4 v1, 0x0 if-nez v0, :cond_4 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-virtual {v0}, Ljava/net/Socket;->isInputShutdown()Z move-result v0 if-nez v0, :cond_4 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-virtual {v0}, Ljava/net/Socket;->isOutputShutdown()Z move-result v0 if-eqz v0, :cond_0 goto :goto_0 .line 489 :cond_0 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection; const/4 v2, 0x1 if-eqz v0, :cond_1 .line 490 invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Connection;->isShutdown()Z move-result p1 xor-int/2addr p1, v2 return p1 :cond_1 if-eqz p1, :cond_3 .line 495 :try_start_0 iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-virtual {p1}, Ljava/net/Socket;->getSoTimeout()I move-result p1 :try_end_0 .catch Ljava/net/SocketTimeoutException; {:try_start_0 .. :try_end_0} :catch_1 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0 .line 497 :try_start_1 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-virtual {v0, v2}, Ljava/net/Socket;->setSoTimeout(I)V .line 498 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; invoke-interface {v0}, Lokio/BufferedSource;->exhausted()Z move-result v0 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 if-eqz v0, :cond_2 .line 503 :try_start_2 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-virtual {v0, p1}, Ljava/net/Socket;->setSoTimeout(I)V return v1 :cond_2 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-virtual {v0, p1}, Ljava/net/Socket;->setSoTimeout(I)V return v2 :catchall_0 move-exception v0 iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-virtual {v3, p1}, Ljava/net/Socket;->setSoTimeout(I)V throw v0 :try_end_2 .catch Ljava/net/SocketTimeoutException; {:try_start_2 .. :try_end_2} :catch_1 .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0 :catch_0 return v1 :catch_1 :cond_3 return v2 :cond_4 :goto_0 return v1 .end method .method public isMultiplexed()Z .locals 1 .line 536 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection; if-eqz v0, :cond_0 const/4 v0, 0x1 goto :goto_0 :cond_0 const/4 v0, 0x0 :goto_0 return v0 .end method .method public newCodec(Lokhttp3/OkHttpClient;Lokhttp3/internal/connection/StreamAllocation;)Lokhttp3/internal/http/HttpCodec; .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/net/SocketException; } .end annotation .line 452 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection; if-eqz v0, :cond_0 .line 453 new-instance v0, Lokhttp3/internal/http2/Http2Codec; iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection; invoke-direct {v0, p1, p2, v1}, Lokhttp3/internal/http2/Http2Codec;->(Lokhttp3/OkHttpClient;Lokhttp3/internal/connection/StreamAllocation;Lokhttp3/internal/http2/Http2Connection;)V return-object v0 .line 455 :cond_0 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; invoke-virtual {p1}, Lokhttp3/OkHttpClient;->readTimeoutMillis()I move-result v1 invoke-virtual {v0, v1}, Ljava/net/Socket;->setSoTimeout(I)V .line 456 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; invoke-interface {v0}, Lokio/BufferedSource;->timeout()Lokio/Timeout; move-result-object v0 invoke-virtual {p1}, Lokhttp3/OkHttpClient;->readTimeoutMillis()I move-result v1 int-to-long v1, v1 sget-object v3, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit; invoke-virtual {v0, v1, v2, v3}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout; .line 457 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; invoke-interface {v0}, Lokio/BufferedSink;->timeout()Lokio/Timeout; move-result-object v0 invoke-virtual {p1}, Lokhttp3/OkHttpClient;->writeTimeoutMillis()I move-result v1 int-to-long v1, v1 sget-object v3, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit; invoke-virtual {v0, v1, v2, v3}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout; .line 458 new-instance v0, Lokhttp3/internal/http1/Http1Codec; iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; iget-object v2, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; invoke-direct {v0, p1, p2, v1, v2}, Lokhttp3/internal/http1/Http1Codec;->(Lokhttp3/OkHttpClient;Lokhttp3/internal/connection/StreamAllocation;Lokio/BufferedSource;Lokio/BufferedSink;)V return-object v0 .end method .method public newWebSocketStreams(Lokhttp3/internal/connection/StreamAllocation;)Lokhttp3/internal/ws/RealWebSocket$Streams; .locals 7 .line 463 new-instance v6, Lokhttp3/internal/connection/RealConnection$1; iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource; iget-object v4, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink; const/4 v2, 0x1 move-object v0, v6 move-object v1, p0 move-object v5, p1 invoke-direct/range {v0 .. v5}, Lokhttp3/internal/connection/RealConnection$1;->(Lokhttp3/internal/connection/RealConnection;ZLokio/BufferedSource;Lokio/BufferedSink;Lokhttp3/internal/connection/StreamAllocation;)V return-object v6 .end method .method public onSettings(Lokhttp3/internal/http2/Http2Connection;)V .locals 1 .line 522 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->connectionPool:Lokhttp3/ConnectionPool; monitor-enter v0 .line 523 :try_start_0 invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Connection;->maxConcurrentStreams()I move-result p1 iput p1, p0, Lokhttp3/internal/connection/RealConnection;->allocationLimit:I .line 524 monitor-exit v0 return-void :catchall_0 move-exception p1 monitor-exit v0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw p1 .end method .method public onStream(Lokhttp3/internal/http2/Http2Stream;)V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 517 sget-object v0, Lokhttp3/internal/http2/ErrorCode;->REFUSED_STREAM:Lokhttp3/internal/http2/ErrorCode; invoke-virtual {p1, v0}, Lokhttp3/internal/http2/Http2Stream;->close(Lokhttp3/internal/http2/ErrorCode;)V return-void .end method .method public protocol()Lokhttp3/Protocol; .locals 1 .line 540 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol; return-object v0 .end method .method public route()Lokhttp3/Route; .locals 1 .line 471 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; return-object v0 .end method .method public socket()Ljava/net/Socket; .locals 1 .line 480 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket; return-object v0 .end method .method public supportsUrl(Lokhttp3/HttpUrl;)Z .locals 4 .line 437 invoke-virtual {p1}, Lokhttp3/HttpUrl;->port()I move-result v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v1 invoke-virtual {v1}, Lokhttp3/HttpUrl;->port()I move-result v1 const/4 v2, 0x0 if-eq v0, v1, :cond_0 return v2 .line 441 :cond_0 invoke-virtual {p1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v1 invoke-virtual {v1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v0 const/4 v1, 0x1 if-nez v0, :cond_2 .line 443 iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake; if-eqz v0, :cond_1 sget-object v0, Lokhttp3/internal/tls/OkHostnameVerifier;->INSTANCE:Lokhttp3/internal/tls/OkHostnameVerifier; .line 444 invoke-virtual {p1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object p1 iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake; invoke-virtual {v3}, Lokhttp3/Handshake;->peerCertificates()Ljava/util/List; move-result-object v3 invoke-interface {v3, v2}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object v3 check-cast v3, Ljava/security/cert/X509Certificate; .line 443 invoke-virtual {v0, p1, v3}, Lokhttp3/internal/tls/OkHostnameVerifier;->verify(Ljava/lang/String;Ljava/security/cert/X509Certificate;)Z move-result p1 if-eqz p1, :cond_1 move v2, v1 :cond_1 return v2 :cond_2 return v1 .end method .method public toString()Ljava/lang/String; .locals 2 .line 544 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v1, "Connection{" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; .line 545 invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v1 invoke-virtual {v1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, ":" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v1 invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v1 invoke-virtual {v1}, Lokhttp3/HttpUrl;->port()I move-result v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, ", proxy=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; .line 547 invoke-virtual {v1}, Lokhttp3/Route;->proxy()Ljava/net/Proxy; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " hostAddress=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route; .line 549 invoke-virtual {v1}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " cipherSuite=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake; if-eqz v1, :cond_0 .line 551 invoke-virtual {v1}, Lokhttp3/Handshake;->cipherSuite()Lokhttp3/CipherSuite; move-result-object v1 goto :goto_0 :cond_0 const-string v1, "none" :goto_0 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " protocol=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol; invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object v0 const/16 v1, 0x7d invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 return-object v0 .end method