Skip to content

Format unknown packet and SDES types as numbers - #231

Closed
RaphaelFakhri wants to merge 1 commit into
pion:mainfrom
RaphaelFakhri:fix-unknown-type-string
Closed

RaphaelFakhri wants to merge 1 commit into
pion:mainfrom
RaphaelFakhri:fix-unknown-type-string

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Description

PacketType.String and SDESType.String converted unknown values with string(p), which returns the Unicode character for that code point. PacketType(65) printed A and PacketType(0) printed a NUL byte.

Unknown values now use the same invalid value %d format as BlockTypeType.String.

Tests

  • Added TestPacketTypeString and TestSDESTypeString. Both fail without the change and pass with it.
  • go test -race ./... and golangci-lint run ./... pass.

Fixes #230

PacketType.String and SDESType.String converted unknown values with
string(p), which yields the Unicode character for that code point
instead of the number. Use the same 'invalid value' format as
BlockTypeType.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PacketType.String and SDESType.String return a raw character for unknown values

2 participants