Http1Codec$AbstractSource.smali 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. .class abstract Lokhttp3/internal/http1/Http1Codec$AbstractSource;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Lokio/Source;
  6. # annotations
  7. .annotation system Ldalvik/annotation/EnclosingClass;
  8. value = Lokhttp3/internal/http1/Http1Codec;
  9. .end annotation
  10. .annotation system Ldalvik/annotation/InnerClass;
  11. accessFlags = 0x402
  12. name = "AbstractSource"
  13. .end annotation
  14. # instance fields
  15. .field protected bytesRead:J
  16. .field protected closed:Z
  17. .field final synthetic this$0:Lokhttp3/internal/http1/Http1Codec;
  18. .field protected final timeout:Lokio/ForwardingTimeout;
  19. # direct methods
  20. .method private constructor <init>(Lokhttp3/internal/http1/Http1Codec;)V
  21. .locals 2
  22. iput-object p1, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->this$0:Lokhttp3/internal/http1/Http1Codec;
  23. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  24. new-instance p1, Lokio/ForwardingTimeout;
  25. iget-object v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->this$0:Lokhttp3/internal/http1/Http1Codec;
  26. iget-object v0, v0, Lokhttp3/internal/http1/Http1Codec;->source:Lokio/BufferedSource;
  27. invoke-interface {v0}, Lokio/Source;->timeout()Lokio/Timeout;
  28. move-result-object v0
  29. invoke-direct {p1, v0}, Lokio/ForwardingTimeout;-><init>(Lokio/Timeout;)V
  30. iput-object p1, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->timeout:Lokio/ForwardingTimeout;
  31. const-wide/16 v0, 0x0
  32. iput-wide v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->bytesRead:J
  33. return-void
  34. .end method
  35. .method synthetic constructor <init>(Lokhttp3/internal/http1/Http1Codec;Lokhttp3/internal/http1/Http1Codec$1;)V
  36. .locals 0
  37. invoke-direct {p0, p1}, Lokhttp3/internal/http1/Http1Codec$AbstractSource;-><init>(Lokhttp3/internal/http1/Http1Codec;)V
  38. return-void
  39. .end method
  40. # virtual methods
  41. .method protected final endOfInput(ZLjava/io/IOException;)V
  42. .locals 9
  43. .annotation system Ldalvik/annotation/Throws;
  44. value = {
  45. Ljava/io/IOException;
  46. }
  47. .end annotation
  48. iget-object v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->this$0:Lokhttp3/internal/http1/Http1Codec;
  49. iget v1, v0, Lokhttp3/internal/http1/Http1Codec;->state:I
  50. const/4 v2, 0x6
  51. if-ne v1, v2, :cond_0
  52. return-void
  53. :cond_0
  54. const/4 v3, 0x5
  55. if-ne v1, v3, :cond_2
  56. iget-object v1, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->timeout:Lokio/ForwardingTimeout;
  57. invoke-virtual {v0, v1}, Lokhttp3/internal/http1/Http1Codec;->detachTimeout(Lokio/ForwardingTimeout;)V
  58. iget-object v5, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->this$0:Lokhttp3/internal/http1/Http1Codec;
  59. iput v2, v5, Lokhttp3/internal/http1/Http1Codec;->state:I
  60. iget-object v3, v5, Lokhttp3/internal/http1/Http1Codec;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
  61. if-eqz v3, :cond_1
  62. xor-int/lit8 v4, p1, 0x1
  63. iget-wide v6, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->bytesRead:J
  64. move-object v8, p2
  65. invoke-virtual/range {v3 .. v8}, Lokhttp3/internal/connection/StreamAllocation;->streamFinished(ZLokhttp3/internal/http/HttpCodec;JLjava/io/IOException;)V
  66. :cond_1
  67. return-void
  68. :cond_2
  69. new-instance p1, Ljava/lang/IllegalStateException;
  70. new-instance p2, Ljava/lang/StringBuilder;
  71. invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
  72. const-string v0, "state: "
  73. invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  74. iget-object v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->this$0:Lokhttp3/internal/http1/Http1Codec;
  75. iget v0, v0, Lokhttp3/internal/http1/Http1Codec;->state:I
  76. invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  77. invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  78. move-result-object p2
  79. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  80. throw p1
  81. .end method
  82. .method public read(Lokio/Buffer;J)J
  83. .locals 2
  84. .annotation system Ldalvik/annotation/Throws;
  85. value = {
  86. Ljava/io/IOException;
  87. }
  88. .end annotation
  89. :try_start_0
  90. iget-object v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->this$0:Lokhttp3/internal/http1/Http1Codec;
  91. iget-object v0, v0, Lokhttp3/internal/http1/Http1Codec;->source:Lokio/BufferedSource;
  92. invoke-interface {v0, p1, p2, p3}, Lokio/Source;->read(Lokio/Buffer;J)J
  93. move-result-wide p1
  94. const-wide/16 v0, 0x0
  95. cmp-long p3, p1, v0
  96. if-lez p3, :cond_0
  97. iget-wide v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->bytesRead:J
  98. add-long/2addr v0, p1
  99. iput-wide v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->bytesRead:J
  100. :try_end_0
  101. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  102. :cond_0
  103. return-wide p1
  104. :catch_0
  105. move-exception p1
  106. const/4 p2, 0x0
  107. invoke-virtual {p0, p2, p1}, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->endOfInput(ZLjava/io/IOException;)V
  108. throw p1
  109. .end method
  110. .method public timeout()Lokio/Timeout;
  111. .locals 1
  112. iget-object v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->timeout:Lokio/ForwardingTimeout;
  113. return-object v0
  114. .end method