Checkpoint

This commit is contained in:
2025-10-06 22:25:23 +02:00
parent a23259cfdc
commit a254b306f2
48 changed files with 3327 additions and 212 deletions

View File

@@ -8,6 +8,8 @@ import (
"sync/atomic"
"syscall"
"time"
"git.maze.io/maze/styx/logger"
)
// BufferedConn uses byte buffers for Read and Write operations on a [net.Conn].
@@ -123,10 +125,13 @@ type AcceptOnce struct {
}
func (listener *AcceptOnce) Accept() (net.Conn, error) {
log := logger.StandardLog.Value("client", listener.Conn.RemoteAddr().String())
if listener.once.Load() {
log.Trace("Accept already happened, responding EOF")
return nil, io.EOF
}
listener.once.Store(true)
log.Trace("Accept client")
return listener.Conn, nil
}