cheroot
cheroot copied to clipboard
Handle `OpenSSL.SSL.WantReadError` and `WantWriteError` in pyopenssl adapter
β What kind of change does this PR introduce?
- [x] π bug fix
- [ ] π£ feature
- [ ] π docs update
- [ ] π tests/coverage improvement
- [ ] π refactoring
- [ ] π₯ other
π What is the related issue number (starting with #
)
Fixes #245
β What is the current behavior? (You can also link to an open issue here)
β What is the new behavior (if this is a feature change)?
π Other information:
π Checklist:
- [ ] I think the code is well written
- [ ] I wrote good commit messages
- [ ] I have squashed related commits together after the changes have been approved
- [ ] Unit tests for the changes exist
- [ ] Integration tests for the changes exist (if applicable)
- [ ] I used the same coding conventions as the rest of the project
- [ ] The new code doesn't generate linter offenses
- [ ] Documentation reflects the changes
- [ ] The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences
@vashek have you considered fixing pyopenssl itself? https://github.com/pyca/pyopenssl/issues/176#issuecomment-720471766
Hm... it looks like sendall
was used as write()
+ flush()
at some point but then got replaced with write
: https://github.com/cherrypy/cheroot/commit/60cd709551d564551d91a5b170c311bb23ad2ac6 / https://github.com/cherrypy/cheroot/commit/a0b1d018c912aa21473bac3f99d46018faed5563.
Some jobs are failing because of a deprecation warning in cryptography. I've fixed that on master
. To get the changes, rebase this PR branch.
Do you think this can be tested somehow?
@vashek so what do you think about tests?
The test will probably need to make the sending and/or receiving socket full like I tried here: https://github.com/pyca/pyopenssl/pull/955/files#diff-5fbedfbbf8f0780aeee680927973f302330dc10fe915c7e7deecf4b0556c492cR3157
Sorry for letting this rot. Quite honestly, I'd appreciate if someone could help with the tests - or accept it without them.
Any chance of accepting this?
@vashek I suppose it's hard to write tests for this which is why I'll probably accept it without tests. But https://github.com/cherrypy/cheroot/issues/245#issuecomment-1465341867 seems to imply that it may be causing problems for retries. Do you have any thoughts on that?