Skip to content

Commit

Permalink
add logging output to seqs.ControlBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
soypat committed Dec 13, 2023
1 parent 918d558 commit 95290f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions control_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,8 @@ func (tcb *ControlBlock) MaxInFlightData() Size {
func (tcb *ControlBlock) SetRecvWindow(wnd Size) {
tcb.rcv.WND = wnd
}

// SetLogger sets the logger to be used by the ControlBlock.
func (tcb *ControlBlock) SetLogger(log *slog.Logger) {
tcb.log = log
}
1 change: 1 addition & 0 deletions stacks/socket_tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (sock *TCPSocket) open(state seqs.State, localPortNum uint16, iss seqs.Valu
if err != nil {
return err
}
sock.scb.SetLogger(sock.stack.logger)
sock.remoteMAC = remoteMAC
sock.remote = remoteAddr
sock.localPort = localPortNum
Expand Down

0 comments on commit 95290f8

Please sign in to comment.