Enabled TCP Keep-Alive to Requests #1065
Merged
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.
Check if this PR fulfills these requirements:
Types of changes
Description
From research conducted by @jakermx discovered that Requests module provide Keep-Alive support thanks to urllib3 module,
but the real problem is that the Keep-Alive in the urllib3 module is not enabled by default https://urllib3.readthedocs.io/en/latest/reference/urllib3.connection.html and this is not mentioned in Requests module documentations.
By tracking network activities with Wireshark there is a clear evidence of the lack of TCP keep-alive communications,
and enable it seem definitively resolve the errors:
ConnectionError: ('Connection aborted.', error("(104, 'ECONNRESET')",))
ReadTimeout: HTTPSConnectionPool(host='www.n*****x.com', port=443): Read timed out. (read timeout=None)
Ref issues: #1004, #914
then this
(partially)nullifies the workaround of PR #1046(read below)unfortunately the embedded python on Kodi 19 for Windows has been compiled without socket.ioctl therefore is unusable,i have opened an issue xbmc/xbmc#19204 to ask to fix it and (i hope) will be included on Kodi 19.1
The fix has been merged on Kodi nightly
In case of Feature change / Breaking change:
Describe the current behavior
Describe the new behavior
Screenshots (if appropriate):