Http2Connection$ReaderRunnable.smali 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  1. .class Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;
  2. .super Lokhttp3/internal/NamedRunnable;
  3. .source ""
  4. # interfaces
  5. .implements Lokhttp3/internal/http2/Http2Reader$Handler;
  6. # annotations
  7. .annotation system Ldalvik/annotation/EnclosingClass;
  8. value = Lokhttp3/internal/http2/Http2Connection;
  9. .end annotation
  10. .annotation system Ldalvik/annotation/InnerClass;
  11. accessFlags = 0x0
  12. name = "ReaderRunnable"
  13. .end annotation
  14. # instance fields
  15. .field final reader:Lokhttp3/internal/http2/Http2Reader;
  16. .field final synthetic this$0:Lokhttp3/internal/http2/Http2Connection;
  17. # direct methods
  18. .method constructor <init>(Lokhttp3/internal/http2/Http2Connection;Lokhttp3/internal/http2/Http2Reader;)V
  19. .locals 2
  20. iput-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  21. const/4 v0, 0x1
  22. new-array v0, v0, [Ljava/lang/Object;
  23. iget-object p1, p1, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
  24. const/4 v1, 0x0
  25. aput-object p1, v0, v1
  26. const-string p1, "OkHttp %s"
  27. invoke-direct {p0, p1, v0}, Lokhttp3/internal/NamedRunnable;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V
  28. iput-object p2, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->reader:Lokhttp3/internal/http2/Http2Reader;
  29. return-void
  30. .end method
  31. .method private applyAndAckSettings(Lokhttp3/internal/http2/Settings;)V
  32. .locals 5
  33. sget-object v0, Lokhttp3/internal/http2/Http2Connection;->executor:Ljava/util/concurrent/ExecutorService;
  34. new-instance v1, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable$3;
  35. const/4 v2, 0x1
  36. new-array v2, v2, [Ljava/lang/Object;
  37. iget-object v3, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  38. iget-object v3, v3, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
  39. const/4 v4, 0x0
  40. aput-object v3, v2, v4
  41. const-string v3, "OkHttp %s ACK Settings"
  42. invoke-direct {v1, p0, v3, v2, p1}, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable$3;-><init>(Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;Ljava/lang/String;[Ljava/lang/Object;Lokhttp3/internal/http2/Settings;)V
  43. invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
  44. return-void
  45. .end method
  46. # virtual methods
  47. .method public ackSettings()V
  48. .locals 0
  49. return-void
  50. .end method
  51. .method public alternateService(ILjava/lang/String;Lokio/ByteString;Ljava/lang/String;IJ)V
  52. .locals 0
  53. return-void
  54. .end method
  55. .method public data(ZILokio/BufferedSource;I)V
  56. .locals 1
  57. .annotation system Ldalvik/annotation/Throws;
  58. value = {
  59. Ljava/io/IOException;
  60. }
  61. .end annotation
  62. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  63. invoke-virtual {v0, p2}, Lokhttp3/internal/http2/Http2Connection;->pushedStream(I)Z
  64. move-result v0
  65. if-eqz v0, :cond_0
  66. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  67. invoke-virtual {v0, p2, p3, p4, p1}, Lokhttp3/internal/http2/Http2Connection;->pushDataLater(ILokio/BufferedSource;IZ)V
  68. return-void
  69. :cond_0
  70. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  71. invoke-virtual {v0, p2}, Lokhttp3/internal/http2/Http2Connection;->getStream(I)Lokhttp3/internal/http2/Http2Stream;
  72. move-result-object v0
  73. if-nez v0, :cond_1
  74. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  75. sget-object v0, Lokhttp3/internal/http2/ErrorCode;->PROTOCOL_ERROR:Lokhttp3/internal/http2/ErrorCode;
  76. invoke-virtual {p1, p2, v0}, Lokhttp3/internal/http2/Http2Connection;->writeSynResetLater(ILokhttp3/internal/http2/ErrorCode;)V
  77. int-to-long p1, p4
  78. invoke-interface {p3, p1, p2}, Lokio/BufferedSource;->skip(J)V
  79. return-void
  80. :cond_1
  81. invoke-virtual {v0, p3, p4}, Lokhttp3/internal/http2/Http2Stream;->receiveData(Lokio/BufferedSource;I)V
  82. if-eqz p1, :cond_2
  83. invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Stream;->receiveFin()V
  84. :cond_2
  85. return-void
  86. .end method
  87. .method protected execute()V
  88. .locals 4
  89. sget-object v0, Lokhttp3/internal/http2/ErrorCode;->INTERNAL_ERROR:Lokhttp3/internal/http2/ErrorCode;
  90. :try_start_0
  91. iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->reader:Lokhttp3/internal/http2/Http2Reader;
  92. invoke-virtual {v1, p0}, Lokhttp3/internal/http2/Http2Reader;->readConnectionPreface(Lokhttp3/internal/http2/Http2Reader$Handler;)V
  93. :goto_0
  94. iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->reader:Lokhttp3/internal/http2/Http2Reader;
  95. const/4 v2, 0x0
  96. invoke-virtual {v1, v2, p0}, Lokhttp3/internal/http2/Http2Reader;->nextFrame(ZLokhttp3/internal/http2/Http2Reader$Handler;)Z
  97. move-result v1
  98. if-eqz v1, :cond_0
  99. goto :goto_0
  100. :cond_0
  101. sget-object v1, Lokhttp3/internal/http2/ErrorCode;->NO_ERROR:Lokhttp3/internal/http2/ErrorCode;
  102. :try_end_0
  103. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  104. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  105. :try_start_1
  106. sget-object v0, Lokhttp3/internal/http2/ErrorCode;->CANCEL:Lokhttp3/internal/http2/ErrorCode;
  107. :try_end_1
  108. .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
  109. .catchall {:try_start_1 .. :try_end_1} :catchall_1
  110. :try_start_2
  111. iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  112. :try_end_2
  113. .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_2
  114. goto :goto_1
  115. :catchall_0
  116. move-exception v2
  117. move-object v1, v0
  118. goto :goto_2
  119. :catch_0
  120. move-object v1, v0
  121. :catch_1
  122. :try_start_3
  123. sget-object v1, Lokhttp3/internal/http2/ErrorCode;->PROTOCOL_ERROR:Lokhttp3/internal/http2/ErrorCode;
  124. sget-object v0, Lokhttp3/internal/http2/ErrorCode;->PROTOCOL_ERROR:Lokhttp3/internal/http2/ErrorCode;
  125. :try_end_3
  126. .catchall {:try_start_3 .. :try_end_3} :catchall_1
  127. :try_start_4
  128. iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  129. :goto_1
  130. invoke-virtual {v2, v1, v0}, Lokhttp3/internal/http2/Http2Connection;->close(Lokhttp3/internal/http2/ErrorCode;Lokhttp3/internal/http2/ErrorCode;)V
  131. :try_end_4
  132. .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_2
  133. :catch_2
  134. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->reader:Lokhttp3/internal/http2/Http2Reader;
  135. invoke-static {v0}, Lokhttp3/internal/Util;->closeQuietly(Ljava/io/Closeable;)V
  136. return-void
  137. :catchall_1
  138. move-exception v2
  139. :goto_2
  140. :try_start_5
  141. iget-object v3, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  142. invoke-virtual {v3, v1, v0}, Lokhttp3/internal/http2/Http2Connection;->close(Lokhttp3/internal/http2/ErrorCode;Lokhttp3/internal/http2/ErrorCode;)V
  143. :try_end_5
  144. .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_3
  145. :catch_3
  146. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->reader:Lokhttp3/internal/http2/Http2Reader;
  147. invoke-static {v0}, Lokhttp3/internal/Util;->closeQuietly(Ljava/io/Closeable;)V
  148. goto :goto_4
  149. :goto_3
  150. throw v2
  151. :goto_4
  152. goto :goto_3
  153. .end method
  154. .method public goAway(ILokhttp3/internal/http2/ErrorCode;Lokio/ByteString;)V
  155. .locals 3
  156. invoke-virtual {p3}, Lokio/ByteString;->size()I
  157. iget-object p2, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  158. monitor-enter p2
  159. :try_start_0
  160. iget-object p3, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  161. iget-object p3, p3, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
  162. invoke-interface {p3}, Ljava/util/Map;->values()Ljava/util/Collection;
  163. move-result-object p3
  164. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  165. iget-object v0, v0, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
  166. invoke-interface {v0}, Ljava/util/Map;->size()I
  167. move-result v0
  168. new-array v0, v0, [Lokhttp3/internal/http2/Http2Stream;
  169. invoke-interface {p3, v0}, Ljava/util/Collection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
  170. move-result-object p3
  171. check-cast p3, [Lokhttp3/internal/http2/Http2Stream;
  172. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  173. const/4 v1, 0x1
  174. iput-boolean v1, v0, Lokhttp3/internal/http2/Http2Connection;->shutdown:Z
  175. monitor-exit p2
  176. :try_end_0
  177. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  178. array-length p2, p3
  179. const/4 v0, 0x0
  180. :goto_0
  181. if-ge v0, p2, :cond_1
  182. aget-object v1, p3, v0
  183. invoke-virtual {v1}, Lokhttp3/internal/http2/Http2Stream;->getId()I
  184. move-result v2
  185. if-le v2, p1, :cond_0
  186. invoke-virtual {v1}, Lokhttp3/internal/http2/Http2Stream;->isLocallyInitiated()Z
  187. move-result v2
  188. if-eqz v2, :cond_0
  189. sget-object v2, Lokhttp3/internal/http2/ErrorCode;->REFUSED_STREAM:Lokhttp3/internal/http2/ErrorCode;
  190. invoke-virtual {v1, v2}, Lokhttp3/internal/http2/Http2Stream;->receiveRstStream(Lokhttp3/internal/http2/ErrorCode;)V
  191. iget-object v2, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  192. invoke-virtual {v1}, Lokhttp3/internal/http2/Http2Stream;->getId()I
  193. move-result v1
  194. invoke-virtual {v2, v1}, Lokhttp3/internal/http2/Http2Connection;->removeStream(I)Lokhttp3/internal/http2/Http2Stream;
  195. :cond_0
  196. add-int/lit8 v0, v0, 0x1
  197. goto :goto_0
  198. :cond_1
  199. return-void
  200. :catchall_0
  201. move-exception p1
  202. :try_start_1
  203. monitor-exit p2
  204. :try_end_1
  205. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  206. goto :goto_2
  207. :goto_1
  208. throw p1
  209. :goto_2
  210. goto :goto_1
  211. .end method
  212. .method public headers(ZIILjava/util/List;)V
  213. .locals 9
  214. .annotation system Ldalvik/annotation/Signature;
  215. value = {
  216. "(ZII",
  217. "Ljava/util/List<",
  218. "Lokhttp3/internal/http2/Header;",
  219. ">;)V"
  220. }
  221. .end annotation
  222. iget-object p3, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  223. invoke-virtual {p3, p2}, Lokhttp3/internal/http2/Http2Connection;->pushedStream(I)Z
  224. move-result p3
  225. if-eqz p3, :cond_0
  226. iget-object p3, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  227. invoke-virtual {p3, p2, p4, p1}, Lokhttp3/internal/http2/Http2Connection;->pushHeadersLater(ILjava/util/List;Z)V
  228. return-void
  229. :cond_0
  230. iget-object p3, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  231. monitor-enter p3
  232. :try_start_0
  233. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  234. invoke-virtual {v0, p2}, Lokhttp3/internal/http2/Http2Connection;->getStream(I)Lokhttp3/internal/http2/Http2Stream;
  235. move-result-object v0
  236. if-nez v0, :cond_4
  237. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  238. iget-boolean v0, v0, Lokhttp3/internal/http2/Http2Connection;->shutdown:Z
  239. if-eqz v0, :cond_1
  240. monitor-exit p3
  241. return-void
  242. :cond_1
  243. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  244. iget v0, v0, Lokhttp3/internal/http2/Http2Connection;->lastGoodStreamId:I
  245. if-gt p2, v0, :cond_2
  246. monitor-exit p3
  247. return-void
  248. :cond_2
  249. rem-int/lit8 v0, p2, 0x2
  250. iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  251. iget v1, v1, Lokhttp3/internal/http2/Http2Connection;->nextStreamId:I
  252. const/4 v2, 0x2
  253. rem-int/2addr v1, v2
  254. if-ne v0, v1, :cond_3
  255. monitor-exit p3
  256. return-void
  257. :cond_3
  258. new-instance v0, Lokhttp3/internal/http2/Http2Stream;
  259. iget-object v5, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  260. const/4 v6, 0x0
  261. move-object v3, v0
  262. move v4, p2
  263. move v7, p1
  264. move-object v8, p4
  265. invoke-direct/range {v3 .. v8}, Lokhttp3/internal/http2/Http2Stream;-><init>(ILokhttp3/internal/http2/Http2Connection;ZZLjava/util/List;)V
  266. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  267. iput p2, p1, Lokhttp3/internal/http2/Http2Connection;->lastGoodStreamId:I
  268. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  269. iget-object p1, p1, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
  270. invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
  271. move-result-object p4
  272. invoke-interface {p1, p4, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
  273. sget-object p1, Lokhttp3/internal/http2/Http2Connection;->executor:Ljava/util/concurrent/ExecutorService;
  274. new-instance p4, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable$1;
  275. const-string v1, "OkHttp %s stream %d"
  276. new-array v2, v2, [Ljava/lang/Object;
  277. const/4 v3, 0x0
  278. iget-object v4, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  279. iget-object v4, v4, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
  280. aput-object v4, v2, v3
  281. const/4 v3, 0x1
  282. invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
  283. move-result-object p2
  284. aput-object p2, v2, v3
  285. invoke-direct {p4, p0, v1, v2, v0}, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable$1;-><init>(Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;Ljava/lang/String;[Ljava/lang/Object;Lokhttp3/internal/http2/Http2Stream;)V
  286. invoke-interface {p1, p4}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
  287. monitor-exit p3
  288. return-void
  289. :cond_4
  290. monitor-exit p3
  291. :try_end_0
  292. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  293. invoke-virtual {v0, p4}, Lokhttp3/internal/http2/Http2Stream;->receiveHeaders(Ljava/util/List;)V
  294. if-eqz p1, :cond_5
  295. invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Stream;->receiveFin()V
  296. :cond_5
  297. return-void
  298. :catchall_0
  299. move-exception p1
  300. :try_start_1
  301. monitor-exit p3
  302. :try_end_1
  303. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  304. throw p1
  305. .end method
  306. .method public ping(ZII)V
  307. .locals 2
  308. if-eqz p1, :cond_0
  309. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  310. invoke-virtual {p1, p2}, Lokhttp3/internal/http2/Http2Connection;->removePing(I)Lokhttp3/internal/http2/Ping;
  311. move-result-object p1
  312. if-eqz p1, :cond_1
  313. invoke-virtual {p1}, Lokhttp3/internal/http2/Ping;->receive()V
  314. goto :goto_0
  315. :cond_0
  316. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  317. const/4 v0, 0x1
  318. const/4 v1, 0x0
  319. invoke-virtual {p1, v0, p2, p3, v1}, Lokhttp3/internal/http2/Http2Connection;->writePingLater(ZIILokhttp3/internal/http2/Ping;)V
  320. :cond_1
  321. :goto_0
  322. return-void
  323. .end method
  324. .method public priority(IIIZ)V
  325. .locals 0
  326. return-void
  327. .end method
  328. .method public pushPromise(IILjava/util/List;)V
  329. .locals 0
  330. .annotation system Ldalvik/annotation/Signature;
  331. value = {
  332. "(II",
  333. "Ljava/util/List<",
  334. "Lokhttp3/internal/http2/Header;",
  335. ">;)V"
  336. }
  337. .end annotation
  338. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  339. invoke-virtual {p1, p2, p3}, Lokhttp3/internal/http2/Http2Connection;->pushRequestLater(ILjava/util/List;)V
  340. return-void
  341. .end method
  342. .method public rstStream(ILokhttp3/internal/http2/ErrorCode;)V
  343. .locals 1
  344. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  345. invoke-virtual {v0, p1}, Lokhttp3/internal/http2/Http2Connection;->pushedStream(I)Z
  346. move-result v0
  347. if-eqz v0, :cond_0
  348. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  349. invoke-virtual {v0, p1, p2}, Lokhttp3/internal/http2/Http2Connection;->pushResetLater(ILokhttp3/internal/http2/ErrorCode;)V
  350. return-void
  351. :cond_0
  352. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  353. invoke-virtual {v0, p1}, Lokhttp3/internal/http2/Http2Connection;->removeStream(I)Lokhttp3/internal/http2/Http2Stream;
  354. move-result-object p1
  355. if-eqz p1, :cond_1
  356. invoke-virtual {p1, p2}, Lokhttp3/internal/http2/Http2Stream;->receiveRstStream(Lokhttp3/internal/http2/ErrorCode;)V
  357. :cond_1
  358. return-void
  359. .end method
  360. .method public settings(ZLokhttp3/internal/http2/Settings;)V
  361. .locals 10
  362. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  363. monitor-enter v0
  364. :try_start_0
  365. iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  366. iget-object v1, v1, Lokhttp3/internal/http2/Http2Connection;->peerSettings:Lokhttp3/internal/http2/Settings;
  367. invoke-virtual {v1}, Lokhttp3/internal/http2/Settings;->getInitialWindowSize()I
  368. move-result v1
  369. if-eqz p1, :cond_0
  370. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  371. iget-object p1, p1, Lokhttp3/internal/http2/Http2Connection;->peerSettings:Lokhttp3/internal/http2/Settings;
  372. invoke-virtual {p1}, Lokhttp3/internal/http2/Settings;->clear()V
  373. :cond_0
  374. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  375. iget-object p1, p1, Lokhttp3/internal/http2/Http2Connection;->peerSettings:Lokhttp3/internal/http2/Settings;
  376. invoke-virtual {p1, p2}, Lokhttp3/internal/http2/Settings;->merge(Lokhttp3/internal/http2/Settings;)V
  377. invoke-direct {p0, p2}, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->applyAndAckSettings(Lokhttp3/internal/http2/Settings;)V
  378. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  379. iget-object p1, p1, Lokhttp3/internal/http2/Http2Connection;->peerSettings:Lokhttp3/internal/http2/Settings;
  380. invoke-virtual {p1}, Lokhttp3/internal/http2/Settings;->getInitialWindowSize()I
  381. move-result p1
  382. const/4 p2, -0x1
  383. const-wide/16 v2, 0x0
  384. const/4 v4, 0x1
  385. const/4 v5, 0x0
  386. if-eq p1, p2, :cond_2
  387. if-eq p1, v1, :cond_2
  388. sub-int/2addr p1, v1
  389. int-to-long p1, p1
  390. iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  391. iget-boolean v1, v1, Lokhttp3/internal/http2/Http2Connection;->receivedInitialPeerSettings:Z
  392. if-nez v1, :cond_1
  393. iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  394. invoke-virtual {v1, p1, p2}, Lokhttp3/internal/http2/Http2Connection;->addBytesToWriteWindow(J)V
  395. iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  396. iput-boolean v4, v1, Lokhttp3/internal/http2/Http2Connection;->receivedInitialPeerSettings:Z
  397. :cond_1
  398. iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  399. iget-object v1, v1, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
  400. invoke-interface {v1}, Ljava/util/Map;->isEmpty()Z
  401. move-result v1
  402. if-nez v1, :cond_3
  403. iget-object v1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  404. iget-object v1, v1, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
  405. invoke-interface {v1}, Ljava/util/Map;->values()Ljava/util/Collection;
  406. move-result-object v1
  407. iget-object v5, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  408. iget-object v5, v5, Lokhttp3/internal/http2/Http2Connection;->streams:Ljava/util/Map;
  409. invoke-interface {v5}, Ljava/util/Map;->size()I
  410. move-result v5
  411. new-array v5, v5, [Lokhttp3/internal/http2/Http2Stream;
  412. invoke-interface {v1, v5}, Ljava/util/Collection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
  413. move-result-object v1
  414. move-object v5, v1
  415. check-cast v5, [Lokhttp3/internal/http2/Http2Stream;
  416. goto :goto_0
  417. :cond_2
  418. move-wide p1, v2
  419. :cond_3
  420. :goto_0
  421. sget-object v1, Lokhttp3/internal/http2/Http2Connection;->executor:Ljava/util/concurrent/ExecutorService;
  422. new-instance v6, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable$2;
  423. const-string v7, "OkHttp %s settings"
  424. new-array v4, v4, [Ljava/lang/Object;
  425. iget-object v8, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  426. iget-object v8, v8, Lokhttp3/internal/http2/Http2Connection;->hostname:Ljava/lang/String;
  427. const/4 v9, 0x0
  428. aput-object v8, v4, v9
  429. invoke-direct {v6, p0, v7, v4}, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable$2;-><init>(Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;Ljava/lang/String;[Ljava/lang/Object;)V
  430. invoke-interface {v1, v6}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
  431. monitor-exit v0
  432. :try_end_0
  433. .catchall {:try_start_0 .. :try_end_0} :catchall_1
  434. if-eqz v5, :cond_4
  435. cmp-long v0, p1, v2
  436. if-eqz v0, :cond_4
  437. array-length v0, v5
  438. :goto_1
  439. if-ge v9, v0, :cond_4
  440. aget-object v1, v5, v9
  441. monitor-enter v1
  442. :try_start_1
  443. invoke-virtual {v1, p1, p2}, Lokhttp3/internal/http2/Http2Stream;->addBytesToWriteWindow(J)V
  444. monitor-exit v1
  445. add-int/lit8 v9, v9, 0x1
  446. goto :goto_1
  447. :catchall_0
  448. move-exception p1
  449. monitor-exit v1
  450. :try_end_1
  451. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  452. throw p1
  453. :cond_4
  454. return-void
  455. :catchall_1
  456. move-exception p1
  457. :try_start_2
  458. monitor-exit v0
  459. :try_end_2
  460. .catchall {:try_start_2 .. :try_end_2} :catchall_1
  461. goto :goto_3
  462. :goto_2
  463. throw p1
  464. :goto_3
  465. goto :goto_2
  466. .end method
  467. .method public windowUpdate(IJ)V
  468. .locals 3
  469. iget-object v0, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  470. if-nez p1, :cond_0
  471. monitor-enter v0
  472. :try_start_0
  473. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  474. iget-wide v1, p1, Lokhttp3/internal/http2/Http2Connection;->bytesLeftInWriteWindow:J
  475. add-long/2addr v1, p2
  476. iput-wide v1, p1, Lokhttp3/internal/http2/Http2Connection;->bytesLeftInWriteWindow:J
  477. iget-object p1, p0, Lokhttp3/internal/http2/Http2Connection$ReaderRunnable;->this$0:Lokhttp3/internal/http2/Http2Connection;
  478. invoke-virtual {p1}, Ljava/lang/Object;->notifyAll()V
  479. monitor-exit v0
  480. goto :goto_0
  481. :catchall_0
  482. move-exception p1
  483. monitor-exit v0
  484. :try_end_0
  485. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  486. throw p1
  487. :cond_0
  488. invoke-virtual {v0, p1}, Lokhttp3/internal/http2/Http2Connection;->getStream(I)Lokhttp3/internal/http2/Http2Stream;
  489. move-result-object p1
  490. if-eqz p1, :cond_1
  491. monitor-enter p1
  492. :try_start_1
  493. invoke-virtual {p1, p2, p3}, Lokhttp3/internal/http2/Http2Stream;->addBytesToWriteWindow(J)V
  494. monitor-exit p1
  495. goto :goto_0
  496. :catchall_1
  497. move-exception p2
  498. monitor-exit p1
  499. :try_end_1
  500. .catchall {:try_start_1 .. :try_end_1} :catchall_1
  501. throw p2
  502. :cond_1
  503. :goto_0
  504. return-void
  505. .end method