123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383 |
- .class final Lokhttp3/internal/http2/Http2Reader;
- .super Ljava/lang/Object;
- .source ""
- # interfaces
- .implements Ljava/io/Closeable;
- # annotations
- .annotation system Ldalvik/annotation/MemberClasses;
- value = {
- Lokhttp3/internal/http2/Http2Reader$Handler;,
- Lokhttp3/internal/http2/Http2Reader$ContinuationSource;
- }
- .end annotation
- # static fields
- .field static final logger:Ljava/util/logging/Logger;
- # instance fields
- .field private final client:Z
- .field private final continuation:Lokhttp3/internal/http2/Http2Reader$ContinuationSource;
- .field final hpackReader:Lokhttp3/internal/http2/Hpack$Reader;
- .field private final source:Lokio/BufferedSource;
- # direct methods
- .method static constructor <clinit>()V
- .locals 1
- const-class v0, Lokhttp3/internal/http2/Http2;
- invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
- move-result-object v0
- invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
- move-result-object v0
- sput-object v0, Lokhttp3/internal/http2/Http2Reader;->logger:Ljava/util/logging/Logger;
- return-void
- .end method
- .method constructor <init>(Lokio/BufferedSource;Z)V
- .locals 1
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- iput-object p1, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- iput-boolean p2, p0, Lokhttp3/internal/http2/Http2Reader;->client:Z
- new-instance p1, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;
- iget-object p2, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-direct {p1, p2}, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;-><init>(Lokio/BufferedSource;)V
- iput-object p1, p0, Lokhttp3/internal/http2/Http2Reader;->continuation:Lokhttp3/internal/http2/Http2Reader$ContinuationSource;
- new-instance p1, Lokhttp3/internal/http2/Hpack$Reader;
- iget-object p2, p0, Lokhttp3/internal/http2/Http2Reader;->continuation:Lokhttp3/internal/http2/Http2Reader$ContinuationSource;
- const/16 v0, 0x1000
- invoke-direct {p1, v0, p2}, Lokhttp3/internal/http2/Hpack$Reader;-><init>(ILokio/Source;)V
- iput-object p1, p0, Lokhttp3/internal/http2/Http2Reader;->hpackReader:Lokhttp3/internal/http2/Hpack$Reader;
- return-void
- .end method
- .method static lengthWithoutPadding(IBS)I
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- and-int/lit8 p1, p1, 0x8
- if-eqz p1, :cond_0
- add-int/lit8 p0, p0, -0x1
- :cond_0
- if-gt p2, p0, :cond_1
- sub-int/2addr p0, p2
- int-to-short p0, p0
- return p0
- :cond_1
- const/4 p1, 0x2
- new-array p1, p1, [Ljava/lang/Object;
- const/4 v0, 0x0
- invoke-static {p2}, Ljava/lang/Short;->valueOf(S)Ljava/lang/Short;
- move-result-object p2
- aput-object p2, p1, v0
- const/4 p2, 0x1
- invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p0
- aput-object p0, p1, p2
- const-string p0, "PROTOCOL_ERROR padding %s > remaining length %s"
- invoke-static {p0, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p0
- throw p0
- .end method
- .method private readData(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- .locals 4
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 v0, 0x0
- if-eqz p4, :cond_4
- and-int/lit8 v1, p3, 0x1
- const/4 v2, 0x1
- if-eqz v1, :cond_0
- const/4 v1, 0x1
- goto :goto_0
- :cond_0
- const/4 v1, 0x0
- :goto_0
- and-int/lit8 v3, p3, 0x20
- if-eqz v3, :cond_1
- goto :goto_1
- :cond_1
- const/4 v2, 0x0
- :goto_1
- if-nez v2, :cond_3
- and-int/lit8 v2, p3, 0x8
- if-eqz v2, :cond_2
- iget-object v0, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v0}, Lokio/BufferedSource;->readByte()B
- move-result v0
- and-int/lit16 v0, v0, 0xff
- int-to-short v0, v0
- :cond_2
- invoke-static {p2, p3, v0}, Lokhttp3/internal/http2/Http2Reader;->lengthWithoutPadding(IBS)I
- move-result p2
- iget-object p3, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {p1, v1, p4, p3, p2}, Lokhttp3/internal/http2/Http2Reader$Handler;->data(ZILokio/BufferedSource;I)V
- iget-object p1, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- int-to-long p2, v0
- invoke-interface {p1, p2, p3}, Lokio/BufferedSource;->skip(J)V
- return-void
- :cond_3
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "PROTOCOL_ERROR: FLAG_COMPRESSED without SETTINGS_COMPRESS_DATA"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_4
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "PROTOCOL_ERROR: TYPE_DATA streamId == 0"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- .end method
- .method private readGoAway(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 p3, 0x1
- const/16 v0, 0x8
- const/4 v1, 0x0
- if-lt p2, v0, :cond_3
- if-nez p4, :cond_2
- iget-object p4, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {p4}, Lokio/BufferedSource;->readInt()I
- move-result p4
- iget-object v2, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v2}, Lokio/BufferedSource;->readInt()I
- move-result v2
- sub-int/2addr p2, v0
- invoke-static {v2}, Lokhttp3/internal/http2/ErrorCode;->fromHttp2(I)Lokhttp3/internal/http2/ErrorCode;
- move-result-object v0
- if-eqz v0, :cond_1
- sget-object p3, Lokio/ByteString;->EMPTY:Lokio/ByteString;
- if-lez p2, :cond_0
- iget-object p3, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- int-to-long v1, p2
- invoke-interface {p3, v1, v2}, Lokio/BufferedSource;->readByteString(J)Lokio/ByteString;
- move-result-object p3
- :cond_0
- invoke-interface {p1, p4, v0, p3}, Lokhttp3/internal/http2/Http2Reader$Handler;->goAway(ILokhttp3/internal/http2/ErrorCode;Lokio/ByteString;)V
- return-void
- :cond_1
- new-array p1, p3, [Ljava/lang/Object;
- invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, v1
- const-string p2, "TYPE_GOAWAY unexpected error code: %d"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_2
- new-array p1, v1, [Ljava/lang/Object;
- const-string p2, "TYPE_GOAWAY streamId != 0"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_3
- new-array p1, p3, [Ljava/lang/Object;
- invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, v1
- const-string p2, "TYPE_GOAWAY length < 8: %s"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- .end method
- .method private readHeaderBlock(ISBI)Ljava/util/List;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(ISBI)",
- "Ljava/util/List<",
- "Lokhttp3/internal/http2/Header;",
- ">;"
- }
- .end annotation
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/http2/Http2Reader;->continuation:Lokhttp3/internal/http2/Http2Reader$ContinuationSource;
- iput p1, v0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->left:I
- iput p1, v0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->length:I
- iput-short p2, v0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->padding:S
- iput-byte p3, v0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->flags:B
- iput p4, v0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->streamId:I
- iget-object p1, p0, Lokhttp3/internal/http2/Http2Reader;->hpackReader:Lokhttp3/internal/http2/Hpack$Reader;
- invoke-virtual {p1}, Lokhttp3/internal/http2/Hpack$Reader;->readHeaders()V
- iget-object p1, p0, Lokhttp3/internal/http2/Http2Reader;->hpackReader:Lokhttp3/internal/http2/Hpack$Reader;
- invoke-virtual {p1}, Lokhttp3/internal/http2/Hpack$Reader;->getAndResetHeaderList()Ljava/util/List;
- move-result-object p1
- return-object p1
- .end method
- .method private readHeaders(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 v0, 0x0
- if-eqz p4, :cond_3
- and-int/lit8 v1, p3, 0x1
- if-eqz v1, :cond_0
- const/4 v1, 0x1
- goto :goto_0
- :cond_0
- const/4 v1, 0x0
- :goto_0
- and-int/lit8 v2, p3, 0x8
- if-eqz v2, :cond_1
- iget-object v0, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v0}, Lokio/BufferedSource;->readByte()B
- move-result v0
- and-int/lit16 v0, v0, 0xff
- int-to-short v0, v0
- :cond_1
- and-int/lit8 v2, p3, 0x20
- if-eqz v2, :cond_2
- invoke-direct {p0, p1, p4}, Lokhttp3/internal/http2/Http2Reader;->readPriority(Lokhttp3/internal/http2/Http2Reader$Handler;I)V
- add-int/lit8 p2, p2, -0x5
- :cond_2
- invoke-static {p2, p3, v0}, Lokhttp3/internal/http2/Http2Reader;->lengthWithoutPadding(IBS)I
- move-result p2
- invoke-direct {p0, p2, v0, p3, p4}, Lokhttp3/internal/http2/Http2Reader;->readHeaderBlock(ISBI)Ljava/util/List;
- move-result-object p2
- const/4 p3, -0x1
- invoke-interface {p1, v1, p4, p3, p2}, Lokhttp3/internal/http2/Http2Reader$Handler;->headers(ZIILjava/util/List;)V
- return-void
- :cond_3
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "PROTOCOL_ERROR: TYPE_HEADERS streamId == 0"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- .end method
- .method static readMedium(Lokio/BufferedSource;)I
- .locals 2
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- invoke-interface {p0}, Lokio/BufferedSource;->readByte()B
- move-result v0
- and-int/lit16 v0, v0, 0xff
- shl-int/lit8 v0, v0, 0x10
- invoke-interface {p0}, Lokio/BufferedSource;->readByte()B
- move-result v1
- and-int/lit16 v1, v1, 0xff
- shl-int/lit8 v1, v1, 0x8
- or-int/2addr v0, v1
- invoke-interface {p0}, Lokio/BufferedSource;->readByte()B
- move-result p0
- and-int/lit16 p0, p0, 0xff
- or-int/2addr p0, v0
- return p0
- .end method
- .method private readPing(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 v0, 0x0
- const/4 v1, 0x1
- const/16 v2, 0x8
- if-ne p2, v2, :cond_2
- if-nez p4, :cond_1
- iget-object p2, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {p2}, Lokio/BufferedSource;->readInt()I
- move-result p2
- iget-object p4, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {p4}, Lokio/BufferedSource;->readInt()I
- move-result p4
- and-int/2addr p3, v1
- if-eqz p3, :cond_0
- const/4 v0, 0x1
- :cond_0
- invoke-interface {p1, v0, p2, p4}, Lokhttp3/internal/http2/Http2Reader$Handler;->ping(ZII)V
- return-void
- :cond_1
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "TYPE_PING streamId != 0"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_2
- new-array p1, v1, [Ljava/lang/Object;
- invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, v0
- const-string p2, "TYPE_PING length != 8: %s"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- .end method
- .method private readPriority(Lokhttp3/internal/http2/Http2Reader$Handler;I)V
- .locals 4
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v0}, Lokio/BufferedSource;->readInt()I
- move-result v0
- const/high16 v1, -0x80000000
- and-int/2addr v1, v0
- const/4 v2, 0x1
- if-eqz v1, :cond_0
- const/4 v1, 0x1
- goto :goto_0
- :cond_0
- const/4 v1, 0x0
- :goto_0
- const v3, 0x7fffffff
- and-int/2addr v0, v3
- iget-object v3, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v3}, Lokio/BufferedSource;->readByte()B
- move-result v3
- and-int/lit16 v3, v3, 0xff
- add-int/2addr v3, v2
- invoke-interface {p1, p2, v0, v3, v1}, Lokhttp3/internal/http2/Http2Reader$Handler;->priority(IIIZ)V
- return-void
- .end method
- .method private readPriority(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 p3, 0x0
- const/4 v0, 0x5
- if-ne p2, v0, :cond_1
- if-eqz p4, :cond_0
- invoke-direct {p0, p1, p4}, Lokhttp3/internal/http2/Http2Reader;->readPriority(Lokhttp3/internal/http2/Http2Reader$Handler;I)V
- return-void
- :cond_0
- new-array p1, p3, [Ljava/lang/Object;
- const-string p2, "TYPE_PRIORITY streamId == 0"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_1
- const/4 p1, 0x1
- new-array p1, p1, [Ljava/lang/Object;
- invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, p3
- const-string p2, "TYPE_PRIORITY length: %d != 5"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- .end method
- .method private readPushPromise(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 v0, 0x0
- if-eqz p4, :cond_1
- and-int/lit8 v1, p3, 0x8
- if-eqz v1, :cond_0
- iget-object v0, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v0}, Lokio/BufferedSource;->readByte()B
- move-result v0
- and-int/lit16 v0, v0, 0xff
- int-to-short v0, v0
- :cond_0
- iget-object v1, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v1}, Lokio/BufferedSource;->readInt()I
- move-result v1
- const v2, 0x7fffffff
- and-int/2addr v1, v2
- add-int/lit8 p2, p2, -0x4
- invoke-static {p2, p3, v0}, Lokhttp3/internal/http2/Http2Reader;->lengthWithoutPadding(IBS)I
- move-result p2
- invoke-direct {p0, p2, v0, p3, p4}, Lokhttp3/internal/http2/Http2Reader;->readHeaderBlock(ISBI)Ljava/util/List;
- move-result-object p2
- invoke-interface {p1, p4, v1, p2}, Lokhttp3/internal/http2/Http2Reader$Handler;->pushPromise(IILjava/util/List;)V
- return-void
- :cond_1
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "PROTOCOL_ERROR: TYPE_PUSH_PROMISE streamId == 0"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- .end method
- .method private readRstStream(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- .locals 2
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 p3, 0x1
- const/4 v0, 0x0
- const/4 v1, 0x4
- if-ne p2, v1, :cond_2
- if-eqz p4, :cond_1
- iget-object p2, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {p2}, Lokio/BufferedSource;->readInt()I
- move-result p2
- invoke-static {p2}, Lokhttp3/internal/http2/ErrorCode;->fromHttp2(I)Lokhttp3/internal/http2/ErrorCode;
- move-result-object v1
- if-eqz v1, :cond_0
- invoke-interface {p1, p4, v1}, Lokhttp3/internal/http2/Http2Reader$Handler;->rstStream(ILokhttp3/internal/http2/ErrorCode;)V
- return-void
- :cond_0
- new-array p1, p3, [Ljava/lang/Object;
- invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, v0
- const-string p2, "TYPE_RST_STREAM unexpected error code: %d"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_1
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "TYPE_RST_STREAM streamId == 0"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_2
- new-array p1, p3, [Ljava/lang/Object;
- invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, v0
- const-string p2, "TYPE_RST_STREAM length: %d != 4"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- .end method
- .method private readSettings(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- .locals 5
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 v0, 0x0
- if-nez p4, :cond_8
- const/4 p4, 0x1
- and-int/2addr p3, p4
- if-eqz p3, :cond_1
- if-nez p2, :cond_0
- invoke-interface {p1}, Lokhttp3/internal/http2/Http2Reader$Handler;->ackSettings()V
- return-void
- :cond_0
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "FRAME_SIZE_ERROR ack frame should be empty!"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_1
- rem-int/lit8 p3, p2, 0x6
- if-nez p3, :cond_7
- new-instance p3, Lokhttp3/internal/http2/Settings;
- invoke-direct {p3}, Lokhttp3/internal/http2/Settings;-><init>()V
- const/4 v1, 0x0
- :goto_0
- if-ge v1, p2, :cond_6
- iget-object v2, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v2}, Lokio/BufferedSource;->readShort()S
- move-result v2
- iget-object v3, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v3}, Lokio/BufferedSource;->readInt()I
- move-result v3
- packed-switch v2, :pswitch_data_0
- goto :goto_1
- :pswitch_0
- const/16 v4, 0x4000
- if-lt v3, v4, :cond_2
- const v4, 0xffffff
- if-gt v3, v4, :cond_2
- goto :goto_1
- :cond_2
- new-array p1, p4, [Ljava/lang/Object;
- invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, v0
- const-string p2, "PROTOCOL_ERROR SETTINGS_MAX_FRAME_SIZE: %s"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :pswitch_1
- const/4 v2, 0x7
- if-ltz v3, :cond_3
- goto :goto_1
- :cond_3
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "PROTOCOL_ERROR SETTINGS_INITIAL_WINDOW_SIZE > 2^31 - 1"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :pswitch_2
- const/4 v2, 0x4
- goto :goto_1
- :pswitch_3
- if-eqz v3, :cond_5
- if-ne v3, p4, :cond_4
- goto :goto_1
- :cond_4
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "PROTOCOL_ERROR SETTINGS_ENABLE_PUSH != 0 or 1"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_5
- :goto_1
- :pswitch_4
- invoke-virtual {p3, v2, v3}, Lokhttp3/internal/http2/Settings;->set(II)Lokhttp3/internal/http2/Settings;
- add-int/lit8 v1, v1, 0x6
- goto :goto_0
- :cond_6
- invoke-interface {p1, v0, p3}, Lokhttp3/internal/http2/Http2Reader$Handler;->settings(ZLokhttp3/internal/http2/Settings;)V
- return-void
- :cond_7
- new-array p1, p4, [Ljava/lang/Object;
- invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, v0
- const-string p2, "TYPE_SETTINGS length %% 6 != 0: %s"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_8
- new-array p1, v0, [Ljava/lang/Object;
- const-string p2, "TYPE_SETTINGS streamId != 0"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- goto :goto_3
- :goto_2
- throw p1
- :goto_3
- goto :goto_2
- :pswitch_data_0
- .packed-switch 0x1
- :pswitch_4
- :pswitch_3
- :pswitch_2
- :pswitch_1
- :pswitch_0
- :pswitch_4
- .end packed-switch
- .end method
- .method private readWindowUpdate(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- .locals 5
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 p3, 0x0
- const/4 v0, 0x1
- const/4 v1, 0x4
- if-ne p2, v1, :cond_1
- iget-object p2, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {p2}, Lokio/BufferedSource;->readInt()I
- move-result p2
- int-to-long v1, p2
- const-wide/32 v3, 0x7fffffff
- and-long/2addr v1, v3
- const-wide/16 v3, 0x0
- cmp-long p2, v1, v3
- if-eqz p2, :cond_0
- invoke-interface {p1, p4, v1, v2}, Lokhttp3/internal/http2/Http2Reader$Handler;->windowUpdate(IJ)V
- return-void
- :cond_0
- new-array p1, v0, [Ljava/lang/Object;
- invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
- move-result-object p2
- aput-object p2, p1, p3
- const-string p2, "windowSizeIncrement was 0"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_1
- new-array p1, v0, [Ljava/lang/Object;
- invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, p3
- const-string p2, "TYPE_WINDOW_UPDATE length !=4: %s"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- .end method
- # virtual methods
- .method public close()V
- .locals 1
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v0}, Lokio/Source;->close()V
- return-void
- .end method
- .method public nextFrame(ZLokhttp3/internal/http2/Http2Reader$Handler;)Z
- .locals 6
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- const/4 v0, 0x0
- :try_start_0
- iget-object v1, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- const-wide/16 v2, 0x9
- invoke-interface {v1, v2, v3}, Lokio/BufferedSource;->require(J)V
- :try_end_0
- .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
- iget-object v1, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-static {v1}, Lokhttp3/internal/http2/Http2Reader;->readMedium(Lokio/BufferedSource;)I
- move-result v1
- const/4 v2, 0x1
- if-ltz v1, :cond_3
- const/16 v3, 0x4000
- if-gt v1, v3, :cond_3
- iget-object v3, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v3}, Lokio/BufferedSource;->readByte()B
- move-result v3
- and-int/lit16 v3, v3, 0xff
- int-to-byte v3, v3
- if-eqz p1, :cond_1
- const/4 p1, 0x4
- if-ne v3, p1, :cond_0
- goto :goto_0
- :cond_0
- new-array p1, v2, [Ljava/lang/Object;
- invoke-static {v3}, Ljava/lang/Byte;->valueOf(B)Ljava/lang/Byte;
- move-result-object p2
- aput-object p2, p1, v0
- const-string p2, "Expected a SETTINGS frame but was %s"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_1
- :goto_0
- iget-object p1, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {p1}, Lokio/BufferedSource;->readByte()B
- move-result p1
- and-int/lit16 p1, p1, 0xff
- int-to-byte p1, p1
- iget-object v0, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- invoke-interface {v0}, Lokio/BufferedSource;->readInt()I
- move-result v0
- const v4, 0x7fffffff
- and-int/2addr v0, v4
- sget-object v4, Lokhttp3/internal/http2/Http2Reader;->logger:Ljava/util/logging/Logger;
- sget-object v5, Ljava/util/logging/Level;->FINE:Ljava/util/logging/Level;
- invoke-virtual {v4, v5}, Ljava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z
- move-result v4
- if-eqz v4, :cond_2
- sget-object v4, Lokhttp3/internal/http2/Http2Reader;->logger:Ljava/util/logging/Logger;
- invoke-static {v2, v0, v1, v3, p1}, Lokhttp3/internal/http2/Http2;->frameLog(ZIIBB)Ljava/lang/String;
- move-result-object v5
- invoke-virtual {v4, v5}, Ljava/util/logging/Logger;->fine(Ljava/lang/String;)V
- :cond_2
- packed-switch v3, :pswitch_data_0
- iget-object p1, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- int-to-long v0, v1
- invoke-interface {p1, v0, v1}, Lokio/BufferedSource;->skip(J)V
- goto :goto_1
- :pswitch_0
- invoke-direct {p0, p2, v1, p1, v0}, Lokhttp3/internal/http2/Http2Reader;->readWindowUpdate(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- goto :goto_1
- :pswitch_1
- invoke-direct {p0, p2, v1, p1, v0}, Lokhttp3/internal/http2/Http2Reader;->readGoAway(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- goto :goto_1
- :pswitch_2
- invoke-direct {p0, p2, v1, p1, v0}, Lokhttp3/internal/http2/Http2Reader;->readPing(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- goto :goto_1
- :pswitch_3
- invoke-direct {p0, p2, v1, p1, v0}, Lokhttp3/internal/http2/Http2Reader;->readPushPromise(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- goto :goto_1
- :pswitch_4
- invoke-direct {p0, p2, v1, p1, v0}, Lokhttp3/internal/http2/Http2Reader;->readSettings(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- goto :goto_1
- :pswitch_5
- invoke-direct {p0, p2, v1, p1, v0}, Lokhttp3/internal/http2/Http2Reader;->readRstStream(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- goto :goto_1
- :pswitch_6
- invoke-direct {p0, p2, v1, p1, v0}, Lokhttp3/internal/http2/Http2Reader;->readPriority(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- goto :goto_1
- :pswitch_7
- invoke-direct {p0, p2, v1, p1, v0}, Lokhttp3/internal/http2/Http2Reader;->readHeaders(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- goto :goto_1
- :pswitch_8
- invoke-direct {p0, p2, v1, p1, v0}, Lokhttp3/internal/http2/Http2Reader;->readData(Lokhttp3/internal/http2/Http2Reader$Handler;IBI)V
- :goto_1
- return v2
- :cond_3
- new-array p1, v2, [Ljava/lang/Object;
- invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
- move-result-object p2
- aput-object p2, p1, v0
- const-string p2, "FRAME_SIZE_ERROR: %s"
- invoke-static {p2, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :catch_0
- return v0
- nop
- :pswitch_data_0
- .packed-switch 0x0
- :pswitch_8
- :pswitch_7
- :pswitch_6
- :pswitch_5
- :pswitch_4
- :pswitch_3
- :pswitch_2
- :pswitch_1
- :pswitch_0
- .end packed-switch
- .end method
- .method public readConnectionPreface(Lokhttp3/internal/http2/Http2Reader$Handler;)V
- .locals 5
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-boolean v0, p0, Lokhttp3/internal/http2/Http2Reader;->client:Z
- const/4 v1, 0x0
- const/4 v2, 0x1
- if-eqz v0, :cond_1
- invoke-virtual {p0, v2, p1}, Lokhttp3/internal/http2/Http2Reader;->nextFrame(ZLokhttp3/internal/http2/Http2Reader$Handler;)Z
- move-result p1
- if-eqz p1, :cond_0
- goto :goto_0
- :cond_0
- new-array p1, v1, [Ljava/lang/Object;
- const-string v0, "Required SETTINGS preface not received"
- invoke-static {v0, p1}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- :cond_1
- iget-object p1, p0, Lokhttp3/internal/http2/Http2Reader;->source:Lokio/BufferedSource;
- sget-object v0, Lokhttp3/internal/http2/Http2;->CONNECTION_PREFACE:Lokio/ByteString;
- invoke-virtual {v0}, Lokio/ByteString;->size()I
- move-result v0
- int-to-long v3, v0
- invoke-interface {p1, v3, v4}, Lokio/BufferedSource;->readByteString(J)Lokio/ByteString;
- move-result-object p1
- sget-object v0, Lokhttp3/internal/http2/Http2Reader;->logger:Ljava/util/logging/Logger;
- sget-object v3, Ljava/util/logging/Level;->FINE:Ljava/util/logging/Level;
- invoke-virtual {v0, v3}, Ljava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z
- move-result v0
- if-eqz v0, :cond_2
- sget-object v0, Lokhttp3/internal/http2/Http2Reader;->logger:Ljava/util/logging/Logger;
- new-array v3, v2, [Ljava/lang/Object;
- invoke-virtual {p1}, Lokio/ByteString;->hex()Ljava/lang/String;
- move-result-object v4
- aput-object v4, v3, v1
- const-string v4, "<< CONNECTION %s"
- invoke-static {v4, v3}, Lokhttp3/internal/Util;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
- move-result-object v3
- invoke-virtual {v0, v3}, Ljava/util/logging/Logger;->fine(Ljava/lang/String;)V
- :cond_2
- sget-object v0, Lokhttp3/internal/http2/Http2;->CONNECTION_PREFACE:Lokio/ByteString;
- invoke-virtual {v0, p1}, Lokio/ByteString;->equals(Ljava/lang/Object;)Z
- move-result v0
- if-eqz v0, :cond_3
- :goto_0
- return-void
- :cond_3
- new-array v0, v2, [Ljava/lang/Object;
- invoke-virtual {p1}, Lokio/ByteString;->utf8()Ljava/lang/String;
- move-result-object p1
- aput-object p1, v0, v1
- const-string p1, "Expected a connection header but was %s"
- invoke-static {p1, v0}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
- move-result-object p1
- throw p1
- .end method
|