Skip to content
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

Decrease discovery overhead #484

Closed
wants to merge 1 commit into from

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Apr 3, 2021

Attempt at reducing the discovery overhead

Before
Screen Shot 2021-04-02 at 6 26 36 PM

After -- all the time creating the ssl context is gone:

Screen Shot 2021-04-02 at 6 41 53 PM

@bdraco bdraco force-pushed the polling_overhead branch 2 times, most recently from 7921ba7 to 5063229 Compare April 3, 2021 04:31
@bdraco bdraco force-pushed the polling_overhead branch from 5063229 to 65e7d36 Compare April 3, 2021 04:37
@bdraco bdraco marked this pull request as ready for review April 3, 2021 04:49
@emontnemery
Copy link
Collaborator

emontnemery commented Apr 3, 2021

The reason for using urllib directly instead of requests is that the latter did not accept the certificates presented by some chromecasts.
Are we sure this won't be a problem?
Can't we keep the SSL session around without going back to requests?

Edit:
I misremembered the issue, the problem is that when using requests we get these unfilterable warnings in the log:

$ python3 media_example.py --cast "Lab" --known-host=192.168.0.10
/mnt/d/development/github/pychromecast_fork/venv/lib/python3.8/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.0.10'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  warnings.warn(
/mnt/d/development/github/pychromecast_fork/venv/lib/python3.8/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.0.10'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  warnings.warn(
/mnt/d/development/github/pychromecast_fork/venv/lib/python3.8/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.0.10'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  warnings.warn(

Related PRs:

The idea in the PR is great, but we should stick with urllib.

@emontnemery
Copy link
Collaborator

I attempted to reuse the SSL context in #485, does that work?

@bdraco
Copy link
Member Author

bdraco commented Apr 3, 2021

Closing in favor of #485

@bdraco bdraco closed this Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants