src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/FramesDecoder.java
branchhttp-client-branch
changeset 56072 96c1f6e984eb
parent 56071 3353cb42b1b4
equal deleted inserted replaced
56071:3353cb42b1b4 56072:96c1f6e984eb
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package jdk.incubator.http.internal.frame;
    26 package jdk.incubator.http.internal.frame;
    27 
    27 
    28 import jdk.incubator.http.internal.common.Log;
       
    29 import jdk.incubator.http.internal.common.Utils;
       
    30 
       
    31 import java.io.IOException;
    28 import java.io.IOException;
    32 import java.lang.System.Logger.Level;
    29 import java.lang.System.Logger.Level;
    33 import java.nio.ByteBuffer;
    30 import java.nio.ByteBuffer;
    34 import java.util.ArrayDeque;
    31 import java.util.ArrayDeque;
    35 import java.util.ArrayList;
    32 import java.util.ArrayList;
    36 import java.util.List;
    33 import java.util.List;
    37 import java.util.Queue;
    34 import jdk.incubator.http.internal.common.Log;
       
    35 import jdk.incubator.http.internal.common.Utils;
       
    36 import static java.nio.charset.StandardCharsets.UTF_8;
    38 
    37 
    39 /**
    38 /**
    40  * Frames Decoder
    39  * Frames Decoder
    41  * <p>
    40  * <p>
    42  * collect buffers until frame decoding is possible,
    41  * collect buffers until frame decoding is possible,
   518         }
   517         }
   519         int lastStream = getInt() & 0x7fffffff;
   518         int lastStream = getInt() & 0x7fffffff;
   520         int errorCode = getInt();
   519         int errorCode = getInt();
   521         byte[] debugData = getBytes(frameLength - 8);
   520         byte[] debugData = getBytes(frameLength - 8);
   522         if (debugData.length > 0) {
   521         if (debugData.length > 0) {
   523             Log.logError("GoAway debugData " + new String(debugData));
   522             Log.logError("GoAway debugData " + new String(debugData, UTF_8));
   524         }
   523         }
   525         return new GoAwayFrame(lastStream, errorCode, debugData);
   524         return new GoAwayFrame(lastStream, errorCode, debugData);
   526     }
   525     }
   527 
   526 
   528     private Http2Frame parseWindowUpdateFrame(int frameLength, int streamid, int flags) {
   527     private Http2Frame parseWindowUpdateFrame(int frameLength, int streamid, int flags) {