123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142 |
- .class public final Lokhttp3/internal/connection/RealConnection;
- .super Lokhttp3/internal/http2/Http2Connection$Listener;
- .source ""
- # interfaces
- .implements Lokhttp3/Connection;
- # static fields
- .field private static final MAX_TUNNEL_ATTEMPTS:I = 0x15
- .field private static final NPE_THROW_WITH_NULL:Ljava/lang/String; = "throw with null exception"
- # instance fields
- .field public allocationLimit:I
- .field public final allocations:Ljava/util/List;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/List<",
- "Ljava/lang/ref/Reference<",
- "Lokhttp3/internal/connection/StreamAllocation;",
- ">;>;"
- }
- .end annotation
- .end field
- .field private final connectionPool:Lokhttp3/ConnectionPool;
- .field private handshake:Lokhttp3/Handshake;
- .field private http2Connection:Lokhttp3/internal/http2/Http2Connection;
- .field public idleAtNanos:J
- .field public noNewStreams:Z
- .field private protocol:Lokhttp3/Protocol;
- .field private rawSocket:Ljava/net/Socket;
- .field private final route:Lokhttp3/Route;
- .field private sink:Lokio/BufferedSink;
- .field private socket:Ljava/net/Socket;
- .field private source:Lokio/BufferedSource;
- .field public successCount:I
- # direct methods
- .method public constructor <init>(Lokhttp3/ConnectionPool;Lokhttp3/Route;)V
- .locals 2
- invoke-direct {p0}, Lokhttp3/internal/http2/Http2Connection$Listener;-><init>()V
- const/4 v0, 0x1
- iput v0, p0, Lokhttp3/internal/connection/RealConnection;->allocationLimit:I
- new-instance v0, Ljava/util/ArrayList;
- invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
- iput-object v0, p0, Lokhttp3/internal/connection/RealConnection;->allocations:Ljava/util/List;
- const-wide v0, 0x7fffffffffffffffL
- iput-wide v0, p0, Lokhttp3/internal/connection/RealConnection;->idleAtNanos:J
- iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->connectionPool:Lokhttp3/ConnectionPool;
- iput-object p2, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- return-void
- .end method
- .method private connectSocket(IILokhttp3/Call;Lokhttp3/EventListener;)V
- .locals 4
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
- move-result-object v0
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type;
- move-result-object v2
- sget-object v3, Ljava/net/Proxy$Type;->DIRECT:Ljava/net/Proxy$Type;
- if-eq v2, v3, :cond_1
- invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type;
- move-result-object v2
- sget-object v3, Ljava/net/Proxy$Type;->HTTP:Ljava/net/Proxy$Type;
- if-ne v2, v3, :cond_0
- goto :goto_0
- :cond_0
- new-instance v1, Ljava/net/Socket;
- invoke-direct {v1, v0}, Ljava/net/Socket;-><init>(Ljava/net/Proxy;)V
- goto :goto_1
- :cond_1
- :goto_0
- invoke-virtual {v1}, Lokhttp3/Address;->socketFactory()Ljavax/net/SocketFactory;
- move-result-object v1
- invoke-virtual {v1}, Ljavax/net/SocketFactory;->createSocket()Ljava/net/Socket;
- move-result-object v1
- :goto_1
- iput-object v1, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress;
- move-result-object v1
- invoke-virtual {p4, p3, v1, v0}, Lokhttp3/EventListener;->connectStart(Lokhttp3/Call;Ljava/net/InetSocketAddress;Ljava/net/Proxy;)V
- iget-object p3, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- invoke-virtual {p3, p2}, Ljava/net/Socket;->setSoTimeout(I)V
- :try_start_0
- invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
- move-result-object p2
- iget-object p3, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- iget-object p4, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {p4}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress;
- move-result-object p4
- invoke-virtual {p2, p3, p4, p1}, Lokhttp3/internal/platform/Platform;->connectSocket(Ljava/net/Socket;Ljava/net/InetSocketAddress;I)V
- :try_end_0
- .catch Ljava/net/ConnectException; {:try_start_0 .. :try_end_0} :catch_1
- :try_start_1
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- invoke-static {p1}, Lokio/Okio;->source(Ljava/net/Socket;)Lokio/Source;
- move-result-object p1
- invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- invoke-static {p1}, Lokio/Okio;->sink(Ljava/net/Socket;)Lokio/Sink;
- move-result-object p1
- invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- :try_end_1
- .catch Ljava/lang/NullPointerException; {:try_start_1 .. :try_end_1} :catch_0
- goto :goto_2
- :catch_0
- move-exception p1
- invoke-virtual {p1}, Ljava/lang/NullPointerException;->getMessage()Ljava/lang/String;
- move-result-object p2
- const-string p3, "throw with null exception"
- invoke-virtual {p3, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result p2
- if-nez p2, :cond_2
- :goto_2
- return-void
- :cond_2
- new-instance p2, Ljava/io/IOException;
- invoke-direct {p2, p1}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V
- throw p2
- :catch_1
- move-exception p1
- new-instance p2, Ljava/net/ConnectException;
- new-instance p3, Ljava/lang/StringBuilder;
- invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
- const-string p4, "Failed to connect to "
- invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object p4, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {p4}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress;
- move-result-object p4
- invoke-virtual {p3, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p3
- invoke-direct {p2, p3}, Ljava/net/ConnectException;-><init>(Ljava/lang/String;)V
- invoke-virtual {p2, p1}, Ljava/net/ConnectException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
- throw p2
- .end method
- .method private connectTls(Lokhttp3/internal/connection/ConnectionSpecSelector;)V
- .locals 7
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/Address;->sslSocketFactory()Ljavax/net/ssl/SSLSocketFactory;
- move-result-object v1
- const/4 v2, 0x0
- :try_start_0
- iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v4
- invoke-virtual {v4}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v4
- invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v5
- invoke-virtual {v5}, Lokhttp3/HttpUrl;->port()I
- move-result v5
- const/4 v6, 0x1
- invoke-virtual {v1, v3, v4, v5, v6}, Ljavax/net/ssl/SSLSocketFactory;->createSocket(Ljava/net/Socket;Ljava/lang/String;IZ)Ljava/net/Socket;
- move-result-object v1
- check-cast v1, Ljavax/net/ssl/SSLSocket;
- :try_end_0
- .catch Ljava/lang/AssertionError; {:try_start_0 .. :try_end_0} :catch_1
- .catchall {:try_start_0 .. :try_end_0} :catchall_1
- :try_start_1
- invoke-virtual {p1, v1}, Lokhttp3/internal/connection/ConnectionSpecSelector;->configureSecureSocket(Ljavax/net/ssl/SSLSocket;)Lokhttp3/ConnectionSpec;
- move-result-object p1
- invoke-virtual {p1}, Lokhttp3/ConnectionSpec;->supportsTlsExtensions()Z
- move-result v3
- if-eqz v3, :cond_0
- invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
- move-result-object v3
- invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v4
- invoke-virtual {v4}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v4
- invoke-virtual {v0}, Lokhttp3/Address;->protocols()Ljava/util/List;
- move-result-object v5
- invoke-virtual {v3, v1, v4, v5}, Lokhttp3/internal/platform/Platform;->configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
- :cond_0
- invoke-virtual {v1}, Ljavax/net/ssl/SSLSocket;->startHandshake()V
- invoke-virtual {v1}, Ljavax/net/ssl/SSLSocket;->getSession()Ljavax/net/ssl/SSLSession;
- move-result-object v3
- invoke-static {v3}, Lokhttp3/Handshake;->get(Ljavax/net/ssl/SSLSession;)Lokhttp3/Handshake;
- move-result-object v3
- invoke-virtual {v0}, Lokhttp3/Address;->hostnameVerifier()Ljavax/net/ssl/HostnameVerifier;
- move-result-object v4
- invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v5
- invoke-virtual {v5}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v5
- invoke-virtual {v1}, Ljavax/net/ssl/SSLSocket;->getSession()Ljavax/net/ssl/SSLSession;
- move-result-object v6
- invoke-interface {v4, v5, v6}, Ljavax/net/ssl/HostnameVerifier;->verify(Ljava/lang/String;Ljavax/net/ssl/SSLSession;)Z
- move-result v4
- if-eqz v4, :cond_4
- invoke-virtual {v0}, Lokhttp3/Address;->certificatePinner()Lokhttp3/CertificatePinner;
- move-result-object v4
- invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {v3}, Lokhttp3/Handshake;->peerCertificates()Ljava/util/List;
- move-result-object v5
- invoke-virtual {v4, v0, v5}, Lokhttp3/CertificatePinner;->check(Ljava/lang/String;Ljava/util/List;)V
- invoke-virtual {p1}, Lokhttp3/ConnectionSpec;->supportsTlsExtensions()Z
- move-result p1
- if-eqz p1, :cond_1
- invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
- move-result-object p1
- invoke-virtual {p1, v1}, Lokhttp3/internal/platform/Platform;->getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
- move-result-object v2
- :cond_1
- iput-object v1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-static {p1}, Lokio/Okio;->source(Ljava/net/Socket;)Lokio/Source;
- move-result-object p1
- invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-static {p1}, Lokio/Okio;->sink(Ljava/net/Socket;)Lokio/Sink;
- move-result-object p1
- invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- iput-object v3, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake;
- if-eqz v2, :cond_2
- invoke-static {v2}, Lokhttp3/Protocol;->get(Ljava/lang/String;)Lokhttp3/Protocol;
- move-result-object p1
- goto :goto_0
- :cond_2
- sget-object p1, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
- :goto_0
- iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol;
- :try_end_1
- .catch Ljava/lang/AssertionError; {:try_start_1 .. :try_end_1} :catch_0
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- if-eqz v1, :cond_3
- invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
- move-result-object p1
- invoke-virtual {p1, v1}, Lokhttp3/internal/platform/Platform;->afterHandshake(Ljavax/net/ssl/SSLSocket;)V
- :cond_3
- return-void
- :cond_4
- :try_start_2
- invoke-virtual {v3}, Lokhttp3/Handshake;->peerCertificates()Ljava/util/List;
- move-result-object p1
- const/4 v2, 0x0
- invoke-interface {p1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object p1
- check-cast p1, Ljava/security/cert/X509Certificate;
- new-instance v2, Ljavax/net/ssl/SSLPeerUnverifiedException;
- new-instance v3, Ljava/lang/StringBuilder;
- invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
- const-string v4, "Hostname "
- invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string v0, " not verified:\n certificate: "
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-static {p1}, Lokhttp3/CertificatePinner;->pin(Ljava/security/cert/Certificate;)Ljava/lang/String;
- move-result-object v0
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string v0, "\n DN: "
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {p1}, Ljava/security/cert/X509Certificate;->getSubjectDN()Ljava/security/Principal;
- move-result-object v0
- invoke-interface {v0}, Ljava/security/Principal;->getName()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string v0, "\n subjectAltNames: "
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-static {p1}, Lokhttp3/internal/tls/OkHostnameVerifier;->allSubjectAltNames(Ljava/security/cert/X509Certificate;)Ljava/util/List;
- move-result-object p1
- invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {v2, p1}, Ljavax/net/ssl/SSLPeerUnverifiedException;-><init>(Ljava/lang/String;)V
- throw v2
- :try_end_2
- .catch Ljava/lang/AssertionError; {:try_start_2 .. :try_end_2} :catch_0
- .catchall {:try_start_2 .. :try_end_2} :catchall_0
- :catchall_0
- move-exception p1
- goto :goto_2
- :catch_0
- move-exception p1
- move-object v2, v1
- goto :goto_1
- :catchall_1
- move-exception p1
- move-object v1, v2
- goto :goto_2
- :catch_1
- move-exception p1
- :goto_1
- :try_start_3
- invoke-static {p1}, Lokhttp3/internal/Util;->isAndroidGetsocknameError(Ljava/lang/AssertionError;)Z
- move-result v0
- if-eqz v0, :cond_5
- new-instance v0, Ljava/io/IOException;
- invoke-direct {v0, p1}, Ljava/io/IOException;-><init>(Ljava/lang/Throwable;)V
- throw v0
- :cond_5
- throw p1
- :try_end_3
- .catchall {:try_start_3 .. :try_end_3} :catchall_1
- :goto_2
- if-eqz v1, :cond_6
- invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
- move-result-object v0
- invoke-virtual {v0, v1}, Lokhttp3/internal/platform/Platform;->afterHandshake(Ljavax/net/ssl/SSLSocket;)V
- :cond_6
- invoke-static {v1}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V
- throw p1
- .end method
- .method private connectTunnel(IIILokhttp3/Call;Lokhttp3/EventListener;)V
- .locals 6
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-direct {p0}, Lokhttp3/internal/connection/RealConnection;->createTunnelRequest()Lokhttp3/Request;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- const/4 v2, 0x0
- :goto_0
- const/16 v3, 0x15
- if-ge v2, v3, :cond_1
- invoke-direct {p0, p1, p2, p4, p5}, Lokhttp3/internal/connection/RealConnection;->connectSocket(IILokhttp3/Call;Lokhttp3/EventListener;)V
- invoke-direct {p0, p2, p3, v0, v1}, Lokhttp3/internal/connection/RealConnection;->createTunnel(IILokhttp3/Request;Lokhttp3/HttpUrl;)Lokhttp3/Request;
- move-result-object v0
- if-nez v0, :cond_0
- goto :goto_1
- :cond_0
- iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- invoke-static {v3}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V
- const/4 v3, 0x0
- iput-object v3, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- iput-object v3, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- iput-object v3, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- iget-object v4, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v4}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress;
- move-result-object v4
- iget-object v5, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v5}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
- move-result-object v5
- invoke-virtual {p5, p4, v4, v5, v3}, Lokhttp3/EventListener;->connectEnd(Lokhttp3/Call;Ljava/net/InetSocketAddress;Ljava/net/Proxy;Lokhttp3/Protocol;)V
- add-int/lit8 v2, v2, 0x1
- goto :goto_0
- :cond_1
- :goto_1
- return-void
- .end method
- .method private createTunnel(IILokhttp3/Request;Lokhttp3/HttpUrl;)Lokhttp3/Request;
- .locals 7
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- const-string v1, "CONNECT "
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const/4 v1, 0x1
- invoke-static {p4, v1}, Lokhttp3/internal/Util;->hostHeader(Lokhttp3/HttpUrl;Z)Ljava/lang/String;
- move-result-object p4
- invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string p4, " HTTP/1.1"
- invoke-virtual {v0, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p4
- :goto_0
- new-instance v0, Lokhttp3/internal/http1/Http1Codec;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- iget-object v2, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- const/4 v3, 0x0
- invoke-direct {v0, v3, v3, v1, v2}, Lokhttp3/internal/http1/Http1Codec;-><init>(Lokhttp3/OkHttpClient;Lokhttp3/internal/connection/StreamAllocation;Lokio/BufferedSource;Lokio/BufferedSink;)V
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- invoke-interface {v1}, Lokio/Source;->timeout()Lokio/Timeout;
- move-result-object v1
- int-to-long v4, p1
- sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
- invoke-virtual {v1, v4, v5, v2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- invoke-interface {v1}, Lokio/Sink;->timeout()Lokio/Timeout;
- move-result-object v1
- int-to-long v4, p2
- sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
- invoke-virtual {v1, v4, v5, v2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
- invoke-virtual {p3}, Lokhttp3/Request;->headers()Lokhttp3/Headers;
- move-result-object v1
- invoke-virtual {v0, v1, p4}, Lokhttp3/internal/http1/Http1Codec;->writeRequest(Lokhttp3/Headers;Ljava/lang/String;)V
- invoke-virtual {v0}, Lokhttp3/internal/http1/Http1Codec;->finishRequest()V
- const/4 v1, 0x0
- invoke-virtual {v0, v1}, Lokhttp3/internal/http1/Http1Codec;->readResponseHeaders(Z)Lokhttp3/Response$Builder;
- move-result-object v1
- invoke-virtual {v1, p3}, Lokhttp3/Response$Builder;->request(Lokhttp3/Request;)Lokhttp3/Response$Builder;
- move-result-object p3
- invoke-virtual {p3}, Lokhttp3/Response$Builder;->build()Lokhttp3/Response;
- move-result-object p3
- invoke-static {p3}, Lokhttp3/internal/http/HttpHeaders;->contentLength(Lokhttp3/Response;)J
- move-result-wide v1
- const-wide/16 v4, -0x1
- cmp-long v6, v1, v4
- if-nez v6, :cond_0
- const-wide/16 v1, 0x0
- :cond_0
- invoke-virtual {v0, v1, v2}, Lokhttp3/internal/http1/Http1Codec;->newFixedLengthSource(J)Lokio/Source;
- move-result-object v0
- const v1, 0x7fffffff
- sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
- invoke-static {v0, v1, v2}, Lokhttp3/internal/Util;->skipAll(Lokio/Source;ILjava/util/concurrent/TimeUnit;)Z
- invoke-interface {v0}, Lokio/Source;->close()V
- invoke-virtual {p3}, Lokhttp3/Response;->code()I
- move-result v0
- const/16 v1, 0xc8
- if-eq v0, v1, :cond_4
- const/16 v1, 0x197
- if-ne v0, v1, :cond_3
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/Address;->proxyAuthenticator()Lokhttp3/Authenticator;
- move-result-object v0
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-interface {v0, v1, p3}, Lokhttp3/Authenticator;->authenticate(Lokhttp3/Route;Lokhttp3/Response;)Lokhttp3/Request;
- move-result-object v0
- if-eqz v0, :cond_2
- const-string v1, "Connection"
- invoke-virtual {p3, v1}, Lokhttp3/Response;->header(Ljava/lang/String;)Ljava/lang/String;
- move-result-object p3
- const-string v1, "close"
- invoke-virtual {v1, p3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
- move-result p3
- if-eqz p3, :cond_1
- return-object v0
- :cond_1
- move-object p3, v0
- goto/16 :goto_0
- :cond_2
- new-instance p1, Ljava/io/IOException;
- const-string p2, "Failed to authenticate with proxy"
- invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
- throw p1
- :cond_3
- new-instance p1, Ljava/io/IOException;
- new-instance p2, Ljava/lang/StringBuilder;
- invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
- const-string p4, "Unexpected response code for CONNECT: "
- invoke-virtual {p2, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {p3}, Lokhttp3/Response;->code()I
- move-result p3
- invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
- invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p2
- invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
- throw p1
- :cond_4
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- invoke-interface {p1}, Lokio/BufferedSource;->buffer()Lokio/Buffer;
- move-result-object p1
- invoke-virtual {p1}, Lokio/Buffer;->exhausted()Z
- move-result p1
- if-eqz p1, :cond_5
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- invoke-interface {p1}, Lokio/BufferedSink;->buffer()Lokio/Buffer;
- move-result-object p1
- invoke-virtual {p1}, Lokio/Buffer;->exhausted()Z
- move-result p1
- if-eqz p1, :cond_5
- return-object v3
- :cond_5
- new-instance p1, Ljava/io/IOException;
- const-string p2, "TLS tunnel buffered too many bytes!"
- invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
- goto :goto_2
- :goto_1
- throw p1
- :goto_2
- goto :goto_1
- .end method
- .method private createTunnelRequest()Lokhttp3/Request;
- .locals 3
- new-instance v0, Lokhttp3/Request$Builder;
- invoke-direct {v0}, Lokhttp3/Request$Builder;-><init>()V
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- invoke-virtual {v0, v1}, Lokhttp3/Request$Builder;->url(Lokhttp3/HttpUrl;)Lokhttp3/Request$Builder;
- move-result-object v0
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- const/4 v2, 0x1
- invoke-static {v1, v2}, Lokhttp3/internal/Util;->hostHeader(Lokhttp3/HttpUrl;Z)Ljava/lang/String;
- move-result-object v1
- const-string v2, "Host"
- invoke-virtual {v0, v2, v1}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;
- move-result-object v0
- const-string v1, "Proxy-Connection"
- const-string v2, "Keep-Alive"
- invoke-virtual {v0, v1, v2}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;
- move-result-object v0
- invoke-static {}, Lokhttp3/internal/Version;->userAgent()Ljava/lang/String;
- move-result-object v1
- const-string v2, "User-Agent"
- invoke-virtual {v0, v2, v1}, Lokhttp3/Request$Builder;->header(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request;
- move-result-object v0
- return-object v0
- .end method
- .method private establishProtocol(Lokhttp3/internal/connection/ConnectionSpecSelector;Lokhttp3/Call;Lokhttp3/EventListener;)V
- .locals 2
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/Address;->sslSocketFactory()Ljavax/net/ssl/SSLSocketFactory;
- move-result-object v0
- if-nez v0, :cond_0
- sget-object p1, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
- iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol;
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- return-void
- :cond_0
- invoke-virtual {p3, p2}, Lokhttp3/EventListener;->secureConnectStart(Lokhttp3/Call;)V
- invoke-direct {p0, p1}, Lokhttp3/internal/connection/RealConnection;->connectTls(Lokhttp3/internal/connection/ConnectionSpecSelector;)V
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake;
- invoke-virtual {p3, p2, p1}, Lokhttp3/EventListener;->secureConnectEnd(Lokhttp3/Call;Lokhttp3/Handshake;)V
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol;
- sget-object p2, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
- if-ne p1, p2, :cond_1
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- const/4 p2, 0x0
- invoke-virtual {p1, p2}, Ljava/net/Socket;->setSoTimeout(I)V
- new-instance p1, Lokhttp3/internal/http2/Http2Connection$Builder;
- const/4 p2, 0x1
- invoke-direct {p1, p2}, Lokhttp3/internal/http2/Http2Connection$Builder;-><init>(Z)V
- iget-object p2, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- iget-object p3, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {p3}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object p3
- invoke-virtual {p3}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object p3
- invoke-virtual {p3}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object p3
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- invoke-virtual {p1, p2, p3, v0, v1}, Lokhttp3/internal/http2/Http2Connection$Builder;->socket(Ljava/net/Socket;Ljava/lang/String;Lokio/BufferedSource;Lokio/BufferedSink;)Lokhttp3/internal/http2/Http2Connection$Builder;
- move-result-object p1
- invoke-virtual {p1, p0}, Lokhttp3/internal/http2/Http2Connection$Builder;->listener(Lokhttp3/internal/http2/Http2Connection$Listener;)Lokhttp3/internal/http2/Http2Connection$Builder;
- move-result-object p1
- invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Connection$Builder;->build()Lokhttp3/internal/http2/Http2Connection;
- move-result-object p1
- iput-object p1, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection;
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection;
- invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Connection;->start()V
- :cond_1
- return-void
- .end method
- .method public static testConnection(Lokhttp3/ConnectionPool;Lokhttp3/Route;Ljava/net/Socket;J)Lokhttp3/internal/connection/RealConnection;
- .locals 1
- new-instance v0, Lokhttp3/internal/connection/RealConnection;
- invoke-direct {v0, p0, p1}, Lokhttp3/internal/connection/RealConnection;-><init>(Lokhttp3/ConnectionPool;Lokhttp3/Route;)V
- iput-object p2, v0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- iput-wide p3, v0, Lokhttp3/internal/connection/RealConnection;->idleAtNanos:J
- return-object v0
- .end method
- # virtual methods
- .method public cancel()V
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- invoke-static {v0}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V
- return-void
- .end method
- .method public connect(IIIZLokhttp3/Call;Lokhttp3/EventListener;)V
- .locals 15
- move-object v7, p0
- move-object/from16 v8, p5
- move-object/from16 v9, p6
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol;
- if-nez v0, :cond_a
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/Address;->connectionSpecs()Ljava/util/List;
- move-result-object v0
- new-instance v10, Lokhttp3/internal/connection/ConnectionSpecSelector;
- invoke-direct {v10, v0}, Lokhttp3/internal/connection/ConnectionSpecSelector;-><init>(Ljava/util/List;)V
- iget-object v1, v7, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Address;->sslSocketFactory()Ljavax/net/ssl/SSLSocketFactory;
- move-result-object v1
- if-nez v1, :cond_2
- sget-object v1, Lokhttp3/ConnectionSpec;->CLEARTEXT:Lokhttp3/ConnectionSpec;
- invoke-interface {v0, v1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
- move-result v0
- if-eqz v0, :cond_1
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v0
- invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
- move-result-object v1
- invoke-virtual {v1, v0}, Lokhttp3/internal/platform/Platform;->isCleartextTrafficPermitted(Ljava/lang/String;)Z
- move-result v1
- if-eqz v1, :cond_0
- goto :goto_0
- :cond_0
- new-instance v1, Lokhttp3/internal/connection/RouteException;
- new-instance v2, Ljava/net/UnknownServiceException;
- new-instance v3, Ljava/lang/StringBuilder;
- invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
- const-string v4, "CLEARTEXT communication to "
- invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string v0, " not permitted by network security policy"
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v0
- invoke-direct {v2, v0}, Ljava/net/UnknownServiceException;-><init>(Ljava/lang/String;)V
- invoke-direct {v1, v2}, Lokhttp3/internal/connection/RouteException;-><init>(Ljava/io/IOException;)V
- throw v1
- :cond_1
- new-instance v0, Lokhttp3/internal/connection/RouteException;
- new-instance v1, Ljava/net/UnknownServiceException;
- const-string v2, "CLEARTEXT communication not enabled for client"
- invoke-direct {v1, v2}, Ljava/net/UnknownServiceException;-><init>(Ljava/lang/String;)V
- invoke-direct {v0, v1}, Lokhttp3/internal/connection/RouteException;-><init>(Ljava/io/IOException;)V
- throw v0
- :cond_2
- :goto_0
- const/4 v11, 0x0
- move-object v12, v11
- :goto_1
- :try_start_0
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->requiresTunnel()Z
- move-result v0
- if-eqz v0, :cond_4
- move-object v1, p0
- move/from16 v2, p1
- move/from16 v3, p2
- move/from16 v4, p3
- move-object/from16 v5, p5
- move-object/from16 v6, p6
- invoke-direct/range {v1 .. v6}, Lokhttp3/internal/connection/RealConnection;->connectTunnel(IIILokhttp3/Call;Lokhttp3/EventListener;)V
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- :try_end_0
- .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
- if-nez v0, :cond_3
- goto :goto_3
- :cond_3
- move/from16 v13, p1
- move/from16 v14, p2
- goto :goto_2
- :cond_4
- move/from16 v13, p1
- move/from16 v14, p2
- :try_start_1
- invoke-direct {p0, v13, v14, v8, v9}, Lokhttp3/internal/connection/RealConnection;->connectSocket(IILokhttp3/Call;Lokhttp3/EventListener;)V
- :goto_2
- invoke-direct {p0, v10, v8, v9}, Lokhttp3/internal/connection/RealConnection;->establishProtocol(Lokhttp3/internal/connection/ConnectionSpecSelector;Lokhttp3/Call;Lokhttp3/EventListener;)V
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress;
- move-result-object v0
- iget-object v1, v7, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
- move-result-object v1
- iget-object v2, v7, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol;
- invoke-virtual {v9, v8, v0, v1, v2}, Lokhttp3/EventListener;->connectEnd(Lokhttp3/Call;Ljava/net/InetSocketAddress;Ljava/net/Proxy;Lokhttp3/Protocol;)V
- :try_end_1
- .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
- :goto_3
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->requiresTunnel()Z
- move-result v0
- if-eqz v0, :cond_6
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- if-eqz v0, :cond_5
- goto :goto_4
- :cond_5
- new-instance v0, Ljava/net/ProtocolException;
- const-string v1, "Too many tunnel connections attempted: 21"
- invoke-direct {v0, v1}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
- new-instance v1, Lokhttp3/internal/connection/RouteException;
- invoke-direct {v1, v0}, Lokhttp3/internal/connection/RouteException;-><init>(Ljava/io/IOException;)V
- throw v1
- :cond_6
- :goto_4
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection;
- if-eqz v0, :cond_7
- iget-object v1, v7, Lokhttp3/internal/connection/RealConnection;->connectionPool:Lokhttp3/ConnectionPool;
- monitor-enter v1
- :try_start_2
- iget-object v0, v7, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection;
- invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Connection;->maxConcurrentStreams()I
- move-result v0
- iput v0, v7, Lokhttp3/internal/connection/RealConnection;->allocationLimit:I
- monitor-exit v1
- goto :goto_5
- :catchall_0
- move-exception v0
- monitor-exit v1
- :try_end_2
- .catchall {:try_start_2 .. :try_end_2} :catchall_0
- throw v0
- :cond_7
- :goto_5
- return-void
- :catch_0
- move-exception v0
- goto :goto_6
- :catch_1
- move-exception v0
- move/from16 v13, p1
- move/from16 v14, p2
- :goto_6
- iget-object v1, v7, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-static {v1}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V
- iget-object v1, v7, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- invoke-static {v1}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V
- iput-object v11, v7, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- iput-object v11, v7, Lokhttp3/internal/connection/RealConnection;->rawSocket:Ljava/net/Socket;
- iput-object v11, v7, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- iput-object v11, v7, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- iput-object v11, v7, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake;
- iput-object v11, v7, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol;
- iput-object v11, v7, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection;
- iget-object v1, v7, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress;
- move-result-object v3
- iget-object v1, v7, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
- move-result-object v4
- const/4 v5, 0x0
- move-object/from16 v1, p6
- move-object/from16 v2, p5
- move-object v6, v0
- invoke-virtual/range {v1 .. v6}, Lokhttp3/EventListener;->connectFailed(Lokhttp3/Call;Ljava/net/InetSocketAddress;Ljava/net/Proxy;Lokhttp3/Protocol;Ljava/io/IOException;)V
- if-nez v12, :cond_8
- new-instance v1, Lokhttp3/internal/connection/RouteException;
- invoke-direct {v1, v0}, Lokhttp3/internal/connection/RouteException;-><init>(Ljava/io/IOException;)V
- move-object v12, v1
- goto :goto_7
- :cond_8
- invoke-virtual {v12, v0}, Lokhttp3/internal/connection/RouteException;->addConnectException(Ljava/io/IOException;)V
- :goto_7
- if-eqz p4, :cond_9
- invoke-virtual {v10, v0}, Lokhttp3/internal/connection/ConnectionSpecSelector;->connectionFailed(Ljava/io/IOException;)Z
- move-result v0
- if-eqz v0, :cond_9
- goto/16 :goto_1
- :cond_9
- throw v12
- :cond_a
- new-instance v0, Ljava/lang/IllegalStateException;
- const-string v1, "already connected"
- invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- goto :goto_9
- :goto_8
- throw v0
- :goto_9
- goto :goto_8
- .end method
- .method public handshake()Lokhttp3/Handshake;
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake;
- return-object v0
- .end method
- .method public isEligible(Lokhttp3/Address;Lokhttp3/Route;)Z
- .locals 4
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->allocations:Ljava/util/List;
- invoke-interface {v0}, Ljava/util/List;->size()I
- move-result v0
- iget v1, p0, Lokhttp3/internal/connection/RealConnection;->allocationLimit:I
- const/4 v2, 0x0
- if-ge v0, v1, :cond_a
- iget-boolean v0, p0, Lokhttp3/internal/connection/RealConnection;->noNewStreams:Z
- if-eqz v0, :cond_0
- goto/16 :goto_0
- :cond_0
- sget-object v0, Lokhttp3/internal/Internal;->instance:Lokhttp3/internal/Internal;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v0, v1, p1}, Lokhttp3/internal/Internal;->equalsNonHost(Lokhttp3/Address;Lokhttp3/Address;)Z
- move-result v0
- if-nez v0, :cond_1
- return v2
- :cond_1
- invoke-virtual {p1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {p0}, Lokhttp3/internal/connection/RealConnection;->route()Lokhttp3/Route;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v1
- invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v0
- const/4 v1, 0x1
- if-eqz v0, :cond_2
- return v1
- :cond_2
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection;
- if-nez v0, :cond_3
- return v2
- :cond_3
- if-nez p2, :cond_4
- return v2
- :cond_4
- invoke-virtual {p2}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
- move-result-object v0
- invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type;
- move-result-object v0
- sget-object v3, Ljava/net/Proxy$Type;->DIRECT:Ljava/net/Proxy$Type;
- if-eq v0, v3, :cond_5
- return v2
- :cond_5
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
- move-result-object v0
- invoke-virtual {v0}, Ljava/net/Proxy;->type()Ljava/net/Proxy$Type;
- move-result-object v0
- sget-object v3, Ljava/net/Proxy$Type;->DIRECT:Ljava/net/Proxy$Type;
- if-eq v0, v3, :cond_6
- return v2
- :cond_6
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v0}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress;
- move-result-object v0
- invoke-virtual {p2}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress;
- move-result-object v3
- invoke-virtual {v0, v3}, Ljava/net/InetSocketAddress;->equals(Ljava/lang/Object;)Z
- move-result v0
- if-nez v0, :cond_7
- return v2
- :cond_7
- invoke-virtual {p2}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object p2
- invoke-virtual {p2}, Lokhttp3/Address;->hostnameVerifier()Ljavax/net/ssl/HostnameVerifier;
- move-result-object p2
- sget-object v0, Lokhttp3/internal/tls/OkHostnameVerifier;->INSTANCE:Lokhttp3/internal/tls/OkHostnameVerifier;
- if-eq p2, v0, :cond_8
- return v2
- :cond_8
- invoke-virtual {p1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object p2
- invoke-virtual {p0, p2}, Lokhttp3/internal/connection/RealConnection;->supportsUrl(Lokhttp3/HttpUrl;)Z
- move-result p2
- if-nez p2, :cond_9
- return v2
- :cond_9
- :try_start_0
- invoke-virtual {p1}, Lokhttp3/Address;->certificatePinner()Lokhttp3/CertificatePinner;
- move-result-object p2
- invoke-virtual {p1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object p1
- invoke-virtual {p1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object p1
- invoke-virtual {p0}, Lokhttp3/internal/connection/RealConnection;->handshake()Lokhttp3/Handshake;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/Handshake;->peerCertificates()Ljava/util/List;
- move-result-object v0
- invoke-virtual {p2, p1, v0}, Lokhttp3/CertificatePinner;->check(Ljava/lang/String;Ljava/util/List;)V
- :try_end_0
- .catch Ljavax/net/ssl/SSLPeerUnverifiedException; {:try_start_0 .. :try_end_0} :catch_0
- return v1
- :catch_0
- :cond_a
- :goto_0
- return v2
- .end method
- .method public isHealthy(Z)Z
- .locals 4
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-virtual {v0}, Ljava/net/Socket;->isClosed()Z
- move-result v0
- const/4 v1, 0x0
- if-nez v0, :cond_4
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-virtual {v0}, Ljava/net/Socket;->isInputShutdown()Z
- move-result v0
- if-nez v0, :cond_4
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-virtual {v0}, Ljava/net/Socket;->isOutputShutdown()Z
- move-result v0
- if-eqz v0, :cond_0
- goto :goto_0
- :cond_0
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection;
- const/4 v2, 0x1
- if-eqz v0, :cond_1
- invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Connection;->isShutdown()Z
- move-result p1
- xor-int/2addr p1, v2
- return p1
- :cond_1
- if-eqz p1, :cond_3
- :try_start_0
- iget-object p1, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-virtual {p1}, Ljava/net/Socket;->getSoTimeout()I
- move-result p1
- :try_end_0
- .catch Ljava/net/SocketTimeoutException; {:try_start_0 .. :try_end_0} :catch_1
- .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
- :try_start_1
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-virtual {v0, v2}, Ljava/net/Socket;->setSoTimeout(I)V
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- invoke-interface {v0}, Lokio/BufferedSource;->exhausted()Z
- move-result v0
- :try_end_1
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- if-eqz v0, :cond_2
- :try_start_2
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-virtual {v0, p1}, Ljava/net/Socket;->setSoTimeout(I)V
- return v1
- :cond_2
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-virtual {v0, p1}, Ljava/net/Socket;->setSoTimeout(I)V
- return v2
- :catchall_0
- move-exception v0
- iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-virtual {v3, p1}, Ljava/net/Socket;->setSoTimeout(I)V
- throw v0
- :try_end_2
- .catch Ljava/net/SocketTimeoutException; {:try_start_2 .. :try_end_2} :catch_1
- .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
- :catch_0
- return v1
- :catch_1
- :cond_3
- return v2
- :cond_4
- :goto_0
- return v1
- .end method
- .method public isMultiplexed()Z
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection;
- if-eqz v0, :cond_0
- const/4 v0, 0x1
- goto :goto_0
- :cond_0
- const/4 v0, 0x0
- :goto_0
- return v0
- .end method
- .method public newCodec(Lokhttp3/OkHttpClient;Lokhttp3/Interceptor$Chain;Lokhttp3/internal/connection/StreamAllocation;)Lokhttp3/internal/http/HttpCodec;
- .locals 4
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/net/SocketException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->http2Connection:Lokhttp3/internal/http2/Http2Connection;
- if-eqz v0, :cond_0
- new-instance v1, Lokhttp3/internal/http2/Http2Codec;
- invoke-direct {v1, p1, p2, p3, v0}, Lokhttp3/internal/http2/Http2Codec;-><init>(Lokhttp3/OkHttpClient;Lokhttp3/Interceptor$Chain;Lokhttp3/internal/connection/StreamAllocation;Lokhttp3/internal/http2/Http2Connection;)V
- return-object v1
- :cond_0
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- invoke-interface {p2}, Lokhttp3/Interceptor$Chain;->readTimeoutMillis()I
- move-result v1
- invoke-virtual {v0, v1}, Ljava/net/Socket;->setSoTimeout(I)V
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- invoke-interface {v0}, Lokio/Source;->timeout()Lokio/Timeout;
- move-result-object v0
- invoke-interface {p2}, Lokhttp3/Interceptor$Chain;->readTimeoutMillis()I
- move-result v1
- int-to-long v1, v1
- sget-object v3, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
- invoke-virtual {v0, v1, v2, v3}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- invoke-interface {v0}, Lokio/Sink;->timeout()Lokio/Timeout;
- move-result-object v0
- invoke-interface {p2}, Lokhttp3/Interceptor$Chain;->writeTimeoutMillis()I
- move-result p2
- int-to-long v1, p2
- sget-object p2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
- invoke-virtual {v0, v1, v2, p2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
- new-instance p2, Lokhttp3/internal/http1/Http1Codec;
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- invoke-direct {p2, p1, p3, v0, v1}, Lokhttp3/internal/http1/Http1Codec;-><init>(Lokhttp3/OkHttpClient;Lokhttp3/internal/connection/StreamAllocation;Lokio/BufferedSource;Lokio/BufferedSink;)V
- return-object p2
- .end method
- .method public newWebSocketStreams(Lokhttp3/internal/connection/StreamAllocation;)Lokhttp3/internal/ws/RealWebSocket$Streams;
- .locals 7
- new-instance v6, Lokhttp3/internal/connection/RealConnection$1;
- iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->source:Lokio/BufferedSource;
- iget-object v4, p0, Lokhttp3/internal/connection/RealConnection;->sink:Lokio/BufferedSink;
- const/4 v2, 0x1
- move-object v0, v6
- move-object v1, p0
- move-object v5, p1
- invoke-direct/range {v0 .. v5}, Lokhttp3/internal/connection/RealConnection$1;-><init>(Lokhttp3/internal/connection/RealConnection;ZLokio/BufferedSource;Lokio/BufferedSink;Lokhttp3/internal/connection/StreamAllocation;)V
- return-object v6
- .end method
- .method public onSettings(Lokhttp3/internal/http2/Http2Connection;)V
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->connectionPool:Lokhttp3/ConnectionPool;
- monitor-enter v0
- :try_start_0
- invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Connection;->maxConcurrentStreams()I
- move-result p1
- iput p1, p0, Lokhttp3/internal/connection/RealConnection;->allocationLimit:I
- monitor-exit v0
- return-void
- :catchall_0
- move-exception p1
- monitor-exit v0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- throw p1
- .end method
- .method public onStream(Lokhttp3/internal/http2/Http2Stream;)V
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- sget-object v0, Lokhttp3/internal/http2/ErrorCode;->REFUSED_STREAM:Lokhttp3/internal/http2/ErrorCode;
- invoke-virtual {p1, v0}, Lokhttp3/internal/http2/Http2Stream;->close(Lokhttp3/internal/http2/ErrorCode;)V
- return-void
- .end method
- .method public protocol()Lokhttp3/Protocol;
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol;
- return-object v0
- .end method
- .method public route()Lokhttp3/Route;
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- return-object v0
- .end method
- .method public socket()Ljava/net/Socket;
- .locals 1
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->socket:Ljava/net/Socket;
- return-object v0
- .end method
- .method public supportsUrl(Lokhttp3/HttpUrl;)Z
- .locals 4
- invoke-virtual {p1}, Lokhttp3/HttpUrl;->port()I
- move-result v0
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/HttpUrl;->port()I
- move-result v1
- const/4 v2, 0x0
- if-eq v0, v1, :cond_0
- return v2
- :cond_0
- invoke-virtual {p1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v0
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v1
- invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v0
- const/4 v1, 0x1
- if-nez v0, :cond_2
- iget-object v0, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake;
- if-eqz v0, :cond_1
- sget-object v0, Lokhttp3/internal/tls/OkHostnameVerifier;->INSTANCE:Lokhttp3/internal/tls/OkHostnameVerifier;
- invoke-virtual {p1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object p1
- iget-object v3, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake;
- invoke-virtual {v3}, Lokhttp3/Handshake;->peerCertificates()Ljava/util/List;
- move-result-object v3
- invoke-interface {v3, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
- move-result-object v3
- check-cast v3, Ljava/security/cert/X509Certificate;
- invoke-virtual {v0, p1, v3}, Lokhttp3/internal/tls/OkHostnameVerifier;->verify(Ljava/lang/String;Ljava/security/cert/X509Certificate;)Z
- move-result p1
- if-eqz p1, :cond_1
- goto :goto_0
- :cond_1
- const/4 v1, 0x0
- :cond_2
- :goto_0
- return v1
- .end method
- .method public toString()Ljava/lang/String;
- .locals 2
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- const-string v1, "Connection{"
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/HttpUrl;->host()Ljava/lang/String;
- move-result-object v1
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string v1, ":"
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->address()Lokhttp3/Address;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/Address;->url()Lokhttp3/HttpUrl;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/HttpUrl;->port()I
- move-result v1
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
- const-string v1, ", proxy="
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->proxy()Ljava/net/Proxy;
- move-result-object v1
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v1, " hostAddress="
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->route:Lokhttp3/Route;
- invoke-virtual {v1}, Lokhttp3/Route;->socketAddress()Ljava/net/InetSocketAddress;
- move-result-object v1
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v1, " cipherSuite="
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->handshake:Lokhttp3/Handshake;
- if-eqz v1, :cond_0
- invoke-virtual {v1}, Lokhttp3/Handshake;->cipherSuite()Lokhttp3/CipherSuite;
- move-result-object v1
- goto :goto_0
- :cond_0
- const-string v1, "none"
- :goto_0
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v1, " protocol="
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v1, p0, Lokhttp3/internal/connection/RealConnection;->protocol:Lokhttp3/Protocol;
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const/16 v1, 0x7d
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v0
- return-object v0
- .end method
|