Beispiel #1
0
 private void readRstStream(Handler handler, int length, byte flags, int streamId)
     throws IOException {
   if (length != 4) throw ioException("TYPE_RST_STREAM length: %d != 4", length);
   if (streamId == 0) throw ioException("TYPE_RST_STREAM streamId == 0");
   int errorCodeInt = source.readInt();
   ErrorCode errorCode = ErrorCode.fromHttp2(errorCodeInt);
   if (errorCode == null) {
     throw ioException("TYPE_RST_STREAM unexpected error code: %d", errorCodeInt);
   }
   handler.rstStream(streamId, errorCode);
 }
Beispiel #2
0
 private void readRstStream(FrameReader.Handler paramHandler, int paramInt1, byte paramByte, int paramInt2)
 {
   if (paramInt1 != 4) {
     throw Http2.ioException("TYPE_RST_STREAM length: %d != 4", new Object[] { Integer.valueOf(paramInt1) });
   }
   if (paramInt2 == 0) {
     throw Http2.ioException("TYPE_RST_STREAM streamId == 0", new Object[0]);
   }
   paramInt1 = this.source.readInt();
   ErrorCode localErrorCode = ErrorCode.fromHttp2(paramInt1);
   if (localErrorCode == null) {
     throw Http2.ioException("TYPE_RST_STREAM unexpected error code: %d", new Object[] { Integer.valueOf(paramInt1) });
   }
   paramHandler.rstStream(paramInt2, localErrorCode);
 }
 private void readGoAway(Handler handler, int flags, int length, int streamId)
     throws IOException {
   if (length < 8) throw ioException("TYPE_GOAWAY length < 8: %s", length);
   int lastStreamId = in.readInt();
   int errorCodeInt = in.readInt();
   int opaqueDataLength = length - 8;
   ErrorCode errorCode = ErrorCode.fromHttp2(errorCodeInt);
   if (errorCode == null) {
     throw ioException("TYPE_RST_STREAM unexpected error code: %d", errorCodeInt);
   }
   if (Util.skipByReading(in, opaqueDataLength) != opaqueDataLength) {
     throw new IOException("TYPE_GOAWAY opaque data was truncated");
   }
   handler.goAway(lastStreamId, errorCode);
 }
Beispiel #4
0
 private void readGoAway(Handler handler, int length, byte flags, int streamId)
     throws IOException {
   if (length < 8) throw ioException("TYPE_GOAWAY length < 8: %s", length);
   if (streamId != 0) throw ioException("TYPE_GOAWAY streamId != 0");
   int lastStreamId = source.readInt();
   int errorCodeInt = source.readInt();
   int opaqueDataLength = length - 8;
   ErrorCode errorCode = ErrorCode.fromHttp2(errorCodeInt);
   if (errorCode == null) {
     throw ioException("TYPE_GOAWAY unexpected error code: %d", errorCodeInt);
   }
   ByteString debugData = EMPTY;
   if (opaqueDataLength > 0) { // Must read debug data in order to not corrupt the connection.
     debugData = source.readByteString(opaqueDataLength);
   }
   handler.goAway(lastStreamId, errorCode, debugData);
 }
Beispiel #5
0
 private void readGoAway(FrameReader.Handler paramHandler, int paramInt1, byte paramByte, int paramInt2)
 {
   if (paramInt1 < 8) {
     throw Http2.ioException("TYPE_GOAWAY length < 8: %s", new Object[] { Integer.valueOf(paramInt1) });
   }
   if (paramInt2 != 0) {
     throw Http2.ioException("TYPE_GOAWAY streamId != 0", new Object[0]);
   }
   paramByte = this.source.readInt();
   paramInt2 = this.source.readInt();
   paramInt1 -= 8;
   ErrorCode localErrorCode = ErrorCode.fromHttp2(paramInt2);
   if (localErrorCode == null) {
     throw Http2.ioException("TYPE_GOAWAY unexpected error code: %d", new Object[] { Integer.valueOf(paramInt2) });
   }
   uj localuj = uj.ZJ;
   if (paramInt1 > 0) {
     localuj = this.source.ᗮ(paramInt1);
   }
   paramHandler.goAway(paramByte, localErrorCode, localuj);
 }