Http2Codec.smali
22.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
.class public final Lokhttp3/internal/http2/Http2Codec;
.super Ljava/lang/Object;
.source "Http2Codec.java"
# interfaces
.implements Lokhttp3/internal/http/HttpCodec;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;
}
.end annotation
# static fields
.field private static final CONNECTION:Lokio/ByteString;
.field private static final ENCODING:Lokio/ByteString;
.field private static final HOST:Lokio/ByteString;
.field private static final HTTP_2_SKIPPED_REQUEST_HEADERS:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Lokio/ByteString;",
">;"
}
.end annotation
.end field
.field private static final HTTP_2_SKIPPED_RESPONSE_HEADERS:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Lokio/ByteString;",
">;"
}
.end annotation
.end field
.field private static final KEEP_ALIVE:Lokio/ByteString;
.field private static final PROXY_CONNECTION:Lokio/ByteString;
.field private static final TE:Lokio/ByteString;
.field private static final TRANSFER_ENCODING:Lokio/ByteString;
.field private static final UPGRADE:Lokio/ByteString;
# instance fields
.field private final chain:Lokhttp3/Interceptor$Chain;
.field private final client:Lokhttp3/OkHttpClient;
.field private final connection:Lokhttp3/internal/http2/Http2Connection;
.field private stream:Lokhttp3/internal/http2/Http2Stream;
.field final streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
# direct methods
.method static constructor <clinit>()V
.locals 12
const-string v0, "connection"
.line 55
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->CONNECTION:Lokio/ByteString;
const-string v0, "host"
.line 56
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->HOST:Lokio/ByteString;
const-string v0, "keep-alive"
.line 57
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->KEEP_ALIVE:Lokio/ByteString;
const-string v0, "proxy-connection"
.line 58
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->PROXY_CONNECTION:Lokio/ByteString;
const-string v0, "transfer-encoding"
.line 59
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->TRANSFER_ENCODING:Lokio/ByteString;
const-string v0, "te"
.line 60
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->TE:Lokio/ByteString;
const-string v0, "encoding"
.line 61
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->ENCODING:Lokio/ByteString;
const-string v0, "upgrade"
.line 62
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->UPGRADE:Lokio/ByteString;
const/16 v0, 0xc
.line 65
new-array v0, v0, [Lokio/ByteString;
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->CONNECTION:Lokio/ByteString;
const/4 v2, 0x0
aput-object v1, v0, v2
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->HOST:Lokio/ByteString;
const/4 v3, 0x1
aput-object v1, v0, v3
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->KEEP_ALIVE:Lokio/ByteString;
const/4 v4, 0x2
aput-object v1, v0, v4
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->PROXY_CONNECTION:Lokio/ByteString;
const/4 v5, 0x3
aput-object v1, v0, v5
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->TE:Lokio/ByteString;
const/4 v6, 0x4
aput-object v1, v0, v6
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->TRANSFER_ENCODING:Lokio/ByteString;
const/4 v7, 0x5
aput-object v1, v0, v7
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->ENCODING:Lokio/ByteString;
const/4 v8, 0x6
aput-object v1, v0, v8
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->UPGRADE:Lokio/ByteString;
const/4 v9, 0x7
aput-object v1, v0, v9
sget-object v1, Lokhttp3/internal/http2/Header;->TARGET_METHOD:Lokio/ByteString;
const/16 v10, 0x8
aput-object v1, v0, v10
sget-object v1, Lokhttp3/internal/http2/Header;->TARGET_PATH:Lokio/ByteString;
const/16 v11, 0x9
aput-object v1, v0, v11
sget-object v1, Lokhttp3/internal/http2/Header;->TARGET_SCHEME:Lokio/ByteString;
const/16 v11, 0xa
aput-object v1, v0, v11
sget-object v1, Lokhttp3/internal/http2/Header;->TARGET_AUTHORITY:Lokio/ByteString;
const/16 v11, 0xb
aput-object v1, v0, v11
invoke-static {v0}, Lokhttp3/internal/Util;->immutableList([Ljava/lang/Object;)Ljava/util/List;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->HTTP_2_SKIPPED_REQUEST_HEADERS:Ljava/util/List;
.line 78
new-array v0, v10, [Lokio/ByteString;
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->CONNECTION:Lokio/ByteString;
aput-object v1, v0, v2
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->HOST:Lokio/ByteString;
aput-object v1, v0, v3
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->KEEP_ALIVE:Lokio/ByteString;
aput-object v1, v0, v4
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->PROXY_CONNECTION:Lokio/ByteString;
aput-object v1, v0, v5
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->TE:Lokio/ByteString;
aput-object v1, v0, v6
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->TRANSFER_ENCODING:Lokio/ByteString;
aput-object v1, v0, v7
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->ENCODING:Lokio/ByteString;
aput-object v1, v0, v8
sget-object v1, Lokhttp3/internal/http2/Http2Codec;->UPGRADE:Lokio/ByteString;
aput-object v1, v0, v9
invoke-static {v0}, Lokhttp3/internal/Util;->immutableList([Ljava/lang/Object;)Ljava/util/List;
move-result-object v0
sput-object v0, Lokhttp3/internal/http2/Http2Codec;->HTTP_2_SKIPPED_RESPONSE_HEADERS:Ljava/util/List;
return-void
.end method
.method public constructor <init>(Lokhttp3/OkHttpClient;Lokhttp3/Interceptor$Chain;Lokhttp3/internal/connection/StreamAllocation;Lokhttp3/internal/http2/Http2Connection;)V
.locals 0
.line 95
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 96
iput-object p1, p0, Lokhttp3/internal/http2/Http2Codec;->client:Lokhttp3/OkHttpClient;
.line 97
iput-object p2, p0, Lokhttp3/internal/http2/Http2Codec;->chain:Lokhttp3/Interceptor$Chain;
.line 98
iput-object p3, p0, Lokhttp3/internal/http2/Http2Codec;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
.line 99
iput-object p4, p0, Lokhttp3/internal/http2/Http2Codec;->connection:Lokhttp3/internal/http2/Http2Connection;
return-void
.end method
.method public static http2HeadersList(Lokhttp3/Request;)Ljava/util/List;
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lokhttp3/Request;",
")",
"Ljava/util/List<",
"Lokhttp3/internal/http2/Header;",
">;"
}
.end annotation
.line 134
invoke-virtual {p0}, Lokhttp3/Request;->headers()Lokhttp3/Headers;
move-result-object v0
.line 135
new-instance v1, Ljava/util/ArrayList;
invoke-virtual {v0}, Lokhttp3/Headers;->size()I
move-result v2
add-int/lit8 v2, v2, 0x4
invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(I)V
.line 136
new-instance v2, Lokhttp3/internal/http2/Header;
sget-object v3, Lokhttp3/internal/http2/Header;->TARGET_METHOD:Lokio/ByteString;
invoke-virtual {p0}, Lokhttp3/Request;->method()Ljava/lang/String;
move-result-object v4
invoke-direct {v2, v3, v4}, Lokhttp3/internal/http2/Header;-><init>(Lokio/ByteString;Ljava/lang/String;)V
invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 137
new-instance v2, Lokhttp3/internal/http2/Header;
sget-object v3, Lokhttp3/internal/http2/Header;->TARGET_PATH:Lokio/ByteString;
invoke-virtual {p0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
move-result-object v4
invoke-static {v4}, Lokhttp3/internal/http/RequestLine;->requestPath(Lokhttp3/HttpUrl;)Ljava/lang/String;
move-result-object v4
invoke-direct {v2, v3, v4}, Lokhttp3/internal/http2/Header;-><init>(Lokio/ByteString;Ljava/lang/String;)V
invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
const-string v2, "Host"
.line 138
invoke-virtual {p0, v2}, Lokhttp3/Request;->header(Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
if-eqz v2, :cond_0
.line 140
new-instance v3, Lokhttp3/internal/http2/Header;
sget-object v4, Lokhttp3/internal/http2/Header;->TARGET_AUTHORITY:Lokio/ByteString;
invoke-direct {v3, v4, v2}, Lokhttp3/internal/http2/Header;-><init>(Lokio/ByteString;Ljava/lang/String;)V
invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 142
:cond_0
new-instance v2, Lokhttp3/internal/http2/Header;
sget-object v3, Lokhttp3/internal/http2/Header;->TARGET_SCHEME:Lokio/ByteString;
invoke-virtual {p0}, Lokhttp3/Request;->url()Lokhttp3/HttpUrl;
move-result-object p0
invoke-virtual {p0}, Lokhttp3/HttpUrl;->scheme()Ljava/lang/String;
move-result-object p0
invoke-direct {v2, v3, p0}, Lokhttp3/internal/http2/Header;-><init>(Lokio/ByteString;Ljava/lang/String;)V
invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
const/4 p0, 0x0
.line 144
invoke-virtual {v0}, Lokhttp3/Headers;->size()I
move-result v2
:goto_0
if-ge p0, v2, :cond_2
.line 146
invoke-virtual {v0, p0}, Lokhttp3/Headers;->name(I)Ljava/lang/String;
move-result-object v3
sget-object v4, Ljava/util/Locale;->US:Ljava/util/Locale;
invoke-virtual {v3, v4}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
move-result-object v3
invoke-static {v3}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v3
.line 147
sget-object v4, Lokhttp3/internal/http2/Http2Codec;->HTTP_2_SKIPPED_REQUEST_HEADERS:Ljava/util/List;
invoke-interface {v4, v3}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
move-result v4
if-nez v4, :cond_1
.line 148
new-instance v4, Lokhttp3/internal/http2/Header;
invoke-virtual {v0, p0}, Lokhttp3/Headers;->value(I)Ljava/lang/String;
move-result-object v5
invoke-direct {v4, v3, v5}, Lokhttp3/internal/http2/Header;-><init>(Lokio/ByteString;Ljava/lang/String;)V
invoke-interface {v1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
:cond_1
add-int/lit8 p0, p0, 0x1
goto :goto_0
:cond_2
return-object v1
.end method
.method public static readHttp2HeadersList(Ljava/util/List;)Lokhttp3/Response$Builder;
.locals 8
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Lokhttp3/internal/http2/Header;",
">;)",
"Lokhttp3/Response$Builder;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 157
new-instance v0, Lokhttp3/Headers$Builder;
invoke-direct {v0}, Lokhttp3/Headers$Builder;-><init>()V
.line 158
invoke-interface {p0}, Ljava/util/List;->size()I
move-result v1
const/4 v2, 0x0
const/4 v3, 0x0
move-object v4, v0
move-object v0, v2
:goto_0
if-ge v3, v1, :cond_3
.line 159
invoke-interface {p0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v5
check-cast v5, Lokhttp3/internal/http2/Header;
if-nez v5, :cond_0
if-eqz v0, :cond_2
.line 164
iget v5, v0, Lokhttp3/internal/http/StatusLine;->code:I
const/16 v6, 0x64
if-ne v5, v6, :cond_2
.line 166
new-instance v0, Lokhttp3/Headers$Builder;
invoke-direct {v0}, Lokhttp3/Headers$Builder;-><init>()V
move-object v4, v0
move-object v0, v2
goto :goto_1
.line 171
:cond_0
iget-object v6, v5, Lokhttp3/internal/http2/Header;->name:Lokio/ByteString;
.line 172
iget-object v5, v5, Lokhttp3/internal/http2/Header;->value:Lokio/ByteString;
invoke-virtual {v5}, Lokio/ByteString;->utf8()Ljava/lang/String;
move-result-object v5
.line 173
sget-object v7, Lokhttp3/internal/http2/Header;->RESPONSE_STATUS:Lokio/ByteString;
invoke-virtual {v6, v7}, Lokio/ByteString;->equals(Ljava/lang/Object;)Z
move-result v7
if-eqz v7, :cond_1
.line 174
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "HTTP/1.1 "
invoke-virtual {v0, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lokhttp3/internal/http/StatusLine;->parse(Ljava/lang/String;)Lokhttp3/internal/http/StatusLine;
move-result-object v0
goto :goto_1
.line 175
:cond_1
sget-object v7, Lokhttp3/internal/http2/Http2Codec;->HTTP_2_SKIPPED_RESPONSE_HEADERS:Ljava/util/List;
invoke-interface {v7, v6}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
move-result v7
if-nez v7, :cond_2
.line 176
sget-object v7, Lokhttp3/internal/Internal;->instance:Lokhttp3/internal/Internal;
invoke-virtual {v6}, Lokio/ByteString;->utf8()Ljava/lang/String;
move-result-object v6
invoke-virtual {v7, v4, v6, v5}, Lokhttp3/internal/Internal;->addLenient(Lokhttp3/Headers$Builder;Ljava/lang/String;Ljava/lang/String;)V
:cond_2
:goto_1
add-int/lit8 v3, v3, 0x1
goto :goto_0
:cond_3
if-eqz v0, :cond_4
.line 181
new-instance p0, Lokhttp3/Response$Builder;
invoke-direct {p0}, Lokhttp3/Response$Builder;-><init>()V
sget-object v1, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol;
.line 182
invoke-virtual {p0, v1}, Lokhttp3/Response$Builder;->protocol(Lokhttp3/Protocol;)Lokhttp3/Response$Builder;
move-result-object p0
iget v1, v0, Lokhttp3/internal/http/StatusLine;->code:I
.line 183
invoke-virtual {p0, v1}, Lokhttp3/Response$Builder;->code(I)Lokhttp3/Response$Builder;
move-result-object p0
iget-object v0, v0, Lokhttp3/internal/http/StatusLine;->message:Ljava/lang/String;
.line 184
invoke-virtual {p0, v0}, Lokhttp3/Response$Builder;->message(Ljava/lang/String;)Lokhttp3/Response$Builder;
move-result-object p0
.line 185
invoke-virtual {v4}, Lokhttp3/Headers$Builder;->build()Lokhttp3/Headers;
move-result-object v0
invoke-virtual {p0, v0}, Lokhttp3/Response$Builder;->headers(Lokhttp3/Headers;)Lokhttp3/Response$Builder;
move-result-object p0
return-object p0
.line 179
:cond_4
new-instance p0, Ljava/net/ProtocolException;
const-string v0, "Expected \':status\' header not present"
invoke-direct {p0, v0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
throw p0
.end method
# virtual methods
.method public cancel()V
.locals 2
.line 197
iget-object v0, p0, Lokhttp3/internal/http2/Http2Codec;->stream:Lokhttp3/internal/http2/Http2Stream;
if-eqz v0, :cond_0
sget-object v1, Lokhttp3/internal/http2/ErrorCode;->CANCEL:Lokhttp3/internal/http2/ErrorCode;
invoke-virtual {v0, v1}, Lokhttp3/internal/http2/Http2Stream;->closeLater(Lokhttp3/internal/http2/ErrorCode;)V
:cond_0
return-void
.end method
.method public createRequestBody(Lokhttp3/Request;J)Lokio/Sink;
.locals 0
.line 103
iget-object p1, p0, Lokhttp3/internal/http2/Http2Codec;->stream:Lokhttp3/internal/http2/Http2Stream;
invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Stream;->getSink()Lokio/Sink;
move-result-object p1
return-object p1
.end method
.method public finishRequest()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 121
iget-object v0, p0, Lokhttp3/internal/http2/Http2Codec;->stream:Lokhttp3/internal/http2/Http2Stream;
invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Stream;->getSink()Lokio/Sink;
move-result-object v0
invoke-interface {v0}, Lokio/Sink;->close()V
return-void
.end method
.method public flushRequest()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 117
iget-object v0, p0, Lokhttp3/internal/http2/Http2Codec;->connection:Lokhttp3/internal/http2/Http2Connection;
invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Connection;->flush()V
return-void
.end method
.method public openResponseBody(Lokhttp3/Response;)Lokhttp3/ResponseBody;
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 189
iget-object v0, p0, Lokhttp3/internal/http2/Http2Codec;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
iget-object v0, v0, Lokhttp3/internal/connection/StreamAllocation;->eventListener:Lokhttp3/EventListener;
iget-object v1, p0, Lokhttp3/internal/http2/Http2Codec;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
iget-object v1, v1, Lokhttp3/internal/connection/StreamAllocation;->call:Lokhttp3/Call;
invoke-virtual {v0, v1}, Lokhttp3/EventListener;->responseBodyStart(Lokhttp3/Call;)V
const-string v0, "Content-Type"
.line 190
invoke-virtual {p1, v0}, Lokhttp3/Response;->header(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
.line 191
invoke-static {p1}, Lokhttp3/internal/http/HttpHeaders;->contentLength(Lokhttp3/Response;)J
move-result-wide v1
.line 192
new-instance p1, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;
iget-object v3, p0, Lokhttp3/internal/http2/Http2Codec;->stream:Lokhttp3/internal/http2/Http2Stream;
invoke-virtual {v3}, Lokhttp3/internal/http2/Http2Stream;->getSource()Lokio/Source;
move-result-object v3
invoke-direct {p1, p0, v3}, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;-><init>(Lokhttp3/internal/http2/Http2Codec;Lokio/Source;)V
.line 193
new-instance v3, Lokhttp3/internal/http/RealResponseBody;
invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
move-result-object p1
invoke-direct {v3, v0, v1, v2, p1}, Lokhttp3/internal/http/RealResponseBody;-><init>(Ljava/lang/String;JLokio/BufferedSource;)V
return-object v3
.end method
.method public readResponseHeaders(Z)Lokhttp3/Response$Builder;
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 125
iget-object v0, p0, Lokhttp3/internal/http2/Http2Codec;->stream:Lokhttp3/internal/http2/Http2Stream;
invoke-virtual {v0}, Lokhttp3/internal/http2/Http2Stream;->takeResponseHeaders()Ljava/util/List;
move-result-object v0
.line 126
invoke-static {v0}, Lokhttp3/internal/http2/Http2Codec;->readHttp2HeadersList(Ljava/util/List;)Lokhttp3/Response$Builder;
move-result-object v0
if-eqz p1, :cond_0
.line 127
sget-object p1, Lokhttp3/internal/Internal;->instance:Lokhttp3/internal/Internal;
invoke-virtual {p1, v0}, Lokhttp3/internal/Internal;->code(Lokhttp3/Response$Builder;)I
move-result p1
const/16 v1, 0x64
if-ne p1, v1, :cond_0
const/4 p1, 0x0
return-object p1
:cond_0
return-object v0
.end method
.method public writeRequestHeaders(Lokhttp3/Request;)V
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 107
iget-object v0, p0, Lokhttp3/internal/http2/Http2Codec;->stream:Lokhttp3/internal/http2/Http2Stream;
if-eqz v0, :cond_0
return-void
.line 109
:cond_0
invoke-virtual {p1}, Lokhttp3/Request;->body()Lokhttp3/RequestBody;
move-result-object v0
if-eqz v0, :cond_1
const/4 v0, 0x1
goto :goto_0
:cond_1
const/4 v0, 0x0
.line 110
:goto_0
invoke-static {p1}, Lokhttp3/internal/http2/Http2Codec;->http2HeadersList(Lokhttp3/Request;)Ljava/util/List;
move-result-object p1
.line 111
iget-object v1, p0, Lokhttp3/internal/http2/Http2Codec;->connection:Lokhttp3/internal/http2/Http2Connection;
invoke-virtual {v1, p1, v0}, Lokhttp3/internal/http2/Http2Connection;->newStream(Ljava/util/List;Z)Lokhttp3/internal/http2/Http2Stream;
move-result-object p1
iput-object p1, p0, Lokhttp3/internal/http2/Http2Codec;->stream:Lokhttp3/internal/http2/Http2Stream;
.line 112
iget-object p1, p0, Lokhttp3/internal/http2/Http2Codec;->stream:Lokhttp3/internal/http2/Http2Stream;
invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Stream;->readTimeout()Lokio/Timeout;
move-result-object p1
iget-object v0, p0, Lokhttp3/internal/http2/Http2Codec;->chain:Lokhttp3/Interceptor$Chain;
invoke-interface {v0}, Lokhttp3/Interceptor$Chain;->readTimeoutMillis()I
move-result v0
int-to-long v0, v0
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p1, v0, v1, v2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
.line 113
iget-object p1, p0, Lokhttp3/internal/http2/Http2Codec;->stream:Lokhttp3/internal/http2/Http2Stream;
invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Stream;->writeTimeout()Lokio/Timeout;
move-result-object p1
iget-object v0, p0, Lokhttp3/internal/http2/Http2Codec;->chain:Lokhttp3/Interceptor$Chain;
invoke-interface {v0}, Lokhttp3/Interceptor$Chain;->writeTimeoutMillis()I
move-result v0
int-to-long v0, v0
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p1, v0, v1, v2}, Lokio/Timeout;->timeout(JLjava/util/concurrent/TimeUnit;)Lokio/Timeout;
return-void
.end method