8169318: Dump the reproduced packet in DTLSOverDatagram.java
authorxuelei
Tue, 08 Nov 2016 06:22:31 +0000
changeset 41954 0e306fadaf5f
parent 41953 3e89e6103470
child 41955 6a6fd4af5236
8169318: Dump the reproduced packet in DTLSOverDatagram.java Reviewed-by: mullan
jdk/test/javax/net/ssl/DTLS/DTLSOverDatagram.java
--- a/jdk/test/javax/net/ssl/DTLS/DTLSOverDatagram.java	Mon Nov 07 14:36:27 2016 -0400
+++ b/jdk/test/javax/net/ssl/DTLS/DTLSOverDatagram.java	Tue Nov 08 06:22:31 2016 +0000
@@ -176,7 +176,10 @@
                         boolean finished = onReceiveTimeout(
                                 engine, peerAddr, side, packets);
 
+                        log(side, "Reproduced " + packets.size() + " packets");
                         for (DatagramPacket p : packets) {
+                            printHex("Reproduced packet",
+                                p.getData(), p.getOffset(), p.getLength());
                             socket.send(p);
                         }
 
@@ -334,7 +337,7 @@
             String side, List<DatagramPacket> packets) throws Exception {
 
         boolean endLoops = false;
-        int loops = MAX_HANDSHAKE_LOOPS;
+        int loops = MAX_HANDSHAKE_LOOPS / 2;
         while (!endLoops &&
                 (serverException == null) && (clientException == null)) {
 
@@ -350,7 +353,8 @@
 
             SSLEngineResult.Status rs = r.getStatus();
             SSLEngineResult.HandshakeStatus hs = r.getHandshakeStatus();
-            log(side, "====packet(" + loops + ", " + rs + ", " + hs + ")====");
+            log(side, "----produce handshake packet(" +
+                    loops + ", " + rs + ", " + hs + ")----");
             if (rs == SSLEngineResult.Status.BUFFER_OVERFLOW) {
                 // the client maximum fragment size config does not work?
                 throw new Exception("Buffer overflow: " +