Fix callback deletion in UDP transport

This commit is contained in:
caelansar 2025-04-19 01:20:17 -05:00 committed by 世界
parent 6632a09768
commit 2eed6d48db
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -117,7 +117,7 @@ func (t *UDPTransport) exchange(ctx context.Context, message *mDNS.Msg) (*mDNS.M
conn.access.Unlock()
defer func() {
conn.access.Lock()
delete(conn.callbacks, messageId)
delete(conn.callbacks, exMessage.Id)
conn.access.Unlock()
}()
rawMessage, err := exMessage.PackBuffer(buffer.FreeBytes())