File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -72,18 +72,11 @@ func TCPing(q *TCPingQ) (*TCPingP, error) {
72
72
for i := uint64 (0 ); i < q .Times ; i ++ {
73
73
ctx , cancel = context .WithCancel (context .Background ())
74
74
conn , err := d .DialContext (ctx , network , addr .String ())
75
- if err != nil {
76
- r .Data = append (r .Data , TCPingPEntry {
77
- Success : false ,
78
- Latency : float64 (time .Since (now )) / float64 (time .Millisecond ),
79
- })
80
- } else {
81
- r .Data = append (r .Data , TCPingPEntry {
82
- Success : true ,
83
- Latency : float64 (time .Since (now )) / float64 (time .Millisecond ),
84
- })
85
- _ = conn .Close ()
86
- }
75
+ r .Data = append (r .Data , TCPingPEntry {
76
+ Success : err == nil ,
77
+ Latency : float64 (time .Since (now )) / float64 (time .Millisecond ),
78
+ })
79
+ _ = conn .Close ()
87
80
timer .Stop ()
88
81
cancel ()
89
82
time .Sleep (time .Duration (q .Interval ) * time .Millisecond )
Original file line number Diff line number Diff line change @@ -225,6 +225,7 @@ func TLS(q *TlsQ) (*TlsP, error) {
225
225
cert := state .PeerCertificates [i - 1 ]
226
226
hash := sha256 .Sum256 (cert .Raw )
227
227
data := Certificate {
228
+ Size : len (cert .Raw ),
228
229
Subject : cert .Subject .String (),
229
230
Issuer : cert .Issuer .String (),
230
231
NotBefore : cert .NotBefore ,
Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ const (
153
153
)
154
154
155
155
type Certificate struct {
156
+ Size int `json:"size,omitempty"`
156
157
Valid bool `json:"valid"`
157
158
158
159
Subject string `json:"subject"`
You can’t perform that action at this time.
0 commit comments