123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788 |
- .class Lokhttp3/mockwebserver/MockWebServer$3;
- .super Lokhttp3/internal/NamedRunnable;
- .source ""
- # annotations
- .annotation system Ldalvik/annotation/EnclosingMethod;
- value = Lokhttp3/mockwebserver/MockWebServer;->serveConnection(Ljava/net/Socket;)V
- .end annotation
- .annotation system Ldalvik/annotation/InnerClass;
- accessFlags = 0x0
- name = null
- .end annotation
- # instance fields
- .field sequenceNumber:I
- .field final synthetic this$0:Lokhttp3/mockwebserver/MockWebServer;
- .field final synthetic val$raw:Ljava/net/Socket;
- # direct methods
- .method varargs constructor <init>(Lokhttp3/mockwebserver/MockWebServer;Ljava/lang/String;[Ljava/lang/Object;Ljava/net/Socket;)V
- .locals 0
- iput-object p1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- iput-object p4, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-direct {p0, p2, p3}, Lokhttp3/internal/NamedRunnable;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V
- const/4 p1, 0x0
- iput p1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
- return-void
- .end method
- .method private createTunnel()V
- .locals 4
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;,
- Ljava/lang/InterruptedException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-static {v0}, Lokio/Okio;->source(Ljava/net/Socket;)Lokio/Source;
- move-result-object v0
- invoke-static {v0}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
- move-result-object v0
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-static {v1}, Lokio/Okio;->sink(Ljava/net/Socket;)Lokio/Sink;
- move-result-object v1
- invoke-static {v1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink;
- move-result-object v1
- :cond_0
- iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$400(Lokhttp3/mockwebserver/MockWebServer;)Lokhttp3/mockwebserver/Dispatcher;
- move-result-object v2
- invoke-virtual {v2}, Lokhttp3/mockwebserver/Dispatcher;->peek()Lokhttp3/mockwebserver/MockResponse;
- move-result-object v2
- invoke-virtual {v2}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
- move-result-object v2
- iget-object v3, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-direct {p0, v3, v0, v1}, Lokhttp3/mockwebserver/MockWebServer$3;->processOneRequest(Ljava/net/Socket;Lokio/BufferedSource;Lokio/BufferedSink;)Z
- move-result v3
- if-eqz v3, :cond_1
- sget-object v3, Lokhttp3/mockwebserver/SocketPolicy;->UPGRADE_TO_SSL_AT_END:Lokhttp3/mockwebserver/SocketPolicy;
- if-ne v2, v3, :cond_0
- return-void
- :cond_1
- new-instance v0, Ljava/lang/IllegalStateException;
- const-string v1, "Tunnel without any CONNECT!"
- invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
- goto :goto_1
- :goto_0
- throw v0
- :goto_1
- goto :goto_0
- .end method
- .method private processOneRequest(Ljava/net/Socket;Lokio/BufferedSource;Lokio/BufferedSink;)Z
- .locals 10
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;,
- Ljava/lang/InterruptedException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- iget v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
- invoke-static {v0, p1, p2, p3, v1}, Lokhttp3/mockwebserver/MockWebServer;->access$1400(Lokhttp3/mockwebserver/MockWebServer;Ljava/net/Socket;Lokio/BufferedSource;Lokio/BufferedSink;I)Lokhttp3/mockwebserver/RecordedRequest;
- move-result-object v0
- const/4 v1, 0x0
- if-nez v0, :cond_0
- return v1
- :cond_0
- iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$1500(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/concurrent/atomic/AtomicInteger;
- move-result-object v2
- invoke-virtual {v2}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I
- iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$1600(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/concurrent/BlockingQueue;
- move-result-object v2
- invoke-interface {v2, v0}, Ljava/util/concurrent/BlockingQueue;->add(Ljava/lang/Object;)Z
- iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$400(Lokhttp3/mockwebserver/MockWebServer;)Lokhttp3/mockwebserver/Dispatcher;
- move-result-object v2
- invoke-virtual {v2, v0}, Lokhttp3/mockwebserver/Dispatcher;->dispatch(Lokhttp3/mockwebserver/RecordedRequest;)Lokhttp3/mockwebserver/MockResponse;
- move-result-object v8
- invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
- move-result-object v2
- sget-object v3, Lokhttp3/mockwebserver/SocketPolicy;->DISCONNECT_AFTER_REQUEST:Lokhttp3/mockwebserver/SocketPolicy;
- if-ne v2, v3, :cond_1
- invoke-virtual {p1}, Ljava/net/Socket;->close()V
- return v1
- :cond_1
- invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
- move-result-object v2
- sget-object v3, Lokhttp3/mockwebserver/SocketPolicy;->NO_RESPONSE:Lokhttp3/mockwebserver/SocketPolicy;
- if-ne v2, v3, :cond_3
- invoke-interface {p2}, Lokio/BufferedSource;->exhausted()Z
- move-result p1
- if-eqz p1, :cond_2
- return v1
- :cond_2
- new-instance p1, Ljava/net/ProtocolException;
- const-string p2, "unexpected data"
- invoke-direct {p1, p2}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
- throw p1
- :cond_3
- const-string v2, "Connection"
- invoke-virtual {v0, v2}, Lokhttp3/mockwebserver/RecordedRequest;->getHeader(Ljava/lang/String;)Ljava/lang/String;
- move-result-object v2
- const-string v3, "Upgrade"
- invoke-virtual {v3, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
- move-result v2
- const/4 v9, 0x1
- if-eqz v2, :cond_4
- invoke-virtual {v0, v3}, Lokhttp3/mockwebserver/RecordedRequest;->getHeader(Ljava/lang/String;)Ljava/lang/String;
- move-result-object v2
- const-string v3, "websocket"
- invoke-virtual {v3, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
- move-result v2
- if-eqz v2, :cond_4
- const/4 v2, 0x1
- goto :goto_0
- :cond_4
- const/4 v2, 0x0
- :goto_0
- invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getWebSocketListener()Lokhttp3/WebSocketListener;
- move-result-object v3
- if-eqz v3, :cond_5
- const/4 v3, 0x1
- goto :goto_1
- :cond_5
- const/4 v3, 0x0
- :goto_1
- if-eqz v2, :cond_6
- if-eqz v3, :cond_6
- iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- move-object v3, p1
- move-object v4, p2
- move-object v5, p3
- move-object v6, v0
- move-object v7, v8
- invoke-static/range {v2 .. v7}, Lokhttp3/mockwebserver/MockWebServer;->access$1700(Lokhttp3/mockwebserver/MockWebServer;Ljava/net/Socket;Lokio/BufferedSource;Lokio/BufferedSink;Lokhttp3/mockwebserver/RecordedRequest;Lokhttp3/mockwebserver/MockResponse;)V
- const/4 p2, 0x0
- goto :goto_2
- :cond_6
- iget-object p2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {p2, p1, p3, v8}, Lokhttp3/mockwebserver/MockWebServer;->access$1800(Lokhttp3/mockwebserver/MockWebServer;Ljava/net/Socket;Lokio/BufferedSink;Lokhttp3/mockwebserver/MockResponse;)V
- const/4 p2, 0x1
- :goto_2
- invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
- move-result-object p3
- sget-object v2, Ljava/util/logging/Level;->INFO:Ljava/util/logging/Level;
- invoke-virtual {p3, v2}, Ljava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z
- move-result p3
- if-eqz p3, :cond_7
- invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
- move-result-object p3
- new-instance v2, Ljava/lang/StringBuilder;
- invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
- iget-object v3, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v3, " received request: "
- invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v0, " and responded: "
- invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v2, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {p3, v0}, Ljava/util/logging/Logger;->info(Ljava/lang/String;)V
- :cond_7
- invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
- move-result-object p3
- sget-object v0, Lokhttp3/mockwebserver/SocketPolicy;->DISCONNECT_AT_END:Lokhttp3/mockwebserver/SocketPolicy;
- if-ne p3, v0, :cond_8
- invoke-virtual {p1}, Ljava/net/Socket;->close()V
- return v1
- :cond_8
- invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
- move-result-object p3
- sget-object v0, Lokhttp3/mockwebserver/SocketPolicy;->SHUTDOWN_INPUT_AT_END:Lokhttp3/mockwebserver/SocketPolicy;
- if-ne p3, v0, :cond_9
- invoke-virtual {p1}, Ljava/net/Socket;->shutdownInput()V
- goto :goto_3
- :cond_9
- invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
- move-result-object p3
- sget-object v0, Lokhttp3/mockwebserver/SocketPolicy;->SHUTDOWN_OUTPUT_AT_END:Lokhttp3/mockwebserver/SocketPolicy;
- if-ne p3, v0, :cond_a
- invoke-virtual {p1}, Ljava/net/Socket;->shutdownOutput()V
- :cond_a
- :goto_3
- iget p1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
- add-int/2addr p1, v9
- iput p1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
- return p2
- .end method
- # virtual methods
- .method protected execute()V
- .locals 6
- const-string v0, " connection from "
- :try_start_0
- invoke-virtual {p0}, Lokhttp3/mockwebserver/MockWebServer$3;->processConnection()V
- :try_end_0
- .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
- .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
- goto :goto_0
- :catch_0
- move-exception v1
- invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
- move-result-object v2
- sget-object v3, Ljava/util/logging/Level;->SEVERE:Ljava/util/logging/Level;
- new-instance v4, Ljava/lang/StringBuilder;
- invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
- iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-virtual {v0}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress;
- move-result-object v0
- invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v0, " crashed"
- invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {v2, v3, v0, v1}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
- goto :goto_0
- :catch_1
- move-exception v1
- invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
- move-result-object v2
- new-instance v3, Ljava/lang/StringBuilder;
- invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
- iget-object v4, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-virtual {v0}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress;
- move-result-object v0
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v0, " failed: "
- invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {v2, v0}, Ljava/util/logging/Logger;->info(Ljava/lang/String;)V
- :goto_0
- return-void
- .end method
- .method public processConnection()V
- .locals 8
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/lang/Exception;
- }
- .end annotation
- sget-object v0, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$800(Lokhttp3/mockwebserver/MockWebServer;)Ljavax/net/ssl/SSLSocketFactory;
- move-result-object v1
- const/4 v2, 0x0
- const/4 v3, 0x0
- if-eqz v1, :cond_5
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$900(Lokhttp3/mockwebserver/MockWebServer;)Z
- move-result v1
- if-eqz v1, :cond_0
- invoke-direct {p0}, Lokhttp3/mockwebserver/MockWebServer$3;->createTunnel()V
- :cond_0
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$400(Lokhttp3/mockwebserver/MockWebServer;)Lokhttp3/mockwebserver/Dispatcher;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/mockwebserver/Dispatcher;->peek()Lokhttp3/mockwebserver/MockResponse;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
- move-result-object v1
- sget-object v4, Lokhttp3/mockwebserver/SocketPolicy;->FAIL_HANDSHAKE:Lokhttp3/mockwebserver/SocketPolicy;
- if-ne v1, v4, :cond_1
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- iget v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
- iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-static {v0, v1, v2}, Lokhttp3/mockwebserver/MockWebServer;->access$600(Lokhttp3/mockwebserver/MockWebServer;ILjava/net/Socket;)V
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-static {v0, v1}, Lokhttp3/mockwebserver/MockWebServer;->access$1000(Lokhttp3/mockwebserver/MockWebServer;Ljava/net/Socket;)V
- return-void
- :cond_1
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$800(Lokhttp3/mockwebserver/MockWebServer;)Ljavax/net/ssl/SSLSocketFactory;
- move-result-object v1
- iget-object v4, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-virtual {v4}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress;
- move-result-object v5
- invoke-virtual {v5}, Ljava/net/InetAddress;->getHostAddress()Ljava/lang/String;
- move-result-object v5
- iget-object v6, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-virtual {v6}, Ljava/net/Socket;->getPort()I
- move-result v6
- const/4 v7, 0x1
- invoke-virtual {v1, v4, v5, v6, v7}, Ljavax/net/ssl/SSLSocketFactory;->createSocket(Ljava/net/Socket;Ljava/lang/String;IZ)Ljava/net/Socket;
- move-result-object v1
- move-object v4, v1
- check-cast v4, Ljavax/net/ssl/SSLSocket;
- invoke-virtual {v4, v2}, Ljavax/net/ssl/SSLSocket;->setUseClientMode(Z)V
- iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v5}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
- move-result-object v5
- invoke-interface {v5, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
- iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v5}, Lokhttp3/mockwebserver/MockWebServer;->access$1100(Lokhttp3/mockwebserver/MockWebServer;)Z
- move-result v5
- if-eqz v5, :cond_2
- invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
- move-result-object v5
- iget-object v6, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v6}, Lokhttp3/mockwebserver/MockWebServer;->access$1200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/List;
- move-result-object v6
- invoke-virtual {v5, v4, v3, v6}, Lokhttp3/internal/platform/Platform;->configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
- :cond_2
- invoke-virtual {v4}, Ljavax/net/ssl/SSLSocket;->startHandshake()V
- iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v5}, Lokhttp3/mockwebserver/MockWebServer;->access$1100(Lokhttp3/mockwebserver/MockWebServer;)Z
- move-result v5
- if-eqz v5, :cond_4
- invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
- move-result-object v0
- invoke-virtual {v0, v4}, Lokhttp3/internal/platform/Platform;->getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
- move-result-object v0
- if-eqz v0, :cond_3
- invoke-static {v0}, Lokhttp3/Protocol;->get(Ljava/lang/String;)Lokhttp3/Protocol;
- move-result-object v0
- goto :goto_0
- :cond_3
- sget-object v0, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
- :cond_4
- :goto_0
- iget-object v4, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v4}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
- move-result-object v4
- iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-interface {v4, v5}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
- goto :goto_1
- :cond_5
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- :goto_1
- sget-object v4, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
- if-ne v0, v4, :cond_6
- new-instance v4, Lokhttp3/mockwebserver/MockWebServer$Http2SocketHandler;
- iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-direct {v4, v5, v1, v0, v3}, Lokhttp3/mockwebserver/MockWebServer$Http2SocketHandler;-><init>(Lokhttp3/mockwebserver/MockWebServer;Ljava/net/Socket;Lokhttp3/Protocol;Lokhttp3/mockwebserver/MockWebServer$1;)V
- new-instance v0, Lokhttp3/internal/http2/Http2Connection$Builder;
- invoke-direct {v0, v2}, Lokhttp3/internal/http2/Http2Connection$Builder;-><init>(Z)V
- invoke-virtual {v0, v1}, Lokhttp3/internal/http2/Http2Connection$Builder;->socket(Ljava/net/Socket;)Lokhttp3/internal/http2/Http2Connection$Builder;
- move-result-object v0
- invoke-virtual {v0, v4}, Lokhttp3/internal/http2/Http2Connection$Builder;->listener(Lokhttp3/internal/http2/Http2Connection$Listener;)Lokhttp3/internal/http2/Http2Connection$Builder;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Connection$Builder;->build()Lokhttp3/internal/http2/Http2Connection;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Connection;->start()V
- iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$300(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
- move-result-object v2
- invoke-interface {v2, v0}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
- move-result-object v0
- invoke-interface {v0, v1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
- return-void
- :cond_6
- sget-object v2, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
- if-ne v0, v2, :cond_9
- invoke-static {v1}, Lokio/Okio;->source(Ljava/net/Socket;)Lokio/Source;
- move-result-object v0
- invoke-static {v0}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
- move-result-object v0
- invoke-static {v1}, Lokio/Okio;->sink(Ljava/net/Socket;)Lokio/Sink;
- move-result-object v2
- invoke-static {v2}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink;
- move-result-object v2
- :goto_2
- invoke-direct {p0, v1, v0, v2}, Lokhttp3/mockwebserver/MockWebServer$3;->processOneRequest(Ljava/net/Socket;Lokio/BufferedSource;Lokio/BufferedSink;)Z
- move-result v3
- if-eqz v3, :cond_7
- goto :goto_2
- :cond_7
- iget v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
- if-nez v0, :cond_8
- invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
- move-result-object v0
- new-instance v2, Ljava/lang/StringBuilder;
- invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
- iget-object v3, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v3, " connection from "
- invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v3, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
- invoke-virtual {v3}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress;
- move-result-object v3
- invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v3, " didn\'t make a request"
- invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v2
- invoke-virtual {v0, v2}, Ljava/util/logging/Logger;->warning(Ljava/lang/String;)V
- :cond_8
- invoke-virtual {v1}, Ljava/net/Socket;->close()V
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
- move-result-object v0
- invoke-interface {v0, v1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
- return-void
- :cond_9
- new-instance v0, Ljava/lang/AssertionError;
- invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
- goto :goto_4
- :goto_3
- throw v0
- :goto_4
- goto :goto_3
- .end method
|