changeset 16026:361fb5404741

8169318: Dump the reproduced packet in DTLSOverDatagram.java Reviewed-by: mullan
author xuelei
date Tue, 08 Nov 2016 06:22:31 +0000
parents 762dad364838
children 60837db5d445
files test/javax/net/ssl/DTLS/DTLSOverDatagram.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/net/ssl/DTLS/DTLSOverDatagram.java	Mon Nov 07 14:36:27 2016 -0400
+++ b/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: " +