123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080 |
- .class public final Lokhttp3/internal/http/RetryAndFollowUpInterceptor;
- .super Ljava/lang/Object;
- .source ""
- # interfaces
- .implements Lokhttp3/Interceptor;
- # static fields
- .field private static final MAX_FOLLOW_UPS:I = 0x14
- # instance fields
- .field private callStackTrace:Ljava/lang/Object;
- .field private volatile canceled:Z
- .field private final client:Lokhttp3/OkHttpClient;
- .field private final forWebSocket:Z
- .field private streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- # direct methods
- .method public constructor <init>(Lokhttp3/OkHttpClient;Z)V
- .locals 0
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- iput-object p1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- iput-boolean p2, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->forWebSocket:Z
- return-void
- .end method
- .method private createAddress(Lokhttp3/HttpUrl;)Lokhttp3/Address;
- .locals 17
- move-object/from16 v0, p0
- invoke-virtual/range {p1 .. p1}, Lokhttp3/HttpUrl;->isHttps()Z
- move-result v1
- const/4 v2, 0x0
- if-eqz v1, :cond_0
- iget-object v1, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v1}, Lokhttp3/OkHttpClient;->sslSocketFactory()Ljavax/net/ssl/SSLSocketFactory;
- move-result-object v2
- iget-object v1, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v1}, Lokhttp3/OkHttpClient;->hostnameVerifier()Ljavax/net/ssl/HostnameVerifier;
- move-result-object v1
- iget-object v3, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v3}, Lokhttp3/OkHttpClient;->certificatePinner()Lokhttp3/CertificatePinner;
- move-result-object v3
- move-object v10, v1
- move-object v9, v2
- move-object v11, v3
- goto :goto_0
- :cond_0
- move-object v9, v2
- move-object v10, v9
- move-object v11, v10
- :goto_0
- new-instance v1, Lokhttp3/Address;
- invoke-virtual/range {p1 .. p1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v5
- invoke-virtual/range {p1 .. p1}, Lokhttp3/HttpUrl;->port()I
- move-result v6
- iget-object v2, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v2}, Lokhttp3/OkHttpClient;->dns()Lokhttp3/Dns;
- move-result-object v7
- iget-object v2, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v2}, Lokhttp3/OkHttpClient;->socketFactory()Ljavax/net/SocketFactory;
- move-result-object v8
- iget-object v2, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v2}, Lokhttp3/OkHttpClient;->proxyAuthenticator()Lokhttp3/Authenticator;
- move-result-object v12
- iget-object v2, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v2}, Lokhttp3/OkHttpClient;->proxy()Ljava/net/Proxy;
- move-result-object v13
- iget-object v2, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v2}, Lokhttp3/OkHttpClient;->protocols()Ljava/util/List;
- move-result-object v14
- iget-object v2, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v2}, Lokhttp3/OkHttpClient;->connectionSpecs()Ljava/util/List;
- move-result-object v15
- iget-object v2, v0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v2}, Lokhttp3/OkHttpClient;->proxySelector()Ljava/net/ProxySelector;
- move-result-object v16
- move-object v4, v1
- invoke-direct/range {v4 .. v16}, Lokhttp3/Address;-><init>(Ljava/lang/String;ILokhttp3/Dns;Ljavax/net/SocketFactory;Ljavax/net/ssl/SSLSocketFactory;Ljavax/net/ssl/HostnameVerifier;Lokhttp3/CertificatePinner;Lokhttp3/Authenticator;Ljava/net/Proxy;Ljava/util/List;Ljava/util/List;Ljava/net/ProxySelector;)V
- return-object v1
- .end method
- .method private followUpRequest(Lokhttp3/Response;)Lokhttp3/Request;
- .locals 7
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- if-eqz p1, :cond_13
- iget-object v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {v0}, Lokhttp3/internal/connection/StreamAllocation;->connection()Lokhttp3/internal/connection/RealConnection;
- move-result-object v0
- const/4 v1, 0x0
- if-eqz v0, :cond_0
- invoke-interface {v0}, Lokhttp3/Connection;->route()Lokhttp3/Route;
- move-result-object v0
- goto :goto_0
- :cond_0
- move-object v0, v1
- :goto_0
- invoke-virtual {p1}, Lokhttp3/Response;->code()I
- move-result v2
- invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
- move-result-object v3
- invoke-virtual {v3}, Lokhttp3/Request;->method()Ljava/lang/String;
- move-result-object v3
- const/16 v4, 0x133
- const-string v5, "GET"
- if-eq v2, v4, :cond_9
- const/16 v4, 0x134
- if-eq v2, v4, :cond_9
- const/16 v4, 0x191
- if-eq v2, v4, :cond_8
- const/16 v4, 0x197
- if-eq v2, v4, :cond_5
- const/16 v0, 0x198
- if-eq v2, v0, :cond_1
- packed-switch v2, :pswitch_data_0
- return-object v1
- :cond_1
- iget-object v2, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v2}, Lokhttp3/OkHttpClient;->retryOnConnectionFailure()Z
- move-result v2
- if-nez v2, :cond_2
- return-object v1
- :cond_2
- invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
- move-result-object v2
- invoke-virtual {v2}, Lokhttp3/Request;->body()Lokhttp3/RequestBody;
- move-result-object v2
- instance-of v2, v2, Lokhttp3/internal/http/UnrepeatableRequestBody;
- if-eqz v2, :cond_3
- return-object v1
- :cond_3
- invoke-virtual {p1}, Lokhttp3/Response;->priorResponse()Lokhttp3/Response;
- move-result-object v2
- if-eqz v2, :cond_4
- invoke-virtual {p1}, Lokhttp3/Response;->priorResponse()Lokhttp3/Response;
- move-result-object v2
- invoke-virtual {v2}, Lokhttp3/Response;->code()I
- move-result v2
- if-ne v2, v0, :cond_4
- return-object v1
- :cond_4
- invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
- move-result-object p1
- return-object p1
- :cond_5
- if-eqz v0, :cond_6
- invoke-virtual {v0}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
- move-result-object v1
- goto :goto_1
- :cond_6
- iget-object v1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v1}, Lokhttp3/OkHttpClient;->proxy()Ljava/net/Proxy;
- move-result-object v1
- :goto_1
- invoke-virtual {v1}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type;
- move-result-object v1
- sget-object v2, Ljava/net/Proxy$Type;->HTTP:Ljava/net/Proxy$Type;
- if-ne v1, v2, :cond_7
- iget-object v1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v1}, Lokhttp3/OkHttpClient;->proxyAuthenticator()Lokhttp3/Authenticator;
- move-result-object v1
- invoke-interface {v1, v0, p1}, Lokhttp3/Authenticator;->authenticate(Lokhttp3/Route;Lokhttp3/Response;)Lokhttp3/Request;
- move-result-object p1
- return-object p1
- :cond_7
- new-instance p1, Ljava/net/ProtocolException;
- const-string v0, "Received HTTP_PROXY_AUTH (407) code while not using proxy"
- invoke-direct {p1, v0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
- throw p1
- :cond_8
- iget-object v1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v1}, Lokhttp3/OkHttpClient;->authenticator()Lokhttp3/Authenticator;
- move-result-object v1
- invoke-interface {v1, v0, p1}, Lokhttp3/Authenticator;->authenticate(Lokhttp3/Route;Lokhttp3/Response;)Lokhttp3/Request;
- move-result-object p1
- return-object p1
- :cond_9
- invoke-virtual {v3, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v0
- if-nez v0, :cond_a
- const-string v0, "HEAD"
- invoke-virtual {v3, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v0
- if-nez v0, :cond_a
- return-object v1
- :cond_a
- :pswitch_0
- iget-object v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v0}, Lokhttp3/OkHttpClient;->followRedirects()Z
- move-result v0
- if-nez v0, :cond_b
- return-object v1
- :cond_b
- const-string v0, "Location"
- invoke-virtual {p1, v0}, Lokhttp3/Response;->header(Ljava/lang/String;)Ljava/lang/String;
- move-result-object v0
- if-nez v0, :cond_c
- return-object v1
- :cond_c
- invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
- move-result-object v2
- invoke-virtual {v2}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
- move-result-object v2
- invoke-virtual {v2, v0}, Lokhttp3/HttpUrl;->resolve(Ljava/lang/String;)Lokhttp3/HttpUrl;
- move-result-object v0
- if-nez v0, :cond_d
- return-object v1
- :cond_d
- invoke-virtual {v0}, Lokhttp3/HttpUrl;->scheme()Ljava/lang/String;
- move-result-object v2
- invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
- move-result-object v4
- invoke-virtual {v4}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
- move-result-object v4
- invoke-virtual {v4}, Lokhttp3/HttpUrl;->scheme()Ljava/lang/String;
- move-result-object v4
- invoke-virtual {v2, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v2
- if-nez v2, :cond_e
- iget-object v2, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v2}, Lokhttp3/OkHttpClient;->followSslRedirects()Z
- move-result v2
- if-nez v2, :cond_e
- return-object v1
- :cond_e
- invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
- move-result-object v2
- invoke-virtual {v2}, Lokhttp3/Request;->newBuilder()Lokhttp3/Request$Builder;
- move-result-object v2
- invoke-static {v3}, Lokhttp3/internal/http/HttpMethod;->permitsRequestBody(Ljava/lang/String;)Z
- move-result v4
- if-eqz v4, :cond_11
- invoke-static {v3}, Lokhttp3/internal/http/HttpMethod;->redirectsWithBody(Ljava/lang/String;)Z
- move-result v4
- invoke-static {v3}, Lokhttp3/internal/http/HttpMethod;->redirectsToGet(Ljava/lang/String;)Z
- move-result v6
- if-eqz v6, :cond_f
- invoke-virtual {v2, v5, v1}, Lokhttp3/Request$Builder;->method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- goto :goto_2
- :cond_f
- if-eqz v4, :cond_10
- invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Request;->body()Lokhttp3/RequestBody;
- move-result-object v1
- :cond_10
- invoke-virtual {v2, v3, v1}, Lokhttp3/Request$Builder;->method(Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;
- :goto_2
- if-nez v4, :cond_11
- const-string v1, "Transfer-Encoding"
- invoke-virtual {v2, v1}, Lokhttp3/Request$Builder;->removeHeader(Ljava/lang/String;)Lokhttp3/Request$Builder;
- const-string v1, "Content-Length"
- invoke-virtual {v2, v1}, Lokhttp3/Request$Builder;->removeHeader(Ljava/lang/String;)Lokhttp3/Request$Builder;
- const-string v1, "Content-Type"
- invoke-virtual {v2, v1}, Lokhttp3/Request$Builder;->removeHeader(Ljava/lang/String;)Lokhttp3/Request$Builder;
- :cond_11
- invoke-direct {p0, p1, v0}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->sameConnection(Lokhttp3/Response;Lokhttp3/HttpUrl;)Z
- move-result p1
- if-nez p1, :cond_12
- const-string p1, "Authorization"
- invoke-virtual {v2, p1}, Lokhttp3/Request$Builder;->removeHeader(Ljava/lang/String;)Lokhttp3/Request$Builder;
- :cond_12
- invoke-virtual {v2, v0}, Lokhttp3/Request$Builder;->url(Lokhttp3/HttpUrl;)Lokhttp3/Request$Builder;
- move-result-object p1
- invoke-virtual {p1}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request;
- move-result-object p1
- return-object p1
- :cond_13
- new-instance p1, Ljava/lang/IllegalStateException;
- invoke-direct {p1}, Ljava/lang/IllegalStateException;-><init>()V
- throw p1
- nop
- :pswitch_data_0
- .packed-switch 0x12c
- :pswitch_0
- :pswitch_0
- :pswitch_0
- :pswitch_0
- .end packed-switch
- .end method
- .method private isRecoverable(Ljava/io/IOException;Z)Z
- .locals 3
- instance-of v0, p1, Ljava/net/ProtocolException;
- const/4 v1, 0x0
- if-eqz v0, :cond_0
- return v1
- :cond_0
- instance-of v0, p1, Ljava/io/InterruptedIOException;
- const/4 v2, 0x1
- if-eqz v0, :cond_2
- instance-of p1, p1, Ljava/net/SocketTimeoutException;
- if-eqz p1, :cond_1
- if-nez p2, :cond_1
- const/4 v1, 0x1
- :cond_1
- return v1
- :cond_2
- instance-of p2, p1, Ljavax/net/ssl/SSLHandshakeException;
- if-eqz p2, :cond_3
- invoke-virtual {p1}, Ljava/io/IOException;->getCause()Ljava/lang/Throwable;
- move-result-object p2
- instance-of p2, p2, Ljava/security/cert/CertificateException;
- if-eqz p2, :cond_3
- return v1
- :cond_3
- instance-of p1, p1, Ljavax/net/ssl/SSLPeerUnverifiedException;
- if-eqz p1, :cond_4
- return v1
- :cond_4
- return v2
- .end method
- .method private recover(Ljava/io/IOException;ZLokhttp3/Request;)Z
- .locals 2
- iget-object v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {v0, p1}, Lokhttp3/internal/connection/StreamAllocation;->streamFailed(Ljava/io/IOException;)V
- iget-object v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v0}, Lokhttp3/OkHttpClient;->retryOnConnectionFailure()Z
- move-result v0
- const/4 v1, 0x0
- if-nez v0, :cond_0
- return v1
- :cond_0
- if-eqz p2, :cond_1
- invoke-virtual {p3}, Lokhttp3/Request;->body()Lokhttp3/RequestBody;
- move-result-object p3
- instance-of p3, p3, Lokhttp3/internal/http/UnrepeatableRequestBody;
- if-eqz p3, :cond_1
- return v1
- :cond_1
- invoke-direct {p0, p1, p2}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->isRecoverable(Ljava/io/IOException;Z)Z
- move-result p1
- if-nez p1, :cond_2
- return v1
- :cond_2
- iget-object p1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {p1}, Lokhttp3/internal/connection/StreamAllocation;->hasMoreRoutes()Z
- move-result p1
- if-nez p1, :cond_3
- return v1
- :cond_3
- const/4 p1, 0x1
- return p1
- .end method
- .method private sameConnection(Lokhttp3/Response;Lokhttp3/HttpUrl;)Z
- .locals 2
- invoke-virtual {p1}, Lokhttp3/Response;->request()Lokhttp3/Request;
- move-result-object p1
- invoke-virtual {p1}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
- move-result-object p1
- invoke-virtual {p1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {p2}, 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
- if-eqz v0, :cond_0
- invoke-virtual {p1}, Lokhttp3/HttpUrl;->port()I
- move-result v0
- invoke-virtual {p2}, Lokhttp3/HttpUrl;->port()I
- move-result v1
- if-ne v0, v1, :cond_0
- invoke-virtual {p1}, Lokhttp3/HttpUrl;->scheme()Ljava/lang/String;
- move-result-object p1
- invoke-virtual {p2}, Lokhttp3/HttpUrl;->scheme()Ljava/lang/String;
- move-result-object p2
- invoke-virtual {p1, p2}, Ljava/lang/String;->equals(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
- # virtual methods
- .method public cancel()V
- .locals 1
- const/4 v0, 0x1
- iput-boolean v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->canceled:Z
- iget-object v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- if-eqz v0, :cond_0
- invoke-virtual {v0}, Lokhttp3/internal/connection/StreamAllocation;->cancel()V
- :cond_0
- return-void
- .end method
- .method public intercept(Lokhttp3/Interceptor$Chain;)Lokhttp3/Response;
- .locals 14
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-interface {p1}, Lokhttp3/Interceptor$Chain;->request()Lokhttp3/Request;
- move-result-object v0
- check-cast p1, Lokhttp3/internal/http/RealInterceptorChain;
- invoke-virtual {p1}, Lokhttp3/internal/http/RealInterceptorChain;->call()Lokhttp3/Call;
- move-result-object v7
- invoke-virtual {p1}, Lokhttp3/internal/http/RealInterceptorChain;->eventListener()Lokhttp3/EventListener;
- move-result-object v8
- new-instance v9, Lokhttp3/internal/connection/StreamAllocation;
- iget-object v1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v1}, Lokhttp3/OkHttpClient;->connectionPool()Lokhttp3/ConnectionPool;
- move-result-object v2
- invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- invoke-direct {p0, v1}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->createAddress(Lokhttp3/HttpUrl;)Lokhttp3/Address;
- move-result-object v3
- iget-object v6, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->callStackTrace:Ljava/lang/Object;
- move-object v1, v9
- move-object v4, v7
- move-object v5, v8
- invoke-direct/range {v1 .. v6}, Lokhttp3/internal/connection/StreamAllocation;-><init>(Lokhttp3/ConnectionPool;Lokhttp3/Address;Lokhttp3/Call;Lokhttp3/EventListener;Ljava/lang/Object;)V
- iput-object v9, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- const/4 v9, 0x0
- const/4 v10, 0x0
- move-object v1, v10
- const/4 v2, 0x0
- :goto_0
- iget-boolean v3, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->canceled:Z
- if-nez v3, :cond_a
- :try_start_0
- iget-object v3, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {p1, v0, v3, v10, v10}, Lokhttp3/internal/http/RealInterceptorChain;->proceed(Lokhttp3/Request;Lokhttp3/internal/connection/StreamAllocation;Lokhttp3/internal/http/HttpCodec;Lokhttp3/internal/connection/RealConnection;)Lokhttp3/Response;
- move-result-object v0
- :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
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- if-eqz v1, :cond_0
- invoke-virtual {v0}, Lokhttp3/Response;->newBuilder()Lokhttp3/Response$Builder;
- move-result-object v0
- invoke-virtual {v1}, Lokhttp3/Response;->newBuilder()Lokhttp3/Response$Builder;
- move-result-object v1
- invoke-virtual {v1, v10}, Lokhttp3/Response$Builder;->body(Lokhttp3/ResponseBody;)Lokhttp3/Response$Builder;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Response$Builder;->build()Lokhttp3/Response;
- move-result-object v1
- invoke-virtual {v0, v1}, Lokhttp3/Response$Builder;->priorResponse(Lokhttp3/Response;)Lokhttp3/Response$Builder;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/Response$Builder;->build()Lokhttp3/Response;
- move-result-object v0
- :cond_0
- invoke-direct {p0, v0}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->followUpRequest(Lokhttp3/Response;)Lokhttp3/Request;
- move-result-object v11
- if-nez v11, :cond_2
- iget-boolean p1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->forWebSocket:Z
- if-nez p1, :cond_1
- iget-object p1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {p1}, Lokhttp3/internal/connection/StreamAllocation;->release()V
- :cond_1
- return-object v0
- :cond_2
- invoke-virtual {v0}, Lokhttp3/Response;->body()Lokhttp3/ResponseBody;
- move-result-object v1
- invoke-static {v1}, Lokhttp3/internal/Util;->closeQuietly(Ljava/io/Closeable;)V
- add-int/lit8 v12, v2, 0x1
- const/16 v1, 0x14
- if-gt v12, v1, :cond_6
- invoke-virtual {v11}, Lokhttp3/Request;->body()Lokhttp3/RequestBody;
- move-result-object v1
- instance-of v1, v1, Lokhttp3/internal/http/UnrepeatableRequestBody;
- if-nez v1, :cond_5
- invoke-virtual {v11}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- invoke-direct {p0, v0, v1}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->sameConnection(Lokhttp3/Response;Lokhttp3/HttpUrl;)Z
- move-result v1
- if-nez v1, :cond_3
- iget-object v1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {v1}, Lokhttp3/internal/connection/StreamAllocation;->release()V
- new-instance v13, Lokhttp3/internal/connection/StreamAllocation;
- iget-object v1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->client:Lokhttp3/OkHttpClient;
- invoke-virtual {v1}, Lokhttp3/OkHttpClient;->connectionPool()Lokhttp3/ConnectionPool;
- move-result-object v2
- invoke-virtual {v11}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- invoke-direct {p0, v1}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->createAddress(Lokhttp3/HttpUrl;)Lokhttp3/Address;
- move-result-object v3
- iget-object v6, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->callStackTrace:Ljava/lang/Object;
- move-object v1, v13
- move-object v4, v7
- move-object v5, v8
- invoke-direct/range {v1 .. v6}, Lokhttp3/internal/connection/StreamAllocation;-><init>(Lokhttp3/ConnectionPool;Lokhttp3/Address;Lokhttp3/Call;Lokhttp3/EventListener;Ljava/lang/Object;)V
- iput-object v13, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- goto :goto_1
- :cond_3
- iget-object v1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {v1}, Lokhttp3/internal/connection/StreamAllocation;->codec()Lokhttp3/internal/http/HttpCodec;
- move-result-object v1
- if-nez v1, :cond_4
- :goto_1
- move-object v1, v0
- move-object v0, v11
- move v2, v12
- goto :goto_0
- :cond_4
- new-instance p1, Ljava/lang/IllegalStateException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- const-string v2, "Closing the body of "
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v0, " didn\'t close its backing stream. Bad interceptor?"
- invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v0
- invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- throw p1
- :cond_5
- iget-object p1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {p1}, Lokhttp3/internal/connection/StreamAllocation;->release()V
- new-instance p1, Ljava/net/HttpRetryException;
- invoke-virtual {v0}, Lokhttp3/Response;->code()I
- move-result v0
- const-string v1, "Cannot retry streamed HTTP body"
- invoke-direct {p1, v1, v0}, Ljava/net/HttpRetryException;-><init>(Ljava/lang/String;I)V
- throw p1
- :cond_6
- iget-object p1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {p1}, Lokhttp3/internal/connection/StreamAllocation;->release()V
- new-instance p1, Ljava/net/ProtocolException;
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- const-string v1, "Too many follow-up requests: "
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0, v12}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v0
- invoke-direct {p1, v0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
- throw p1
- :catchall_0
- move-exception p1
- goto :goto_3
- :catch_0
- move-exception v3
- :try_start_1
- instance-of v4, v3, Lokhttp3/internal/http2/ConnectionShutdownException;
- if-nez v4, :cond_7
- const/4 v4, 0x1
- goto :goto_2
- :cond_7
- const/4 v4, 0x0
- :goto_2
- invoke-direct {p0, v3, v4, v0}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->recover(Ljava/io/IOException;ZLokhttp3/Request;)Z
- move-result v4
- if-eqz v4, :cond_8
- goto/16 :goto_0
- :cond_8
- throw v3
- :catch_1
- move-exception v3
- invoke-virtual {v3}, Lokhttp3/internal/connection/RouteException;->getLastConnectException()Ljava/io/IOException;
- move-result-object v4
- invoke-direct {p0, v4, v9, v0}, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->recover(Ljava/io/IOException;ZLokhttp3/Request;)Z
- move-result v4
- if-eqz v4, :cond_9
- goto/16 :goto_0
- :cond_9
- invoke-virtual {v3}, Lokhttp3/internal/connection/RouteException;->getLastConnectException()Ljava/io/IOException;
- move-result-object p1
- throw p1
- :try_end_1
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- :goto_3
- iget-object v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {v0, v10}, Lokhttp3/internal/connection/StreamAllocation;->streamFailed(Ljava/io/IOException;)V
- iget-object v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {v0}, Lokhttp3/internal/connection/StreamAllocation;->release()V
- throw p1
- :cond_a
- iget-object p1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- invoke-virtual {p1}, Lokhttp3/internal/connection/StreamAllocation;->release()V
- new-instance p1, Ljava/io/IOException;
- const-string v0, "Canceled"
- invoke-direct {p1, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
- goto :goto_5
- :goto_4
- throw p1
- :goto_5
- goto :goto_4
- .end method
- .method public isCanceled()Z
- .locals 1
- iget-boolean v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->canceled:Z
- return v0
- .end method
- .method public setCallStackTrace(Ljava/lang/Object;)V
- .locals 0
- iput-object p1, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->callStackTrace:Ljava/lang/Object;
- return-void
- .end method
- .method public streamAllocation()Lokhttp3/internal/connection/StreamAllocation;
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/http/RetryAndFollowUpInterceptor;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
- return-object v0
- .end method
|