fix: отбрасывать опоздавший повтор client id, общий backoff квоты

This commit is contained in:
samosvalishe committed 2026-09-22 00:43:06 +03:00
1 parent 1e3782c546
commit 05bbe996c1
5 files changed
+12 -12

No files matched your search

+2 -4
View File
@@ -295,15 +295,13 @@ func AcceptClientID(conn net.Conn, authorize func(id string, mode byte) error) (
type ackedConn struct {
net.Conn
rec []byte
data bool
rec []byte
}
func (c *ackedConn) Read(b []byte) (int, error) {
for {
n, err := c.Conn.Read(b)
if err != nil || c.data || !bytes.Equal(b[:n], c.rec) {
c.data = c.data || err == nil
if err != nil || !bytes.Equal(b[:n], c.rec) {
return n, err
}
if _, err := c.Write([]byte{idAck}); err != nil {