From 65ea8ff84ced62dc7012d0c80515c598d7198aa7 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sun, 23 Nov 2014 03:01:00 -0500 Subject: [PATCH] Debug resumption connections with -debug too. Change-Id: Ib33cceed561698310f369d63de602123af146a45 Reviewed-on: https://boringssl-review.googlesource.com/2402 Reviewed-by: Adam Langley --- ssl/test/runner/runner.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/ssl/test/runner/runner.go b/ssl/test/runner/runner.go index 697437b6e..f106e60c2 100644 --- a/ssl/test/runner/runner.go +++ b/ssl/test/runner/runner.go @@ -540,6 +540,15 @@ var testCases = []testCase{ } func doExchange(test *testCase, config *Config, conn net.Conn, messageLen int, isResume bool) error { + var connDebug *recordingConn + if *flagDebug { + connDebug = &recordingConn{Conn: conn} + conn = connDebug + defer func() { + connDebug.WriteTo(os.Stdout) + }() + } + if test.protocol == dtls { conn = newPacketAdaptor(conn) if test.replayWrites { @@ -805,20 +814,10 @@ func runTest(test *testCase, buildDir string, mallocNumToFail int64) error { } } - var connDebug *recordingConn - if *flagDebug { - connDebug = &recordingConn{Conn: conn} - conn = connDebug - } - err := doExchange(test, &config, conn, test.messageLen, false /* not a resumption */) - - if *flagDebug { - connDebug.WriteTo(os.Stdout) - } - conn.Close() + if err == nil && test.resumeSession { var resumeConfig Config if test.resumeConfig != nil {