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