Address review comments.

This commit is contained in:
Jakub Warmuz 2015-06-30 06:13:38 +00:00
parent cebd1eee49
commit c48f6dfecf
No known key found for this signature in database
GPG Key ID: 2A7BAD3A489B52EA
1 changed files with 8 additions and 6 deletions

View File

@ -89,8 +89,10 @@ func simpleSrv(t *testing.T, token string, stopChan, waitChan chan bool, enableT
conn.Close()
}()
waitChan <- true
if enableTLS {
var listener net.Listener
if !enableTLS {
listener = conn
} else {
template := &x509.Certificate{
SerialNumber: big.NewInt(1337),
Subject: pkix.Name{
@ -116,11 +118,11 @@ func simpleSrv(t *testing.T, token string, stopChan, waitChan chan bool, enableT
Certificates: []tls.Certificate{*cert},
}
tlsListener := tls.NewListener(conn, tlsConfig)
server.Serve(tlsListener)
} else {
server.Serve(conn)
listener = tls.NewListener(conn, tlsConfig)
}
waitChan <- true
server.Serve(listener)
}
func dvsniSrv(t *testing.T, R, S []byte, stopChan, waitChan chan bool) {