A read buffer will be reused when diam.ReadMessage() finishes. However, the byte slice in the read buffer will remain. This is because the byte slice is not copied during the decoding of AVPs.
Therefore, when trying to read diam.Message.AVP after diam.ReadMessage() has completed, a race condition occurs if the read buffer has already been reused.
Fixes #140
A read buffer will be reused when diam.ReadMessage() finishes. However, the byte slice in the read buffer will remain. This is because the byte slice is not copied during the decoding of AVPs. Therefore, when trying to read diam.Message.AVP after diam.ReadMessage() has completed, a race condition occurs if the read buffer has already been reused.
https://github.com/fiorix/go-diameter/blob/3ddd9fb50b0a96dfd0bedb87f46afdd91d66556f/diam/message.go#L67-L80