Fix callback deletion in UDP transport

This commit is contained in:
caelansar 2025-04-19 01:20:17 -05:00 committed by 世界
parent 2597a68a01
commit f7cf87142f
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() conn.access.Unlock()
defer func() { defer func() {
conn.access.Lock() conn.access.Lock()
delete(conn.callbacks, messageId) delete(conn.callbacks, exMessage.Id)
conn.access.Unlock() conn.access.Unlock()
}() }()
rawMessage, err := exMessage.PackBuffer(buffer.FreeBytes()) rawMessage, err := exMessage.PackBuffer(buffer.FreeBytes())