Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A Marshal function shouldn't change any property of the object that is being marshaled. Otherwise, Marshal() is non-thread safe and can't be called by multiple goroutines in parallel. PR #155 makes Packet.Marshal() set the Packet.Header.Padding bit when Packet.PaddingSize is non-zero; while this is preferable from the user point of view, it doesn't allow thread safety. This patch fixes the issue.
- Loading branch information