mirror of https://github.com/grpc/grpc-java.git
okhttp: Make implicit cast explicit to declare it safe
This commit is contained in:
parent
cf0e161bd6
commit
3fc8163fbd
|
|
@ -282,7 +282,9 @@ class OkHttpClientStream extends AbstractClientStream2 {
|
||||||
*/
|
*/
|
||||||
@GuardedBy("lock")
|
@GuardedBy("lock")
|
||||||
public void transportDataReceived(okio.Buffer frame, boolean endOfStream) {
|
public void transportDataReceived(okio.Buffer frame, boolean endOfStream) {
|
||||||
long length = frame.size();
|
// We only support 16 KiB frames, and the max permitted in HTTP/2 is 16 MiB. This is verified
|
||||||
|
// in OkHttp's Http2 deframer. In addition, this code is after the data has been read.
|
||||||
|
int length = (int) frame.size();
|
||||||
window -= length;
|
window -= length;
|
||||||
if (window < 0) {
|
if (window < 0) {
|
||||||
frameWriter.rstStream(id(), ErrorCode.FLOW_CONTROL_ERROR);
|
frameWriter.rstStream(id(), ErrorCode.FLOW_CONTROL_ERROR);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue