Skip to content

Commit

Permalink
Improved debug logs
Browse files Browse the repository at this point in the history
Relates to #270
  • Loading branch information
enobufs committed Dec 31, 2023
1 parent 2d16a5b commit f909a4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions association.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ func createAssociation(config Config) *Association {
retryFirstWriteError: runtime.GOOS == "linux",
}

a.log.Debugf("[%s] retryFirstWriteError=%v", a.name, a.retryFirstWriteError)

a.name = fmt.Sprintf("%p", a)

a.log.Debugf("[%s] retryFirstWriteError=%v", a.name, a.retryFirstWriteError)

// RFC 4690 Sec 7.2.1
// o The initial cwnd before DATA transmission or after a sufficiently
// long idle period MUST be set to min(4*MTU, max (2*MTU, 4380
Expand Down Expand Up @@ -615,11 +615,13 @@ func (a *Association) write(packet []byte) (int, error) {
if err != nil {
var opErr *net.OpError
if errors.As(err, &opErr) {
a.log.Debugf("write failed: op='%s' err='%s'", opErr.Op, opErr.Err.Error())
a.log.Debugf("[%s] write failed (op='%s' err='%s'). Retrying.", a.name, opErr.Op, opErr.Err.Error())
if opErr.Op == "write" && opErr.Err.Error() == "operation not permitted" {
n, err = a.netConn.Write(packet)
}
}
} else {
a.log.Debugf("[%s] initial write succeeded", a.name)
}
}
return n, err
Expand Down

0 comments on commit f909a4a

Please sign in to comment.