.class public final Lokhttp3/internal/connection/ExchangeFinder; .super Ljava/lang/Object; .source "ExchangeFinder.kt" # annotations .annotation system Ldalvik/annotation/SourceDebugExtension; value = "SMAP\nExchangeFinder.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ExchangeFinder.kt\nokhttp3/internal/connection/ExchangeFinder\n+ 2 Util.kt\nokhttp3/internal/Util\n*L\n1#1,336:1\n573#2,4:337\n580#2,4:341\n*E\n*S KotlinDebug\n*F\n+ 1 ExchangeFinder.kt\nokhttp3/internal/connection/ExchangeFinder\n*L\n270#1,4:337\n275#1,4:341\n*E\n" .end annotation .annotation runtime Lkotlin/Metadata; bv = { 0x1, 0x0, 0x3 } d1 = { "\u0000l\n\u0002\u0018\u0002\n\u0002\u0010\u0000\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\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0008\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0003\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\u0006\n\u0002\u0010\u000b\n\u0002\u0008\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B%\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\u0006\u0010\u0008\u001a\u00020\t\u00a2\u0006\u0002\u0010\nJ\u0008\u0010\r\u001a\u0004\u0018\u00010\u000eJ\u0016\u0010\u0019\u001a\u00020\u001a2\u0006\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\u001eJ0\u0010\u001f\u001a\u00020\u000e2\u0006\u0010 \u001a\u00020\u00102\u0006\u0010!\u001a\u00020\u00102\u0006\u0010\"\u001a\u00020\u00102\u0006\u0010#\u001a\u00020\u00102\u0006\u0010$\u001a\u00020%H\u0002J8\u0010&\u001a\u00020\u000e2\u0006\u0010 \u001a\u00020\u00102\u0006\u0010!\u001a\u00020\u00102\u0006\u0010\"\u001a\u00020\u00102\u0006\u0010#\u001a\u00020\u00102\u0006\u0010$\u001a\u00020%2\u0006\u0010\'\u001a\u00020%H\u0002J\u0006\u0010(\u001a\u00020%J\u0008\u0010)\u001a\u00020%H\u0002J\u000e\u0010*\u001a\u00020+2\u0006\u0010,\u001a\u00020-R\u0014\u0010\u0004\u001a\u00020\u0005X\u0080\u0004\u00a2\u0006\u0008\n\u0000\u001a\u0004\u0008\u000b\u0010\u000cR\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\r\u001a\u0004\u0018\u00010\u000eX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u0010X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0008\u001a\u00020\tX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0011\u001a\u0004\u0018\u00010\u0012X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0013\u001a\u00020\u0010X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0010X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0015\u001a\u0004\u0018\u00010\u0016X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0017\u001a\u0004\u0018\u00010\u0018X\u0082\u000e\u00a2\u0006\u0002\n\u0000\u00a8\u0006." } d2 = { "Lokhttp3/internal/connection/ExchangeFinder;", "", "connectionPool", "Lokhttp3/internal/connection/RealConnectionPool;", "address", "Lokhttp3/Address;", "call", "Lokhttp3/internal/connection/RealCall;", "eventListener", "Lokhttp3/EventListener;", "(Lokhttp3/internal/connection/RealConnectionPool;Lokhttp3/Address;Lokhttp3/internal/connection/RealCall;Lokhttp3/EventListener;)V", "getAddress$okhttp", "()Lokhttp3/Address;", "connectingConnection", "Lokhttp3/internal/connection/RealConnection;", "connectionShutdownCount", "", "nextRouteToTry", "Lokhttp3/Route;", "otherFailureCount", "refusedStreamCount", "routeSelection", "Lokhttp3/internal/connection/RouteSelector$Selection;", "routeSelector", "Lokhttp3/internal/connection/RouteSelector;", "find", "Lokhttp3/internal/http/ExchangeCodec;", "client", "Lokhttp3/OkHttpClient;", "chain", "Lokhttp3/internal/http/RealInterceptorChain;", "findConnection", "connectTimeout", "readTimeout", "writeTimeout", "pingIntervalMillis", "connectionRetryEnabled", "", "findHealthyConnection", "doExtensiveHealthChecks", "retryAfterFailure", "retryCurrentRoute", "trackFailure", "", "e", "Ljava/io/IOException;", "okhttp" } k = 0x1 mv = { 0x1, 0x1, 0x10 } .end annotation # instance fields .field private final address:Lokhttp3/Address; .field private final call:Lokhttp3/internal/connection/RealCall; .field private connectingConnection:Lokhttp3/internal/connection/RealConnection; .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 .registers 6 const-string v0, "connectionPool" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "address" invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "call" invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "eventListener" invoke-static {p4, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V .line 54 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; .registers 24 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation move-object/from16 v1, p0 const/4 v0, 0x0 .line 138 move-object v2, v0 check-cast v2, Lokhttp3/internal/connection/RealConnection; .line 139 move-object v2, v0 check-cast v2, Lokhttp3/Route; .line 140 new-instance v2, Lkotlin/jvm/internal/Ref$ObjectRef; invoke-direct {v2}, Lkotlin/jvm/internal/Ref$ObjectRef;->()V .line 142 iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; monitor-enter v3 .line 143 :try_start_11 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4}, Lokhttp3/internal/connection/RealCall;->isCanceled()Z move-result v4 if-nez v4, :cond_21d .line 145 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v4 iput-object v4, v2, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object; .line 147 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v4 if-eqz v4, :cond_58 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v4 if-nez v4, :cond_34 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_34 invoke-virtual {v4}, Lokhttp3/internal/connection/RealConnection;->getNoNewExchanges()Z move-result v4 if-nez v4, :cond_51 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v4 if-nez v4, :cond_45 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_45 iget-object v5, v1, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; invoke-virtual {v5}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v5 invoke-virtual {v4, v5}, Lokhttp3/internal/connection/RealConnection;->supportsUrl(Lokhttp3/HttpUrl;)Z move-result v4 if-nez v4, :cond_58 .line 148 :cond_51 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4}, Lokhttp3/internal/connection/RealCall;->releaseConnectionNoEvents$okhttp()Ljava/net/Socket; move-result-object v4 goto :goto_59 :cond_58 move-object v4, v0 .line 153 :goto_59 iget-object v5, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v5}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v5 if-eqz v5, :cond_6d .line 155 iget-object v5, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v5}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v5 .line 156 move-object v6, v0 check-cast v6, Lokhttp3/internal/connection/RealConnection; iput-object v0, v2, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object; goto :goto_6e :cond_6d move-object v5, v0 :goto_6e const/4 v6, 0x1 const/4 v7, 0x0 if-nez v5, :cond_97 .line 161 iput v7, v1, Lokhttp3/internal/connection/ExchangeFinder;->refusedStreamCount:I .line 162 iput v7, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionShutdownCount:I .line 163 iput v7, v1, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I .line 166 iget-object v8, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; iget-object v9, v1, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; iget-object v10, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v8, v9, v10, v0, v7}, Lokhttp3/internal/connection/RealConnectionPool;->callAcquirePooledConnection(Lokhttp3/Address;Lokhttp3/internal/connection/RealCall;Ljava/util/List;Z)Z move-result v8 if-eqz v8, :cond_8d .line 168 iget-object v5, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v5}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v5 move-object v8, v0 move v9, v6 goto :goto_99 .line 169 :cond_8d iget-object v8, v1, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; if-eqz v8, :cond_97 .line 171 move-object v9, v0 check-cast v9, Lokhttp3/Route; iput-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; goto :goto_98 :cond_97 move-object v8, v0 :goto_98 move v9, v7 .line 174 :goto_99 sget-object v10, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; :try_end_9b .catchall {:try_start_11 .. :try_end_9b} :catchall_227 .line 142 monitor-exit v3 if-eqz v4, :cond_a1 .line 175 invoke-static {v4}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V .line 177 :cond_a1 iget-object v3, v2, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object; check-cast v3, Lokhttp3/internal/connection/RealConnection; if-eqz v3, :cond_bb .line 178 iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; check-cast v4, Lokhttp3/Call; iget-object v2, v2, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object; check-cast v2, Lokhttp3/internal/connection/RealConnection; if-nez v2, :cond_b6 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_b6 check-cast v2, Lokhttp3/Connection; invoke-virtual {v3, v4, v2}, Lokhttp3/EventListener;->connectionReleased(Lokhttp3/Call;Lokhttp3/Connection;)V :cond_bb if-eqz v9, :cond_ce .line 181 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; check-cast v3, Lokhttp3/Call; if-nez v5, :cond_c8 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_c8 move-object v4, v5 check-cast v4, Lokhttp3/Connection; invoke-virtual {v2, v3, v4}, Lokhttp3/EventListener;->connectionAcquired(Lokhttp3/Call;Lokhttp3/Connection;)V :cond_ce if-eqz v5, :cond_d6 if-nez v5, :cond_d5 .line 185 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_d5 return-object v5 :cond_d6 if-nez v8, :cond_10c .line 190 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; if-eqz v2, :cond_e7 if-nez v2, :cond_e1 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_e1 invoke-virtual {v2}, Lokhttp3/internal/connection/RouteSelector$Selection;->hasNext()Z move-result v2 if-nez v2, :cond_10c .line 191 :cond_e7 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelector:Lokhttp3/internal/connection/RouteSelector; if-nez v2, :cond_104 .line 193 new-instance v2, Lokhttp3/internal/connection/RouteSelector; iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; 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 iget-object v10, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; check-cast v10, Lokhttp3/Call; iget-object v11, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; invoke-direct {v2, v3, v4, v10, v11}, Lokhttp3/internal/connection/RouteSelector;->(Lokhttp3/Address;Lokhttp3/internal/connection/RouteDatabase;Lokhttp3/Call;Lokhttp3/EventListener;)V .line 194 iput-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelector:Lokhttp3/internal/connection/RouteSelector; .line 197 :cond_104 invoke-virtual {v2}, Lokhttp3/internal/connection/RouteSelector;->next()Lokhttp3/internal/connection/RouteSelector$Selection; move-result-object v2 iput-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; move v2, v6 goto :goto_10d :cond_10c move v2, v7 .line 200 :goto_10d move-object v3, v0 check-cast v3, Ljava/util/List; .line 201 iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; monitor-enter v3 .line 202 :try_start_113 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4}, Lokhttp3/internal/connection/RealCall;->isCanceled()Z move-result v4 if-nez v4, :cond_210 if-eqz v2, :cond_13c .line 207 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; if-nez v2, :cond_124 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_124 invoke-virtual {v2}, Lokhttp3/internal/connection/RouteSelector$Selection;->getRoutes()Ljava/util/List; move-result-object v2 .line 208 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; iget-object v10, v1, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; iget-object v11, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4, v10, v11, v2, v7}, Lokhttp3/internal/connection/RealConnectionPool;->callAcquirePooledConnection(Lokhttp3/Address;Lokhttp3/internal/connection/RealCall;Ljava/util/List;Z)Z move-result v4 if-eqz v4, :cond_13d .line 210 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v5 move v9, v6 goto :goto_13d :cond_13c move-object v2, v0 :cond_13d :goto_13d if-nez v9, :cond_15a if-nez v8, :cond_14c .line 216 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; if-nez v4, :cond_148 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_148 invoke-virtual {v4}, Lokhttp3/internal/connection/RouteSelector$Selection;->next()Lokhttp3/Route; move-result-object v8 .line 221 :cond_14c new-instance v5, Lokhttp3/internal/connection/RealConnection; iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; if-nez v8, :cond_155 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_155 invoke-direct {v5, v4, v8}, Lokhttp3/internal/connection/RealConnection;->(Lokhttp3/internal/connection/RealConnectionPool;Lokhttp3/Route;)V .line 222 iput-object v5, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectingConnection:Lokhttp3/internal/connection/RealConnection; .line 224 :cond_15a sget-object v4, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; :try_end_15c .catchall {:try_start_113 .. :try_end_15c} :catchall_21a .line 201 monitor-exit v3 if-eqz v9, :cond_176 .line 228 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; check-cast v2, Lokhttp3/Call; if-nez v5, :cond_16a invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_16a move-object v3, v5 check-cast v3, Lokhttp3/Connection; invoke-virtual {v0, v2, v3}, Lokhttp3/EventListener;->connectionAcquired(Lokhttp3/Call;Lokhttp3/Connection;)V if-nez v5, :cond_175 .line 229 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_175 return-object v5 :cond_176 if-nez v5, :cond_17b .line 233 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V .line 239 :cond_17b iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; move-object/from16 v16, v3 check-cast v16, Lokhttp3/Call; .line 240 iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; move-object v10, v5 move/from16 v11, p1 move/from16 v12, p2 move/from16 v13, p3 move/from16 v14, p4 move/from16 v15, p5 move-object/from16 v17, v3 .line 233 invoke-virtual/range {v10 .. v17}, Lokhttp3/internal/connection/RealConnection;->connect(IIIIZLokhttp3/Call;Lokhttp3/EventListener;)V .line 242 iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v3}, Lokhttp3/internal/connection/RealCall;->getClient()Lokhttp3/OkHttpClient; move-result-object v3 invoke-virtual {v3}, Lokhttp3/OkHttpClient;->getRouteDatabase()Lokhttp3/internal/connection/RouteDatabase; move-result-object v3 if-nez v5, :cond_1a2 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_1a2 invoke-virtual {v5}, Lokhttp3/internal/connection/RealConnection;->route()Lokhttp3/Route; move-result-object v4 invoke-virtual {v3, v4}, Lokhttp3/internal/connection/RouteDatabase;->connected(Lokhttp3/Route;)V .line 244 move-object v3, v0 check-cast v3, Ljava/net/Socket; .line 245 iget-object v3, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; monitor-enter v3 .line 246 :try_start_1af move-object v4, v0 check-cast v4, Lokhttp3/internal/connection/RealConnection; iput-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectingConnection:Lokhttp3/internal/connection/RealConnection; .line 249 iget-object v4, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; iget-object v7, v1, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; iget-object v9, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v4, v7, v9, v2, v6}, Lokhttp3/internal/connection/RealConnectionPool;->callAcquirePooledConnection(Lokhttp3/Address;Lokhttp3/internal/connection/RealCall;Ljava/util/List;Z)Z move-result v2 if-eqz v2, :cond_1da if-nez v5, :cond_1c5 .line 251 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_1c5 invoke-virtual {v5, v6}, Lokhttp3/internal/connection/RealConnection;->setNoNewExchanges(Z)V if-nez v5, :cond_1cd .line 252 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_1cd invoke-virtual {v5}, Lokhttp3/internal/connection/RealConnection;->socket()Ljava/net/Socket; move-result-object v0 .line 253 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v2}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v5 .line 257 iput-object v8, v1, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; goto :goto_1ee .line 259 :cond_1da iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; if-nez v5, :cond_1e1 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_1e1 invoke-virtual {v2, v5}, Lokhttp3/internal/connection/RealConnectionPool;->put(Lokhttp3/internal/connection/RealConnection;)V .line 260 iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; if-nez v5, :cond_1eb invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_1eb invoke-virtual {v2, v5}, Lokhttp3/internal/connection/RealCall;->acquireConnectionNoEvents(Lokhttp3/internal/connection/RealConnection;)V .line 262 :goto_1ee sget-object v2, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; :try_end_1f0 .catchall {:try_start_1af .. :try_end_1f0} :catchall_20d .line 245 monitor-exit v3 if-eqz v0, :cond_1f6 .line 263 invoke-static {v0}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V .line 265 :cond_1f6 iget-object v0, v1, Lokhttp3/internal/connection/ExchangeFinder;->eventListener:Lokhttp3/EventListener; iget-object v2, v1, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; check-cast v2, Lokhttp3/Call; if-nez v5, :cond_201 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_201 move-object v3, v5 check-cast v3, Lokhttp3/Connection; invoke-virtual {v0, v2, v3}, Lokhttp3/EventListener;->connectionAcquired(Lokhttp3/Call;Lokhttp3/Connection;)V if-nez v5, :cond_20c .line 266 invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_20c return-object v5 :catchall_20d move-exception v0 .line 245 monitor-exit v3 throw v0 .line 202 :cond_210 :try_start_210 new-instance v0, Ljava/io/IOException; const-string v2, "Canceled" invoke-direct {v0, v2}, Ljava/io/IOException;->(Ljava/lang/String;)V check-cast v0, Ljava/lang/Throwable; throw v0 :try_end_21a .catchall {:try_start_210 .. :try_end_21a} :catchall_21a :catchall_21a move-exception v0 .line 201 monitor-exit v3 throw v0 .line 143 :cond_21d :try_start_21d new-instance v0, Ljava/io/IOException; const-string v2, "Canceled" invoke-direct {v0, v2}, Ljava/io/IOException;->(Ljava/lang/String;)V check-cast v0, Ljava/lang/Throwable; throw v0 :try_end_227 .catchall {:try_start_21d .. :try_end_227} :catchall_227 :catchall_227 move-exception v0 .line 142 monitor-exit v3 throw v0 .end method .method private final findHealthyConnection(IIIIZZ)Lokhttp3/internal/connection/RealConnection; .registers 9 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 107 :goto_0 invoke-direct/range {p0 .. p5}, Lokhttp3/internal/connection/ExchangeFinder;->findConnection(IIIIZ)Lokhttp3/internal/connection/RealConnection; move-result-object v0 .line 116 invoke-virtual {v0, p6}, Lokhttp3/internal/connection/RealConnection;->isHealthy(Z)Z move-result v1 if-nez v1, :cond_e .line 117 invoke-virtual {v0}, Lokhttp3/internal/connection/RealConnection;->noNewExchanges()V goto :goto_0 :cond_e return-object v0 .end method .method private final retryCurrentRoute()Z .registers 5 .line 326 iget v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->refusedStreamCount:I const/4 v1, 0x0 const/4 v2, 0x1 if-gt v0, v2, :cond_36 iget v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionShutdownCount:I if-gt v0, v2, :cond_36 iget v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I if-lez v0, :cond_f goto :goto_36 .line 330 :cond_f 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_36 .line 333 invoke-virtual {v0}, Lokhttp3/internal/connection/RealConnection;->getRouteFailureCount$okhttp()I move-result v3 if-nez v3, :cond_36 invoke-virtual {v0}, Lokhttp3/internal/connection/RealConnection;->route()Lokhttp3/Route; move-result-object v0 invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address; move-result-object v0 invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl; move-result-object v0 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 {v0, v3}, Lokhttp3/internal/Util;->canReuseConnectionFor(Lokhttp3/HttpUrl;Lokhttp3/HttpUrl;)Z move-result v0 if-eqz v0, :cond_36 move v1, v2 :cond_36 :goto_36 return v1 .end method # virtual methods .method public final connectingConnection()Lokhttp3/internal/connection/RealConnection; .registers 6 .line 270 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; .line 337 sget-boolean v1, Lokhttp3/internal/Util;->assertionsEnabled:Z if-eqz v1, :cond_3b invoke-static {v0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_d goto :goto_3b .line 338 :cond_d new-instance v1, Ljava/lang/AssertionError; new-instance v2, Ljava/lang/StringBuilder; const-string v3, "Thread " invoke-direct {v2, v3}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; move-result-object v3 const-string v4, "Thread.currentThread()" invoke-static {v3, v4}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-virtual {v3}, Ljava/lang/Thread;->getName()Ljava/lang/String; move-result-object v3 invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v2 const-string v3, " MUST hold lock on " invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v2 invoke-virtual {v2, v0}, 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 {v1, v0}, Ljava/lang/AssertionError;->(Ljava/lang/Object;)V check-cast v1, Ljava/lang/Throwable; throw v1 .line 271 :cond_3b :goto_3b iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectingConnection:Lokhttp3/internal/connection/RealConnection; return-object v0 .end method .method public final find(Lokhttp3/OkHttpClient;Lokhttp3/internal/http/RealInterceptorChain;)Lokhttp3/internal/http/ExchangeCodec; .registers 11 const-string v0, "client" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "chain" invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V .line 76 :try_start_a invoke-virtual {p2}, Lokhttp3/internal/http/RealInterceptorChain;->getConnectTimeoutMillis$okhttp()I move-result v2 .line 77 invoke-virtual {p2}, Lokhttp3/internal/http/RealInterceptorChain;->getReadTimeoutMillis$okhttp()I move-result v3 .line 78 invoke-virtual {p2}, Lokhttp3/internal/http/RealInterceptorChain;->getWriteTimeoutMillis$okhttp()I move-result v4 .line 79 invoke-virtual {p1}, Lokhttp3/OkHttpClient;->pingIntervalMillis()I move-result v5 .line 80 invoke-virtual {p1}, Lokhttp3/OkHttpClient;->retryOnConnectionFailure()Z move-result v6 .line 81 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/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v0 xor-int/lit8 v7, v0, 0x1 move-object v1, p0 .line 75 invoke-direct/range {v1 .. v7}, Lokhttp3/internal/connection/ExchangeFinder;->findHealthyConnection(IIIIZZ)Lokhttp3/internal/connection/RealConnection; move-result-object v0 .line 83 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_37 .catch Lokhttp3/internal/connection/RouteException; {:try_start_a .. :try_end_37} :catch_44 .catch Ljava/io/IOException; {:try_start_a .. :try_end_37} :catch_38 return-object p1 :catch_38 move-exception p1 .line 88 invoke-virtual {p0, p1}, Lokhttp3/internal/connection/ExchangeFinder;->trackFailure(Ljava/io/IOException;)V .line 89 new-instance p2, Lokhttp3/internal/connection/RouteException; invoke-direct {p2, p1}, Lokhttp3/internal/connection/RouteException;->(Ljava/io/IOException;)V check-cast p2, Ljava/lang/Throwable; throw p2 :catch_44 move-exception p1 .line 85 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 86 check-cast p1, Ljava/lang/Throwable; throw p1 .end method .method public final getAddress$okhttp()Lokhttp3/Address; .registers 2 .line 56 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->address:Lokhttp3/Address; return-object v0 .end method .method public final retryAfterFailure()Z .registers 4 .line 294 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; monitor-enter v0 .line 295 :try_start_3 iget v1, p0, Lokhttp3/internal/connection/ExchangeFinder;->refusedStreamCount:I if-nez v1, :cond_12 iget v1, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionShutdownCount:I if-nez v1, :cond_12 iget v1, p0, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I :try_end_d .catchall {:try_start_3 .. :try_end_d} :catchall_4a if-nez v1, :cond_12 .line 296 monitor-exit v0 const/4 v0, 0x0 return v0 .line 299 :cond_12 :try_start_12 iget-object v1, p0, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; :try_end_14 .catchall {:try_start_12 .. :try_end_14} :catchall_4a const/4 v2, 0x1 if-eqz v1, :cond_19 .line 300 monitor-exit v0 return v2 .line 303 :cond_19 :try_start_19 invoke-direct {p0}, Lokhttp3/internal/connection/ExchangeFinder;->retryCurrentRoute()Z move-result v1 if-eqz v1, :cond_32 .line 305 iget-object v1, p0, Lokhttp3/internal/connection/ExchangeFinder;->call:Lokhttp3/internal/connection/RealCall; invoke-virtual {v1}, Lokhttp3/internal/connection/RealCall;->getConnection()Lokhttp3/internal/connection/RealConnection; move-result-object v1 if-nez v1, :cond_2a invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V :cond_2a invoke-virtual {v1}, Lokhttp3/internal/connection/RealConnection;->route()Lokhttp3/Route; move-result-object v1 iput-object v1, p0, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; :try_end_30 .catchall {:try_start_19 .. :try_end_30} :catchall_4a .line 306 monitor-exit v0 return v2 .line 310 :cond_32 :try_start_32 iget-object v1, p0, Lokhttp3/internal/connection/ExchangeFinder;->routeSelection:Lokhttp3/internal/connection/RouteSelector$Selection; if-eqz v1, :cond_3e invoke-virtual {v1}, Lokhttp3/internal/connection/RouteSelector$Selection;->hasNext()Z move-result v1 :try_end_3a .catchall {:try_start_32 .. :try_end_3a} :catchall_4a if-ne v1, v2, :cond_3e monitor-exit v0 return v2 .line 313 :cond_3e :try_start_3e iget-object v1, p0, Lokhttp3/internal/connection/ExchangeFinder;->routeSelector:Lokhttp3/internal/connection/RouteSelector; if-eqz v1, :cond_48 .line 316 invoke-virtual {v1}, Lokhttp3/internal/connection/RouteSelector;->hasNext()Z move-result v1 :try_end_46 .catchall {:try_start_3e .. :try_end_46} :catchall_4a monitor-exit v0 return v1 .line 313 :cond_48 monitor-exit v0 return v2 :catchall_4a move-exception v1 .line 294 monitor-exit v0 throw v1 .end method .method public final trackFailure(Ljava/io/IOException;)V .registers 6 const-string v0, "e" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V .line 275 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; .line 341 sget-boolean v1, Lokhttp3/internal/Util;->assertionsEnabled:Z if-eqz v1, :cond_40 invoke-static {v0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z move-result v1 if-nez v1, :cond_12 goto :goto_40 .line 342 :cond_12 new-instance p1, Ljava/lang/AssertionError; new-instance v1, Ljava/lang/StringBuilder; const-string v2, "Thread " invoke-direct {v1, v2}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; move-result-object v2 const-string v3, "Thread.currentThread()" invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-virtual {v2}, Ljava/lang/Thread;->getName()Ljava/lang/String; move-result-object v2 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 const-string v2, " MUST NOT hold lock on " invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 invoke-virtual {v1, v0}, 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 {p1, v0}, Ljava/lang/AssertionError;->(Ljava/lang/Object;)V check-cast p1, Ljava/lang/Throwable; throw p1 .line 277 :cond_40 :goto_40 iget-object v0, p0, Lokhttp3/internal/connection/ExchangeFinder;->connectionPool:Lokhttp3/internal/connection/RealConnectionPool; monitor-enter v0 const/4 v1, 0x0 .line 278 :try_start_44 move-object v2, v1 check-cast v2, Lokhttp3/Route; iput-object v1, p0, Lokhttp3/internal/connection/ExchangeFinder;->nextRouteToTry:Lokhttp3/Route; .line 279 instance-of v1, p1, Lokhttp3/internal/http2/StreamResetException; if-eqz v1, :cond_5d move-object v1, p1 check-cast v1, Lokhttp3/internal/http2/StreamResetException; iget-object v1, v1, Lokhttp3/internal/http2/StreamResetException;->errorCode:Lokhttp3/internal/http2/ErrorCode; sget-object v2, Lokhttp3/internal/http2/ErrorCode;->REFUSED_STREAM:Lokhttp3/internal/http2/ErrorCode; if-ne v1, v2, :cond_5d .line 280 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_6e .line 281 :cond_5d instance-of p1, p1, Lokhttp3/internal/http2/ConnectionShutdownException; if-eqz p1, :cond_68 .line 282 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_6e .line 284 :cond_68 iget p1, p0, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I add-int/lit8 p1, p1, 0x1 iput p1, p0, Lokhttp3/internal/connection/ExchangeFinder;->otherFailureCount:I :try_end_6e .catchall {:try_start_44 .. :try_end_6e} :catchall_70 .line 277 :goto_6e monitor-exit v0 return-void :catchall_70 move-exception p1 monitor-exit v0 throw p1 .end method