Skip to content

Commit f4c9dc2

Browse files
committed
Add hash to write
1 parent 8343404 commit f4c9dc2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

peer/conn.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,15 @@ func (c *Conn) init() error {
161161
if iceCandidate == nil {
162162
return
163163
}
164-
c.opts.Logger.Debug(context.Background(), "adding local candidate")
164+
json := iceCandidate.ToJSON()
165+
c.opts.Logger.Debug(context.Background(), "writing candidate to channel",
166+
slog.F("hash", sha256.Sum224([]byte(json.Candidate))),
167+
slog.F("length", len(json.Candidate)),
168+
)
165169
select {
166170
case <-c.closed:
167171
break
168-
case c.localCandidateChannel <- iceCandidate.ToJSON():
172+
case c.localCandidateChannel <- json:
169173
}
170174
})
171175
c.rtc.OnDataChannel(func(dc *webrtc.DataChannel) {

0 commit comments

Comments
 (0)