.class public final Lokhttp3/internal/connection/ExchangeFinder; .super Ljava/lang/Object; .source "ExchangeFinder.kt" # annotations .annotation runtime Lkotlin/Metadata; bv = {} d1 = { "\u0000~\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u0008\n\u0002\u0008\u0004\n\u0002\u0010\u000b\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0008\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0004\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0005\u0018\u00002\u00020\u0001B\'\u0012\u0006\u0010*\u001a\u00020)\u0012\u0006\u0010-\u001a\u00020,\u0012\u0006\u00102\u001a\u000201\u0012\u0006\u00105\u001a\u000204\u00a2\u0006\u0004\u00087\u00108J8\u0010\u000b\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00022\u0006\u0010\u0006\u001a\u00020\u00022\u0006\u0010\u0008\u001a\u00020\u00072\u0006\u0010\t\u001a\u00020\u0007H\u0002J0\u0010\u000c\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00022\u0006\u0010\u0006\u001a\u00020\u00022\u0006\u0010\u0008\u001a\u00020\u0007H\u0002J\n\u0010\u000e\u001a\u0004\u0018\u00010\rH\u0002J\u0016\u0010\u0014\u001a\u00020\u00132\u0006\u0010\u0010\u001a\u00020\u000f2\u0006\u0010\u0012\u001a\u00020\u0011J\u000e\u0010\u0018\u001a\u00020\u00172\u0006\u0010\u0016\u001a\u00020\u0015J\u0006\u0010\u0019\u001a\u00020\u0007J\u000e\u0010\u001c\u001a\u00020\u00072\u0006\u0010\u001b\u001a\u00020\u001aR\u0018\u0010\u001e\u001a\u0004\u0018\u00010\u001d8\u0002@\u0002X\u0082\u000e\u00a2\u0006\u0006\n\u0004\u0008\u001e\u0010\u001fR\u0018\u0010!\u001a\u0004\u0018\u00010 8\u0002@\u0002X\u0082\u000e\u00a2\u0006\u0006\n\u0004\u0008!\u0010\"R\u0016\u0010#\u001a\u00020\u00028\u0002@\u0002X\u0082\u000e\u00a2\u0006\u0006\n\u0004\u0008#\u0010$R\u0016\u0010%\u001a\u00020\u00028\u0002@\u0002X\u0082\u000e\u00a2\u0006\u0006\n\u0004\u0008%\u0010$R\u0016\u0010&\u001a\u00020\u00028\u0002@\u0002X\u0082\u000e\u00a2\u0006\u0006\n\u0004\u0008&\u0010$R\u0018\u0010\'\u001a\u0004\u0018\u00010\r8\u0002@\u0002X\u0082\u000e\u00a2\u0006\u0006\n\u0004\u0008\'\u0010(R\u0014\u0010*\u001a\u00020)8\u0002X\u0082\u0004\u00a2\u0006\u0006\n\u0004\u0008*\u0010+R\u001a\u0010-\u001a\u00020,8\u0000X\u0080\u0004\u00a2\u0006\u000c\n\u0004\u0008-\u0010.\u001a\u0004\u0008/\u00100R\u0014\u00102\u001a\u0002018\u0002X\u0082\u0004\u00a2\u0006\u0006\n\u0004\u00082\u00103R\u0014\u00105\u001a\u0002048\u0002X\u0082\u0004\u00a2\u0006\u0006\n\u0004\u00085\u00106\u00a8\u00069" } d2 = { "Lokhttp3/internal/connection/ExchangeFinder;", "", "", "connectTimeout", "readTimeout", "writeTimeout", "pingIntervalMillis", "", "connectionRetryEnabled", "doExtensiveHealthChecks", "Lokhttp3/internal/connection/RealConnection;", "findHealthyConnection", "findConnection", "Lokhttp3/Route;", "retryRoute", "Lokhttp3/OkHttpClient;", "client", "Lokhttp3/internal/http/RealInterceptorChain;", "chain", "Lokhttp3/internal/http/ExchangeCodec;", "find", "Ljava/io/IOException;", "e", "Lkotlin/d1;", "trackFailure", "retryAfterFailure", "Lokhttp3/HttpUrl;", "url", "sameHostAndPort", "Lokhttp3/internal/connection/RouteSelector$Selection;", "routeSelection", "Lokhttp3/internal/connection/RouteSelector$Selection;", "Lokhttp3/internal/connection/RouteSelector;", "routeSelector", "Lokhttp3/internal/connection/RouteSelector;", "refusedStreamCount", "I", "connectionShutdownCount", "otherFailureCount", "nextRouteToTry", "Lokhttp3/Route;", "Lokhttp3/internal/connection/RealConnectionPool;", "connectionPool", "Lokhttp3/internal/connection/RealConnectionPool;", "Lokhttp3/Address;", "address", "Lokhttp3/Address;", "getAddress$okhttp", "()Lokhttp3/Address;", "Lokhttp3/internal/connection/RealCall;", "call", "Lokhttp3/internal/connection/RealCall;", "Lokhttp3/EventListener;", "eventListener", "Lokhttp3/EventListener;", "", "(Lokhttp3/internal/connection/RealConnectionPool;Lokhttp3/Address;Lokhttp3/internal/connection/RealCall;Lokhttp3/EventListener;)V", "okhttp" } k = 0x1 mv = { 0x1, 0x4, 0x0 } .end annotation # instance fields .field private final address:Lokhttp3/Address; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end field .field private final call:Lokhttp3/internal/connection/RealCall; .field private final connectionPool:Lokhttp3/internal/connection/RealConnectionPool; .field private connectionShutdownCount:I .field private final eventListener:Lokhttp3/EventListener; .field private nextRouteToTry:Lokhttp3/Route; .field private otherFailureCount:I .field private refusedStreamCount:I .field private routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; .field private routeSelector:Lokhttp3/internal/connection/RouteSelector; # direct methods .method public constructor (Lokhttp3/internal/connection/RealConnectionPool;Lokhttp3/Address;Lokhttp3/internal/connection/RealCall;Lokhttp3/EventListener;)V .locals 1 .param p1 # Lokhttp3/internal/connection/RealConnectionPool; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param .param p2 # Lokhttp3/Address; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param .param p3 # Lokhttp3/internal/connection/RealCall; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param .param p4 # Lokhttp3/EventListener; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param const-string v0, "connectionPool" invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "address" invoke-static {p2, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "call" invoke-static {p3, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "eventListener" invoke-static {p4, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V .line 1 invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; iput-object p2, p0, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; iput-object p3, p0, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; iput-object p4, p0, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; return-void .end method .method private final findConnection(IIIIZ)Lokhttp3/internal/connection/RealConnection; .locals 14 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation move-object v1, p0 .line 1 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v0}, Lokhttp3/internal/connection/RealCall;->isCanceled()Z move-result v0 if-nez v0, :cond_e .line 2 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v0}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v2 const/4 v0, 0x1 const/4 v3, 0x0 const/4 v4, 0x0 if-eqz v2, :cond_6 .line 3 monitor-enter v2 .line 4 :try_start_0 invoke-virtual {v2}, Lokhttp3/internal/connection/RealConnection;->getNoNewExchanges()Z move-result v5 if-nez v5, :cond_1 invoke-virtual {v2}, Lokhttp3/internal/connection/RealConnection;->route()Lokhttp3/Route; move-result-object v5 invoke-virtual {v5}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v5 invoke-virtual {v5}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v5 invoke-virtual {p0, v5}, Lokhttp3/internal/connection/ExchangeFinder;->sameHostAndPort(Lokhttp3/HttpUrl;)Z move-result v5 if-nez v5, :cond_0 goto :goto_0 :cond_0 move-object v5, v4 goto :goto_1 .line 5 :cond_1 :goto_0 iget-object v5, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v5}, Lokhttp3/internal/connection/RealCall;->releaseConnectionNoEvents$okhttp()Ljava/net/Socket; move-result-object v5 .line 6 :goto_1 sget-object v6, Lkotlin/d1;->a:Lkotlin/d1; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 7 monitor-exit v2 .line 8 iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v6}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v6 if-eqz v6, :cond_4 if-nez v5, :cond_2 goto :goto_2 :cond_2 move v0, v3 :goto_2 if-eqz v0, :cond_3 return-object v2 :cond_3 const-string v0, "Check failed." .line 9 new-instance v2, Ljava/lang/IllegalStateException; invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {v2, v0}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw v2 :cond_4 if-eqz v5, :cond_5 .line 10 invoke-static {v5}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V .line 11 :cond_5 iget-object v5, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v5, v6, v2}, Lokhttp3/EventListener;->connectionReleased(Lokhttp3/Call;Lokhttp3/Connection;)V goto :goto_3 :catchall_0 move-exception v0 .line 12 monitor-exit v2 throw v0 .line 13 :cond_6 :goto_3 iput v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->refusedStreamCount:I .line 14 iput v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionShutdownCount:I .line 15 iput v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I .line 16 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; iget-object v5, v1, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v2, v5, v6, v4, v3}, Lokhttp3/internal/connection/RealConnectionPool;->callAcquirePooledConnection(Lokhttp3/Address;Lokhttp3/internal/connection/RealCall;Ljava/util/List;Z)Z move-result v2 if-eqz v2, :cond_7 .line 17 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v0}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v0 invoke-static {v0}, Lkotlin/jvm/internal/f0;->m(Ljava/lang/Object;)V .line 18 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v2, v3, v0}, Lokhttp3/EventListener;->connectionAcquired(Lokhttp3/Call;Lokhttp3/Connection;)V return-object v0 .line 19 :cond_7 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; if-eqz v2, :cond_8 .line 20 invoke-static {v2}, Lkotlin/jvm/internal/f0;->m(Ljava/lang/Object;)V .line 21 iput-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; :goto_4 move-object v5, v4 goto :goto_5 .line 22 :cond_8 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; if-eqz v2, :cond_9 invoke-static {v2}, Lkotlin/jvm/internal/f0;->m(Ljava/lang/Object;)V invoke-virtual {v2}, Lokhttp3/internal/connection/RouteSelector$Selection;->hasNext()Z move-result v2 if-eqz v2, :cond_9 .line 23 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; invoke-static {v2}, Lkotlin/jvm/internal/f0;->m(Ljava/lang/Object;)V invoke-virtual {v2}, Lokhttp3/internal/connection/RouteSelector$Selection;->next()Lokhttp3/Route; move-result-object v2 goto :goto_4 .line 24 :cond_9 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelector:Lokhttp3/internal/connection/RouteSelector; if-nez v2, :cond_a .line 25 new-instance v2, Lokhttp3/internal/connection/RouteSelector; iget-object v5, v1, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v6}, Lokhttp3/internal/connection/RealCall;->getClient()Lokhttp3/OkHttpClient; move-result-object v6 invoke-virtual {v6}, Lokhttp3/OkHttpClient;->getRouteDatabase()Lokhttp3/internal/connection/RouteDatabase; move-result-object v6 iget-object v7, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; iget-object v8, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; invoke-direct {v2, v5, v6, v7, v8}, Lokhttp3/internal/connection/RouteSelector;->(Lokhttp3/Address;Lokhttp3/internal/connection/RouteDatabase;Lokhttp3/Call;Lokhttp3/EventListener;)V .line 26 iput-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelector:Lokhttp3/internal/connection/RouteSelector; .line 27 :cond_a invoke-virtual {v2}, Lokhttp3/internal/connection/RouteSelector;->next()Lokhttp3/internal/connection/RouteSelector$Selection; move-result-object v2 .line 28 iput-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; .line 29 invoke-virtual {v2}, Lokhttp3/internal/connection/RouteSelector$Selection;->getRoutes()Ljava/util/List; move-result-object v5 .line 30 iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v6}, Lokhttp3/internal/connection/RealCall;->isCanceled()Z move-result v6 if-nez v6, :cond_d .line 31 iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; iget-object v7, v1, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; iget-object v8, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v6, v7, v8, v5, v3}, Lokhttp3/internal/connection/RealConnectionPool;->callAcquirePooledConnection(Lokhttp3/Address;Lokhttp3/internal/connection/RealCall;Ljava/util/List;Z)Z move-result v3 if-eqz v3, :cond_b .line 32 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v0}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v0 invoke-static {v0}, Lkotlin/jvm/internal/f0;->m(Ljava/lang/Object;)V .line 33 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v2, v3, v0}, Lokhttp3/EventListener;->connectionAcquired(Lokhttp3/Call;Lokhttp3/Connection;)V return-object v0 .line 34 :cond_b invoke-virtual {v2}, Lokhttp3/internal/connection/RouteSelector$Selection;->next()Lokhttp3/Route; move-result-object v2 .line 35 :goto_5 new-instance v3, Lokhttp3/internal/connection/RealConnection; iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; invoke-direct {v3, v6, v2}, Lokhttp3/internal/connection/RealConnection;->(Lokhttp3/internal/connection/RealConnectionPool;Lokhttp3/Route;)V .line 36 iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v6, v3}, Lokhttp3/internal/connection/RealCall;->setConnectionToCancel(Lokhttp3/internal/connection/RealConnection;)V .line 37 :try_start_1 iget-object v12, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; .line 38 iget-object v13, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; move-object v6, v3 move v7, p1 move/from16 v8, p2 move/from16 v9, p3 move/from16 v10, p4 move/from16 v11, p5 .line 39 invoke-virtual/range {v6 .. v13}, Lokhttp3/internal/connection/RealConnection;->connect(IIIIZLokhttp3/Call;Lokhttp3/EventListener;)V :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_2 .line 40 iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v6, v4}, Lokhttp3/internal/connection/RealCall;->setConnectionToCancel(Lokhttp3/internal/connection/RealConnection;)V .line 41 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4}, Lokhttp3/internal/connection/RealCall;->getClient()Lokhttp3/OkHttpClient; move-result-object v4 invoke-virtual {v4}, Lokhttp3/OkHttpClient;->getRouteDatabase()Lokhttp3/internal/connection/RouteDatabase; move-result-object v4 invoke-virtual {v3}, Lokhttp3/internal/connection/RealConnection;->route()Lokhttp3/Route; move-result-object v6 invoke-virtual {v4, v6}, Lokhttp3/internal/connection/RouteDatabase;->connected(Lokhttp3/Route;)V .line 42 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; iget-object v6, v1, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; iget-object v7, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4, v6, v7, v5, v0}, Lokhttp3/internal/connection/RealConnectionPool;->callAcquirePooledConnection(Lokhttp3/Address;Lokhttp3/internal/connection/RealCall;Ljava/util/List;Z)Z move-result v0 if-eqz v0, :cond_c .line 43 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v0}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v0 invoke-static {v0}, Lkotlin/jvm/internal/f0;->m(Ljava/lang/Object;)V .line 44 iput-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; .line 45 invoke-virtual {v3}, Lokhttp3/internal/connection/RealConnection;->socket()Ljava/net/Socket; move-result-object v2 invoke-static {v2}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V .line 46 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v2, v3, v0}, Lokhttp3/EventListener;->connectionAcquired(Lokhttp3/Call;Lokhttp3/Connection;)V return-object v0 .line 47 :cond_c monitor-enter v3 .line 48 :try_start_2 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; invoke-virtual {v0, v3}, Lokhttp3/internal/connection/RealConnectionPool;->put(Lokhttp3/internal/connection/RealConnection;)V .line 49 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v0, v3}, Lokhttp3/internal/connection/RealCall;->acquireConnectionNoEvents(Lokhttp3/internal/connection/RealConnection;)V .line 50 sget-object v0, Lkotlin/d1;->a:Lkotlin/d1; :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_1 .line 51 monitor-exit v3 .line 52 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v0, v2, v3}, Lokhttp3/EventListener;->connectionAcquired(Lokhttp3/Call;Lokhttp3/Connection;)V return-object v3 :catchall_1 move-exception v0 .line 53 monitor-exit v3 throw v0 :catchall_2 move-exception v0 .line 54 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v2, v4}, Lokhttp3/internal/connection/RealCall;->setConnectionToCancel(Lokhttp3/internal/connection/RealConnection;)V throw v0 .line 55 :cond_d new-instance v0, Ljava/io/IOException; const-string v2, "Canceled" invoke-direct {v0, v2}, Ljava/io/IOException;->(Ljava/lang/String;)V throw v0 .line 56 :cond_e new-instance v0, Ljava/io/IOException; const-string v2, "Canceled" invoke-direct {v0, v2}, Ljava/io/IOException;->(Ljava/lang/String;)V throw v0 .end method .method private final findHealthyConnection(IIIIZZ)Lokhttp3/internal/connection/RealConnection; .locals 2 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 1 :goto_0 invoke-direct/range {p0 .. p5}, Lokhttp3/internal/connection/ExchangeFinder;->findConnection(IIIIZ)Lokhttp3/internal/connection/RealConnection; move-result-object v0 .line 2 invoke-virtual {v0, p6}, Lokhttp3/internal/connection/RealConnection;->isHealthy(Z)Z move-result v1 if-eqz v1, :cond_0 return-object v0 .line 3 :cond_0 invoke-virtual {v0}, Lokhttp3/internal/connection/RealConnection;->noNewExchanges$okhttp()V .line 4 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; if-eqz v0, :cond_1 goto :goto_0 .line 5 :cond_1 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; const/4 v1, 0x1 if-eqz v0, :cond_2 invoke-virtual {v0}, Lokhttp3/internal/connection/RouteSelector$Selection;->hasNext()Z move-result v0 goto :goto_1 :cond_2 move v0, v1 :goto_1 if-eqz v0, :cond_3 goto :goto_0 .line 6 :cond_3 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->routeSelector:Lokhttp3/internal/connection/RouteSelector; if-eqz v0, :cond_4 invoke-virtual {v0}, Lokhttp3/internal/connection/RouteSelector;->hasNext()Z move-result v1 :cond_4 if-eqz v1, :cond_5 goto :goto_0 .line 7 :cond_5 new-instance p1, Ljava/io/IOException; const-string p2, "exhausted all routes" invoke-direct {p1, p2}, Ljava/io/IOException;->(Ljava/lang/String;)V throw p1 .end method .method private final retryRoute()Lokhttp3/Route; .locals 4 .line 1 iget v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->refusedStreamCount:I const/4 v1, 0x1 const/4 v2, 0x0 if-gt v0, v1, :cond_3 iget v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionShutdownCount:I if-gt v0, v1, :cond_3 iget v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I if-lez v0, :cond_0 goto :goto_0 .line 2 :cond_0 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v0}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v0 if-eqz v0, :cond_3 .line 3 monitor-enter v0 .line 4 :try_start_0 invoke-virtual {v0}, Lokhttp3/internal/connection/RealConnection;->getRouteFailureCount$okhttp()I move-result v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-eqz v1, :cond_1 monitor-exit v0 return-object v2 .line 5 :cond_1 :try_start_1 invoke-virtual {v0}, 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 iget-object v3, p0, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; invoke-virtual {v3}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v3 invoke-static {v1, v3}, Lokhttp3/internal/Util;->canReuseConnectionFor(Lokhttp3/HttpUrl;Lokhttp3/HttpUrl;)Z move-result v1 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 if-nez v1, :cond_2 monitor-exit v0 return-object v2 .line 6 :cond_2 :try_start_2 invoke-virtual {v0}, Lokhttp3/internal/connection/RealConnection;->route()Lokhttp3/Route; move-result-object v1 :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_0 monitor-exit v0 return-object v1 :catchall_0 move-exception v1 .line 7 monitor-exit v0 throw v1 :cond_3 :goto_0 return-object v2 .end method # virtual methods .method public final find(Lokhttp3/OkHttpClient;Lokhttp3/internal/http/RealInterceptorChain;)Lokhttp3/internal/http/ExchangeCodec; .locals 8 .param p1 # Lokhttp3/OkHttpClient; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param .param p2 # Lokhttp3/internal/http/RealInterceptorChain; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation const-string v0, "client" invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "chain" invoke-static {p2, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V .line 1 :try_start_0 invoke-virtual {p2}, Lokhttp3/internal/http/RealInterceptorChain;->getConnectTimeoutMillis$okhttp()I move-result v2 .line 2 invoke-virtual {p2}, Lokhttp3/internal/http/RealInterceptorChain;->getReadTimeoutMillis$okhttp()I move-result v3 .line 3 invoke-virtual {p2}, Lokhttp3/internal/http/RealInterceptorChain;->getWriteTimeoutMillis$okhttp()I move-result v4 .line 4 invoke-virtual {p1}, Lokhttp3/OkHttpClient;->pingIntervalMillis()I move-result v5 .line 5 invoke-virtual {p1}, Lokhttp3/OkHttpClient;->retryOnConnectionFailure()Z move-result v6 .line 6 invoke-virtual {p2}, Lokhttp3/internal/http/RealInterceptorChain;->getRequest$okhttp()Lokhttp3/Request; move-result-object v0 invoke-virtual {v0}, Lokhttp3/Request;->method()Ljava/lang/String; move-result-object v0 const-string v1, "GET" invoke-static {v0, v1}, Lkotlin/jvm/internal/f0;->g(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v0 xor-int/lit8 v7, v0, 0x1 move-object v1, p0 .line 7 invoke-direct/range {v1 .. v7}, Lokhttp3/internal/connection/ExchangeFinder;->findHealthyConnection(IIIIZZ)Lokhttp3/internal/connection/RealConnection; move-result-object v0 .line 8 invoke-virtual {v0, p1, p2}, Lokhttp3/internal/connection/RealConnection;->newCodec$okhttp(Lokhttp3/OkHttpClient;Lokhttp3/internal/http/RealInterceptorChain;)Lokhttp3/internal/http/ExchangeCodec; move-result-object p1 :try_end_0 .catch Lokhttp3/internal/connection/RouteException; {:try_start_0 .. :try_end_0} :catch_1 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0 return-object p1 :catch_0 move-exception p1 .line 9 invoke-virtual {p0, p1}, Lokhttp3/internal/connection/ExchangeFinder;->trackFailure(Ljava/io/IOException;)V .line 10 new-instance p2, Lokhttp3/internal/connection/RouteException; invoke-direct {p2, p1}, Lokhttp3/internal/connection/RouteException;->(Ljava/io/IOException;)V throw p2 :catch_1 move-exception p1 .line 11 invoke-virtual {p1}, Lokhttp3/internal/connection/RouteException;->getLastConnectException()Ljava/io/IOException; move-result-object p2 invoke-virtual {p0, p2}, Lokhttp3/internal/connection/ExchangeFinder;->trackFailure(Ljava/io/IOException;)V .line 12 throw p1 .end method .method public final getAddress$okhttp()Lokhttp3/Address; .locals 1 .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .line 1 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; return-object v0 .end method .method public final retryAfterFailure()Z .locals 2 .line 1 iget v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->refusedStreamCount:I if-nez v0, :cond_0 iget v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionShutdownCount:I if-nez v0, :cond_0 iget v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I if-nez v0, :cond_0 const/4 v0, 0x0 return v0 .line 2 :cond_0 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; const/4 v1, 0x1 if-eqz v0, :cond_1 return v1 .line 3 :cond_1 invoke-direct {p0}, Lokhttp3/internal/connection/ExchangeFinder;->retryRoute()Lokhttp3/Route; move-result-object v0 if-eqz v0, :cond_2 .line 4 iput-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; return v1 .line 5 :cond_2 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; if-eqz v0, :cond_3 invoke-virtual {v0}, Lokhttp3/internal/connection/RouteSelector$Selection;->hasNext()Z move-result v0 if-ne v0, v1, :cond_3 return v1 .line 6 :cond_3 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->routeSelector:Lokhttp3/internal/connection/RouteSelector; if-eqz v0, :cond_4 .line 7 invoke-virtual {v0}, Lokhttp3/internal/connection/RouteSelector;->hasNext()Z move-result v0 return v0 :cond_4 return v1 .end method .method public final sameHostAndPort(Lokhttp3/HttpUrl;)Z .locals 3 .param p1 # Lokhttp3/HttpUrl; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param const-string v0, "url" invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V .line 1 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v0 .line 2 invoke-virtual {p1}, Lokhttp3/HttpUrl;->port()I move-result v1 invoke-virtual {v0}, Lokhttp3/HttpUrl;->port()I move-result v2 if-ne v1, v2, :cond_0 invoke-virtual {p1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object p1 invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String; move-result-object v0 invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->g(Ljava/lang/Object;Ljava/lang/Object;)Z move-result p1 if-eqz p1, :cond_0 const/4 p1, 0x1 goto :goto_0 :cond_0 const/4 p1, 0x0 :goto_0 return p1 .end method .method public final trackFailure(Ljava/io/IOException;)V .locals 2 .param p1 # Ljava/io/IOException; .annotation build Lorg/jetbrains/annotations/NotNull; .end annotation .end param const-string v0, "e" invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V const/4 v0, 0x0 .line 1 iput-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; .line 2 instance-of v0, p1, Lokhttp3/internal/http2/StreamResetException; if-eqz v0, :cond_0 move-object v0, p1 check-cast v0, Lokhttp3/internal/http2/StreamResetException; iget-object v0, v0, Lokhttp3/internal/http2/StreamResetException;->errorCode:Lokhttp3/internal/http2/ErrorCode; sget-object v1, Lokhttp3/internal/http2/ErrorCode;->REFUSED_STREAM:Lokhttp3/internal/http2/ErrorCode; if-ne v0, v1, :cond_0 .line 3 iget p1, p0, Lokhttp3/internal/connection/ExchangeFinder;->refusedStreamCount:I add-int/lit8 p1, p1, 0x1 iput p1, p0, Lokhttp3/internal/connection/ExchangeFinder;->refusedStreamCount:I goto :goto_0 .line 4 :cond_0 instance-of p1, p1, Lokhttp3/internal/http2/ConnectionShutdownException; if-eqz p1, :cond_1 .line 5 iget p1, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionShutdownCount:I add-int/lit8 p1, p1, 0x1 iput p1, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionShutdownCount:I goto :goto_0 .line 6 :cond_1 iget p1, p0, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I add-int/lit8 p1, p1, 0x1 iput p1, p0, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I :goto_0 return-void .end method