Ejemplo n.º 1
0
 public boolean nextFrame(FrameReader.Handler paramHandler)
 {
   try
   {
     this.source.ᔇ(9L);
   }
   catch (IOException paramHandler)
   {
     return false;
   }
   int i = Http2.readMedium(this.source);
   if ((i < 0) || (i > 16384)) {
     throw Http2.ioException("FRAME_SIZE_ERROR: %s", new Object[] { Integer.valueOf(i) });
   }
   byte b1 = (byte)(this.source.readByte() & 0xFF);
   byte b2 = (byte)(this.source.readByte() & 0xFF);
   int j = this.source.readInt() & 0x7FFFFFFF;
   if (Http2.logger.isLoggable(Level.FINE)) {
     Http2.logger.fine(Http2.FrameLogger.formatHeader(true, j, i, b1, b2));
   }
   switch (b1)
   {
   default: 
     break;
   case 0: 
     readData(paramHandler, i, b2, j);
     break;
   case 1: 
     readHeaders(paramHandler, i, b2, j);
     break;
   case 2: 
     readPriority(paramHandler, i, b2, j);
     break;
   case 3: 
     readRstStream(paramHandler, i, b2, j);
     break;
   case 4: 
     readSettings(paramHandler, i, b2, j);
     break;
   case 5: 
     readPushPromise(paramHandler, i, b2, j);
     break;
   case 6: 
     readPing(paramHandler, i, b2, j);
     break;
   case 7: 
     readGoAway(paramHandler, i, b2, j);
     break;
   case 8: 
     readWindowUpdate(paramHandler, i, b2, j);
     break;
   }
   this.source.ᵋ(i);
   return true;
 }
Ejemplo n.º 2
0
 void frameHeader(int paramInt1, int paramInt2, byte paramByte1, byte paramByte2)
 {
   if (Http2.logger.isLoggable(Level.FINE)) {
     Http2.logger.fine(Http2.FrameLogger.formatHeader(false, paramInt1, paramInt2, paramByte1, paramByte2));
   }
   if (paramInt2 > this.maxFrameSize) {
     throw Http2.illegalArgument("FRAME_SIZE_ERROR length > %d: %d", new Object[] { Integer.valueOf(this.maxFrameSize), Integer.valueOf(paramInt2) });
   }
   if ((0x80000000 & paramInt1) != 0) {
     throw Http2.illegalArgument("reserved bit set: %s", new Object[] { Integer.valueOf(paramInt1) });
   }
   Http2.writeMedium(this.sink, paramInt2);
   this.sink.ɟ(paramByte1 & 0xFF);
   this.sink.ɟ(paramByte2 & 0xFF);
   this.sink.ǀ(0x7FFFFFFF & paramInt1);
 }
Ejemplo n.º 3
0
 private void readContinuationHeader()
 {
   int i = this.streamId;
   int j = Http2.readMedium(this.source);
   this.left = j;
   this.length = j;
   byte b = (byte)(this.source.readByte() & 0xFF);
   this.flags = ((byte)(this.source.readByte() & 0xFF));
   if (Http2.logger.isLoggable(Level.FINE)) {
     Http2.logger.fine(Http2.FrameLogger.formatHeader(true, this.streamId, this.length, b, this.flags));
   }
   this.streamId = (this.source.readInt() & 0x7FFFFFFF);
   if (b != 9) {
     throw Http2.ioException("%s != TYPE_CONTINUATION", new Object[] { Byte.valueOf(b) });
   }
   if (this.streamId != i) {
     throw Http2.ioException("TYPE_CONTINUATION streamId changed", new Object[0]);
   }
 }