summaryrefslogtreecommitdiff
path: root/internal/server/server.go
diff options
context:
space:
mode:
authorKyren223 <kyren223@proton.me>2025-08-05 17:01:05 +0300
committerKyren223 <kyren223@proton.me>2025-08-05 17:01:05 +0300
commit7b1ee08d61c77da12f139881631ddb94bb3e6647 (patch)
treeeb269273170a511b52b44b00a3bd35656f1a6d0f /internal/server/server.go
parent274dee5b25ed249492faeea1c0a4e33aa26cb60c (diff)
Updated todos and notes
Diffstat (limited to 'internal/server/server.go')
-rw-r--r--internal/server/server.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 9794038..bdfba15 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -362,7 +362,7 @@ func (server *server) handleConnection(conn net.Conn) {
slog.InfoContext(ctx, "processor done")
}()
- // NOTE: IMPROTANT LEGAL STUFF
+ // NOTE(kyren): IMPROTANT LEGAL STUFF
// Sending this first thing, before client sends us any data
sendTosInfo(ctx, sess)
@@ -552,15 +552,10 @@ func timeout[T packet.Payload](
apiRequest func(context.Context, *session.Session, T) packet.Payload,
ctx context.Context, sess *session.Session, request T,
) packet.Payload {
- // TODO(kyren): Remove the channel and just wait directly?
- // No - We need to use a channel so timeout works properly
+ // NOTE(kyren): We need to use a channel so timeout works properly
responseChan := make(chan packet.Payload)
- // TODO: Check if this is now fixed after the rewrite:
- // currently just ignoring the given context
- // this fixes the issue where the client disconnects so the server
- // doesn't bother and cancels the request
- ctx, cancel := context.WithTimeout(ctx, timeoutDuration) // no longer ignoring
+ ctx, cancel := context.WithTimeout(ctx, timeoutDuration)
defer cancel()
go func() {
@@ -607,7 +602,7 @@ func TokensPerRequest(requestType packet.PacketType) float64 {
case packet.PacketDeviceAnalytics:
return 0.2 // arbitrary
- // TODO: once I get more data for these, add them
+ // TODO(kyren): once I get more data for these, add them
case packet.PacketBlockUser:
case packet.PacketCreateFrequency:
case packet.PacketCreateNetwork: