Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

data channel: do not overwrite ppid if it was successfully parsed from received data - #42

Merged
j1elo merged 1 commit into
Kurento:masterfrom
DorianScholz:master
Sep 9, 2022
Merged

j1elo merged 1 commit into
Kurento:masterfrom
DorianScholz:master

Conversation

@DorianScholz

Copy link
Copy Markdown
Contributor

What is the current behavior you want to change?

Kurento overwrites the PPID of data channel packets marking every packet to be of type "String" even when they were sent marked as "Binary".

What is the new behavior provided by this change?

This PR fixes the code that already tried to preserve the PPID of the SCTP source packet, but eventually overwrote it anyways.

How has this been tested?

A simple data channel connection from Chrome browser to Chrome browser via Kurento previously failed to receive an ArrayBuffer object, if the ArrayBuffer contains any bytes with the most significant bit set (e.g. new Uint8Array([255, 128]).buffer). This is due the PPID set by Kurento to String type, so Chrome tries to parse the data as UTF8 string, which fails.
The change of the PPID can be seen in the Chrome debug logs when run with --enable-logging --v=2: packets sent with PPID 0x35 (binary) are turned into PPID 0x33 (string).
After this fix the PPID is preserved by Kurento when sending binary or string data.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature / enhancement (non-breaking change which improves the project)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • My change requires a change to the documentation
  • My change requires a change in other repository

Checklist

  • I have read the Contribution Guidelines
  • I have added an explanation of what the changes do and why they should be included
  • I have written new tests for the changes, as applicable, and have successfully run them locally

@DorianScholz DorianScholz changed the title do not overwrite ppid if it was successfully parsed from received data data channel: do not overwrite ppid if it was successfully parsed from received data Aug 11, 2022
@j1elo
j1elo merged commit 65e0710 into Kurento:master Sep 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants