-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Closed
Description
gitea/modules/graceful/server.go
Lines 266 to 278 in 7bcbdd0
| func (w wrappedConn) Write(p []byte) (n int, err error) { | |
| if w.perWriteTimeout > 0 { | |
| minTimeout := time.Duration(len(p)/1024) * w.perWritePerKbTimeout | |
| minDeadline := time.Now().Add(minTimeout).Add(w.perWriteTimeout) | |
| w.deadline = w.deadline.Add(minTimeout) | |
| if minDeadline.After(w.deadline) { | |
| w.deadline = minDeadline | |
| } | |
| _ = w.Conn.SetWriteDeadline(w.deadline) | |
| } | |
| return w.Conn.Write(p) | |
| } |
The assignments to w.deadline (lines 271 and 273) have no effect outside the scope of the method ( e.g. https://play.golang.org/p/eM0ehqmH7Yj)
(Found by revive)
Metadata
Metadata
Assignees
Labels
No labels