mirror of
https://github.com/renorris/openfsd
synced 2026-04-30 13:25:32 +08:00
add client timeout via net/Conn SetDeadline
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// FSD error codes
|
||||
@@ -418,3 +419,8 @@ func sendSendFastPacket(client *Client, enabled bool) {
|
||||
|
||||
client.send(builder.String())
|
||||
}
|
||||
|
||||
// getTimeBySecondsInFuture returns time.Now + seconds
|
||||
func getTimeBySecondsInFuture(seconds int) time.Time {
|
||||
return time.Now().Add(time.Duration(seconds) * time.Second)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user