Get full response from PulseAudio server#33360
Closed
breiti wants to merge 2 commits intohome-assistant:devfrom
Closed
Get full response from PulseAudio server#33360breiti wants to merge 2 commits intohome-assistant:devfrom
breiti wants to merge 2 commits intohome-assistant:devfrom
Conversation
Contributor
For larger responses from the PulseAudio server there's a chance that recv() is called before the data has been received, leaving us with a truncated result as the remaining text to be received is silently ignored. This change makes sure that all data received until the configured tcp timeout elapses is evaluated, at the cost of making all requests that expect a result slower. Note that the result text contains information about the number of modules loaded, which should make it possible to determine when the returned text ends without waiting for the timeout. Until this is fixed, this change makes the behavior more reliable.
The response from PulseAudio server for the 'list modules' command states how many modules are loaded right at the beginning. We can use this information to detect when all modules haven been received and prevent the need to wait until the tcp timeout occurs.
MartinHjelmare
requested changes
Apr 29, 2020
Member
MartinHjelmare
left a comment
There was a problem hiding this comment.
Thanks for the PR. Unfortunately we can't accept any (big) changes to this integration until the device specific interface code has been extracted to a 3rd party library.
Contributor
Author
|
Extracting library in #34965, making this PR obsolete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
For larger responses from the PulseAudio server there's a chance that
recv()is called before the data has been received, leaving us with atruncated result as the remaining text to be received is silently
ignored.
This change makes sure that all data received until the configured tcp
timeout elapses is evaluated, at the cost of making all requests that
expect a result slower.
Note that the result text contains information about the number of
modules loaded, which should make it possible to determine when the
returned text ends without waiting for the timeout. Until this is fixed,
this changes makes the behavior more reliable.
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: