-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PaddingSize to rtp.Packet #155
Conversation
When a packet has padding, the padding size information is lost during unmarshal. Add a PaddingSize field to Packet structure. Also support marshalling on an RTP packet with padding. Testing: -------- Modified/added unit tests.
Codecov Report
@@ Coverage Diff @@
## master #155 +/- ##
==========================================
+ Coverage 93.06% 93.31% +0.24%
==========================================
Files 14 14
Lines 937 942 +5
==========================================
+ Hits 872 879 +7
+ Misses 46 45 -1
+ Partials 19 18 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 pion#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.
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 pion#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.
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 pion#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.
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 pion#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.
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.
But even with marshalled packet, the plaintext will always be unmarshalled and its padding info is thrown away: both |
When a packet has padding, the padding size information
is lost during unmarshal. Add a PaddingSize field to
Packet structure.
Also support marshalling on an RTP packet with padding.
Testing:
Modified/added unit tests.