Skip to content

Commit

Permalink
comments after review
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Feb 8, 2024
1 parent d4ef98b commit 4a2404a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/model/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type HandshakeTracer interface {
OnHandshakeDone(remoteAddr string)

// Trace returns an array of [HandshakeEvent]s.
// TODO -- remove the Trace() method -------------------------------
Trace() []HandshakeEvent
}

Expand Down Expand Up @@ -63,6 +64,7 @@ func (e HandshakeEventType) String() string {
}

// HandshakeEvent must implement the event annotation methods, plus json serialization.
// TODO: this is easier as a struct
type HandshakeEvent interface {
Type() HandshakeEventType
Time() time.Time
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/tracex/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (t *Tracer) OnHandshakeDone(remoteAddr string) {
func (t *Tracer) Trace() []model.HandshakeEvent {
t.mu.Lock()
defer t.mu.Unlock()
return t.events
return append([]model.HandshakeEvent{}, t.events...)
}

func logPacket(p *model.Packet, retries int, direction model.Direction) optional.Value[model.LoggedPacket] {
Expand Down

0 comments on commit 4a2404a

Please sign in to comment.