cmd/quictpu/ping: logging verbosity
This commit is contained in:
parent
6787f534c7
commit
074258b45c
|
@ -68,19 +68,25 @@ func main() {
|
|||
|
||||
for c < *flagCount || *flagCount == -1 {
|
||||
t := time.Now()
|
||||
ctx, cancel := context.WithTimeout(ctx, *flagDelay)
|
||||
conn, err := quic.DialAddrContext(ctx, flag.Args()[0], tlsConf, &qconf)
|
||||
if err != nil {
|
||||
klog.Exitf("Failed to dial: %v", err)
|
||||
klog.Errorf("Failed to dial: %v", err)
|
||||
cancel()
|
||||
continue
|
||||
}
|
||||
cancel()
|
||||
|
||||
klog.Infof("Connected to %s (in %dms, %d/%d)",
|
||||
flag.Args()[0], time.Since(t).Milliseconds(),
|
||||
c+1, *flagCount)
|
||||
|
||||
if klog.V(1).Enabled() {
|
||||
for _, cert := range conn.ConnectionState().TLS.PeerCertificates {
|
||||
klog.Infof("Certificate: %s", cert.Subject)
|
||||
klog.Infof("Public key: %s", base58.Encode(cert.PublicKey.(ed25519.PublicKey)))
|
||||
}
|
||||
}
|
||||
|
||||
if err := conn.CloseWithError(0, ""); err != nil {
|
||||
klog.Exitf("Failed to close: %v", err)
|
||||
|
|
Loading…
Reference in New Issue