MockWebServer$3.smali 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. .class Lokhttp3/mockwebserver/MockWebServer$3;
  2. .super Lokhttp3/internal/NamedRunnable;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingMethod;
  6. value = Lokhttp3/mockwebserver/MockWebServer;->serveConnection(Ljava/net/Socket;)V
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x0
  10. name = null
  11. .end annotation
  12. # instance fields
  13. .field sequenceNumber:I
  14. .field final synthetic this$0:Lokhttp3/mockwebserver/MockWebServer;
  15. .field final synthetic val$raw:Ljava/net/Socket;
  16. # direct methods
  17. .method varargs constructor <init>(Lokhttp3/mockwebserver/MockWebServer;Ljava/lang/String;[Ljava/lang/Object;Ljava/net/Socket;)V
  18. .locals 0
  19. iput-object p1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  20. iput-object p4, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  21. invoke-direct {p0, p2, p3}, Lokhttp3/internal/NamedRunnable;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V
  22. const/4 p1, 0x0
  23. iput p1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
  24. return-void
  25. .end method
  26. .method private createTunnel()V
  27. .locals 4
  28. .annotation system Ldalvik/annotation/Throws;
  29. value = {
  30. Ljava/io/IOException;,
  31. Ljava/lang/InterruptedException;
  32. }
  33. .end annotation
  34. iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  35. invoke-static {v0}, Lokio/Okio;->source(Ljava/net/Socket;)Lokio/Source;
  36. move-result-object v0
  37. invoke-static {v0}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
  38. move-result-object v0
  39. iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  40. invoke-static {v1}, Lokio/Okio;->sink(Ljava/net/Socket;)Lokio/Sink;
  41. move-result-object v1
  42. invoke-static {v1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink;
  43. move-result-object v1
  44. :cond_0
  45. iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  46. invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$400(Lokhttp3/mockwebserver/MockWebServer;)Lokhttp3/mockwebserver/Dispatcher;
  47. move-result-object v2
  48. invoke-virtual {v2}, Lokhttp3/mockwebserver/Dispatcher;->peek()Lokhttp3/mockwebserver/MockResponse;
  49. move-result-object v2
  50. invoke-virtual {v2}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
  51. move-result-object v2
  52. iget-object v3, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  53. invoke-direct {p0, v3, v0, v1}, Lokhttp3/mockwebserver/MockWebServer$3;->processOneRequest(Ljava/net/Socket;Lokio/BufferedSource;Lokio/BufferedSink;)Z
  54. move-result v3
  55. if-eqz v3, :cond_1
  56. sget-object v3, Lokhttp3/mockwebserver/SocketPolicy;->UPGRADE_TO_SSL_AT_END:Lokhttp3/mockwebserver/SocketPolicy;
  57. if-ne v2, v3, :cond_0
  58. return-void
  59. :cond_1
  60. new-instance v0, Ljava/lang/IllegalStateException;
  61. const-string v1, "Tunnel without any CONNECT!"
  62. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  63. goto :goto_1
  64. :goto_0
  65. throw v0
  66. :goto_1
  67. goto :goto_0
  68. .end method
  69. .method private processOneRequest(Ljava/net/Socket;Lokio/BufferedSource;Lokio/BufferedSink;)Z
  70. .locals 10
  71. .annotation system Ldalvik/annotation/Throws;
  72. value = {
  73. Ljava/io/IOException;,
  74. Ljava/lang/InterruptedException;
  75. }
  76. .end annotation
  77. iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  78. iget v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
  79. 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;
  80. move-result-object v0
  81. const/4 v1, 0x0
  82. if-nez v0, :cond_0
  83. return v1
  84. :cond_0
  85. iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  86. invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$1500(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/concurrent/atomic/AtomicInteger;
  87. move-result-object v2
  88. invoke-virtual {v2}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I
  89. iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  90. invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$1600(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/concurrent/BlockingQueue;
  91. move-result-object v2
  92. invoke-interface {v2, v0}, Ljava/util/concurrent/BlockingQueue;->add(Ljava/lang/Object;)Z
  93. iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  94. invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$400(Lokhttp3/mockwebserver/MockWebServer;)Lokhttp3/mockwebserver/Dispatcher;
  95. move-result-object v2
  96. invoke-virtual {v2, v0}, Lokhttp3/mockwebserver/Dispatcher;->dispatch(Lokhttp3/mockwebserver/RecordedRequest;)Lokhttp3/mockwebserver/MockResponse;
  97. move-result-object v8
  98. invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
  99. move-result-object v2
  100. sget-object v3, Lokhttp3/mockwebserver/SocketPolicy;->DISCONNECT_AFTER_REQUEST:Lokhttp3/mockwebserver/SocketPolicy;
  101. if-ne v2, v3, :cond_1
  102. invoke-virtual {p1}, Ljava/net/Socket;->close()V
  103. return v1
  104. :cond_1
  105. invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
  106. move-result-object v2
  107. sget-object v3, Lokhttp3/mockwebserver/SocketPolicy;->NO_RESPONSE:Lokhttp3/mockwebserver/SocketPolicy;
  108. if-ne v2, v3, :cond_3
  109. invoke-interface {p2}, Lokio/BufferedSource;->exhausted()Z
  110. move-result p1
  111. if-eqz p1, :cond_2
  112. return v1
  113. :cond_2
  114. new-instance p1, Ljava/net/ProtocolException;
  115. const-string p2, "unexpected data"
  116. invoke-direct {p1, p2}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
  117. throw p1
  118. :cond_3
  119. const-string v2, "Connection"
  120. invoke-virtual {v0, v2}, Lokhttp3/mockwebserver/RecordedRequest;->getHeader(Ljava/lang/String;)Ljava/lang/String;
  121. move-result-object v2
  122. const-string v3, "Upgrade"
  123. invoke-virtual {v3, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
  124. move-result v2
  125. const/4 v9, 0x1
  126. if-eqz v2, :cond_4
  127. invoke-virtual {v0, v3}, Lokhttp3/mockwebserver/RecordedRequest;->getHeader(Ljava/lang/String;)Ljava/lang/String;
  128. move-result-object v2
  129. const-string v3, "websocket"
  130. invoke-virtual {v3, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
  131. move-result v2
  132. if-eqz v2, :cond_4
  133. const/4 v2, 0x1
  134. goto :goto_0
  135. :cond_4
  136. const/4 v2, 0x0
  137. :goto_0
  138. invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getWebSocketListener()Lokhttp3/WebSocketListener;
  139. move-result-object v3
  140. if-eqz v3, :cond_5
  141. const/4 v3, 0x1
  142. goto :goto_1
  143. :cond_5
  144. const/4 v3, 0x0
  145. :goto_1
  146. if-eqz v2, :cond_6
  147. if-eqz v3, :cond_6
  148. iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  149. move-object v3, p1
  150. move-object v4, p2
  151. move-object v5, p3
  152. move-object v6, v0
  153. move-object v7, v8
  154. 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
  155. const/4 p2, 0x0
  156. goto :goto_2
  157. :cond_6
  158. iget-object p2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  159. invoke-static {p2, p1, p3, v8}, Lokhttp3/mockwebserver/MockWebServer;->access$1800(Lokhttp3/mockwebserver/MockWebServer;Ljava/net/Socket;Lokio/BufferedSink;Lokhttp3/mockwebserver/MockResponse;)V
  160. const/4 p2, 0x1
  161. :goto_2
  162. invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
  163. move-result-object p3
  164. sget-object v2, Ljava/util/logging/Level;->INFO:Ljava/util/logging/Level;
  165. invoke-virtual {p3, v2}, Ljava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z
  166. move-result p3
  167. if-eqz p3, :cond_7
  168. invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
  169. move-result-object p3
  170. new-instance v2, Ljava/lang/StringBuilder;
  171. invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
  172. iget-object v3, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  173. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  174. const-string v3, " received request: "
  175. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  176. invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  177. const-string v0, " and responded: "
  178. invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  179. invoke-virtual {v2, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  180. invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  181. move-result-object v0
  182. invoke-virtual {p3, v0}, Ljava/util/logging/Logger;->info(Ljava/lang/String;)V
  183. :cond_7
  184. invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
  185. move-result-object p3
  186. sget-object v0, Lokhttp3/mockwebserver/SocketPolicy;->DISCONNECT_AT_END:Lokhttp3/mockwebserver/SocketPolicy;
  187. if-ne p3, v0, :cond_8
  188. invoke-virtual {p1}, Ljava/net/Socket;->close()V
  189. return v1
  190. :cond_8
  191. invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
  192. move-result-object p3
  193. sget-object v0, Lokhttp3/mockwebserver/SocketPolicy;->SHUTDOWN_INPUT_AT_END:Lokhttp3/mockwebserver/SocketPolicy;
  194. if-ne p3, v0, :cond_9
  195. invoke-virtual {p1}, Ljava/net/Socket;->shutdownInput()V
  196. goto :goto_3
  197. :cond_9
  198. invoke-virtual {v8}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
  199. move-result-object p3
  200. sget-object v0, Lokhttp3/mockwebserver/SocketPolicy;->SHUTDOWN_OUTPUT_AT_END:Lokhttp3/mockwebserver/SocketPolicy;
  201. if-ne p3, v0, :cond_a
  202. invoke-virtual {p1}, Ljava/net/Socket;->shutdownOutput()V
  203. :cond_a
  204. :goto_3
  205. iget p1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
  206. add-int/2addr p1, v9
  207. iput p1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
  208. return p2
  209. .end method
  210. # virtual methods
  211. .method protected execute()V
  212. .locals 6
  213. const-string v0, " connection from "
  214. :try_start_0
  215. invoke-virtual {p0}, Lokhttp3/mockwebserver/MockWebServer$3;->processConnection()V
  216. :try_end_0
  217. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
  218. .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
  219. goto :goto_0
  220. :catch_0
  221. move-exception v1
  222. invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
  223. move-result-object v2
  224. sget-object v3, Ljava/util/logging/Level;->SEVERE:Ljava/util/logging/Level;
  225. new-instance v4, Ljava/lang/StringBuilder;
  226. invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
  227. iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  228. invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  229. invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  230. iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  231. invoke-virtual {v0}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress;
  232. move-result-object v0
  233. invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  234. const-string v0, " crashed"
  235. invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  236. invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  237. move-result-object v0
  238. invoke-virtual {v2, v3, v0, v1}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
  239. goto :goto_0
  240. :catch_1
  241. move-exception v1
  242. invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
  243. move-result-object v2
  244. new-instance v3, Ljava/lang/StringBuilder;
  245. invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
  246. iget-object v4, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  247. invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  248. invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  249. iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  250. invoke-virtual {v0}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress;
  251. move-result-object v0
  252. invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  253. const-string v0, " failed: "
  254. invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  255. invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  256. invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  257. move-result-object v0
  258. invoke-virtual {v2, v0}, Ljava/util/logging/Logger;->info(Ljava/lang/String;)V
  259. :goto_0
  260. return-void
  261. .end method
  262. .method public processConnection()V
  263. .locals 8
  264. .annotation system Ldalvik/annotation/Throws;
  265. value = {
  266. Ljava/lang/Exception;
  267. }
  268. .end annotation
  269. sget-object v0, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
  270. iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  271. invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$800(Lokhttp3/mockwebserver/MockWebServer;)Ljavax/net/ssl/SSLSocketFactory;
  272. move-result-object v1
  273. const/4 v2, 0x0
  274. const/4 v3, 0x0
  275. if-eqz v1, :cond_5
  276. iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  277. invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$900(Lokhttp3/mockwebserver/MockWebServer;)Z
  278. move-result v1
  279. if-eqz v1, :cond_0
  280. invoke-direct {p0}, Lokhttp3/mockwebserver/MockWebServer$3;->createTunnel()V
  281. :cond_0
  282. iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  283. invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$400(Lokhttp3/mockwebserver/MockWebServer;)Lokhttp3/mockwebserver/Dispatcher;
  284. move-result-object v1
  285. invoke-virtual {v1}, Lokhttp3/mockwebserver/Dispatcher;->peek()Lokhttp3/mockwebserver/MockResponse;
  286. move-result-object v1
  287. invoke-virtual {v1}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
  288. move-result-object v1
  289. sget-object v4, Lokhttp3/mockwebserver/SocketPolicy;->FAIL_HANDSHAKE:Lokhttp3/mockwebserver/SocketPolicy;
  290. if-ne v1, v4, :cond_1
  291. iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  292. iget v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
  293. iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  294. invoke-static {v0, v1, v2}, Lokhttp3/mockwebserver/MockWebServer;->access$600(Lokhttp3/mockwebserver/MockWebServer;ILjava/net/Socket;)V
  295. iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  296. iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  297. invoke-static {v0, v1}, Lokhttp3/mockwebserver/MockWebServer;->access$1000(Lokhttp3/mockwebserver/MockWebServer;Ljava/net/Socket;)V
  298. return-void
  299. :cond_1
  300. iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  301. invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$800(Lokhttp3/mockwebserver/MockWebServer;)Ljavax/net/ssl/SSLSocketFactory;
  302. move-result-object v1
  303. iget-object v4, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  304. invoke-virtual {v4}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress;
  305. move-result-object v5
  306. invoke-virtual {v5}, Ljava/net/InetAddress;->getHostAddress()Ljava/lang/String;
  307. move-result-object v5
  308. iget-object v6, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  309. invoke-virtual {v6}, Ljava/net/Socket;->getPort()I
  310. move-result v6
  311. const/4 v7, 0x1
  312. invoke-virtual {v1, v4, v5, v6, v7}, Ljavax/net/ssl/SSLSocketFactory;->createSocket(Ljava/net/Socket;Ljava/lang/String;IZ)Ljava/net/Socket;
  313. move-result-object v1
  314. move-object v4, v1
  315. check-cast v4, Ljavax/net/ssl/SSLSocket;
  316. invoke-virtual {v4, v2}, Ljavax/net/ssl/SSLSocket;->setUseClientMode(Z)V
  317. iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  318. invoke-static {v5}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
  319. move-result-object v5
  320. invoke-interface {v5, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
  321. iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  322. invoke-static {v5}, Lokhttp3/mockwebserver/MockWebServer;->access$1100(Lokhttp3/mockwebserver/MockWebServer;)Z
  323. move-result v5
  324. if-eqz v5, :cond_2
  325. invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
  326. move-result-object v5
  327. iget-object v6, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  328. invoke-static {v6}, Lokhttp3/mockwebserver/MockWebServer;->access$1200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/List;
  329. move-result-object v6
  330. invoke-virtual {v5, v4, v3, v6}, Lokhttp3/internal/platform/Platform;->configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
  331. :cond_2
  332. invoke-virtual {v4}, Ljavax/net/ssl/SSLSocket;->startHandshake()V
  333. iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  334. invoke-static {v5}, Lokhttp3/mockwebserver/MockWebServer;->access$1100(Lokhttp3/mockwebserver/MockWebServer;)Z
  335. move-result v5
  336. if-eqz v5, :cond_4
  337. invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform;
  338. move-result-object v0
  339. invoke-virtual {v0, v4}, Lokhttp3/internal/platform/Platform;->getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
  340. move-result-object v0
  341. if-eqz v0, :cond_3
  342. invoke-static {v0}, Lokhttp3/Protocol;->get(Ljava/lang/String;)Lokhttp3/Protocol;
  343. move-result-object v0
  344. goto :goto_0
  345. :cond_3
  346. sget-object v0, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
  347. :cond_4
  348. :goto_0
  349. iget-object v4, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  350. invoke-static {v4}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
  351. move-result-object v4
  352. iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  353. invoke-interface {v4, v5}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
  354. goto :goto_1
  355. :cond_5
  356. iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  357. :goto_1
  358. sget-object v4, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
  359. if-ne v0, v4, :cond_6
  360. new-instance v4, Lokhttp3/mockwebserver/MockWebServer$Http2SocketHandler;
  361. iget-object v5, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  362. 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
  363. new-instance v0, Lokhttp3/internal/http2/Http2Connection$Builder;
  364. invoke-direct {v0, v2}, Lokhttp3/internal/http2/Http2Connection$Builder;-><init>(Z)V
  365. invoke-virtual {v0, v1}, Lokhttp3/internal/http2/Http2Connection$Builder;->socket(Ljava/net/Socket;)Lokhttp3/internal/http2/Http2Connection$Builder;
  366. move-result-object v0
  367. invoke-virtual {v0, v4}, Lokhttp3/internal/http2/Http2Connection$Builder;->listener(Lokhttp3/internal/http2/Http2Connection$Listener;)Lokhttp3/internal/http2/Http2Connection$Builder;
  368. move-result-object v0
  369. invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Connection$Builder;->build()Lokhttp3/internal/http2/Http2Connection;
  370. move-result-object v0
  371. invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Connection;->start()V
  372. iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  373. invoke-static {v2}, Lokhttp3/mockwebserver/MockWebServer;->access$300(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
  374. move-result-object v2
  375. invoke-interface {v2, v0}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
  376. iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  377. invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
  378. move-result-object v0
  379. invoke-interface {v0, v1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
  380. return-void
  381. :cond_6
  382. sget-object v2, Lokhttp3/Protocol;->HTTP_1_1:Lokhttp3/Protocol;
  383. if-ne v0, v2, :cond_9
  384. invoke-static {v1}, Lokio/Okio;->source(Ljava/net/Socket;)Lokio/Source;
  385. move-result-object v0
  386. invoke-static {v0}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
  387. move-result-object v0
  388. invoke-static {v1}, Lokio/Okio;->sink(Ljava/net/Socket;)Lokio/Sink;
  389. move-result-object v2
  390. invoke-static {v2}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink;
  391. move-result-object v2
  392. :goto_2
  393. invoke-direct {p0, v1, v0, v2}, Lokhttp3/mockwebserver/MockWebServer$3;->processOneRequest(Ljava/net/Socket;Lokio/BufferedSource;Lokio/BufferedSink;)Z
  394. move-result v3
  395. if-eqz v3, :cond_7
  396. goto :goto_2
  397. :cond_7
  398. iget v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->sequenceNumber:I
  399. if-nez v0, :cond_8
  400. invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
  401. move-result-object v0
  402. new-instance v2, Ljava/lang/StringBuilder;
  403. invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
  404. iget-object v3, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  405. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  406. const-string v3, " connection from "
  407. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  408. iget-object v3, p0, Lokhttp3/mockwebserver/MockWebServer$3;->val$raw:Ljava/net/Socket;
  409. invoke-virtual {v3}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress;
  410. move-result-object v3
  411. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  412. const-string v3, " didn\'t make a request"
  413. invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  414. invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  415. move-result-object v2
  416. invoke-virtual {v0, v2}, Ljava/util/logging/Logger;->warning(Ljava/lang/String;)V
  417. :cond_8
  418. invoke-virtual {v1}, Ljava/net/Socket;->close()V
  419. iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$3;->this$0:Lokhttp3/mockwebserver/MockWebServer;
  420. invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
  421. move-result-object v0
  422. invoke-interface {v0, v1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
  423. return-void
  424. :cond_9
  425. new-instance v0, Ljava/lang/AssertionError;
  426. invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
  427. goto :goto_4
  428. :goto_3
  429. throw v0
  430. :goto_4
  431. goto :goto_3
  432. .end method