libcoro: .poll(coro::poll_op::read)ing from ssl connection is extremely slow
This is my code now: https://gist.github.com/niansa/b2d589e1ed67c44e753414298f30404c#file-gistfile1-txt-L67
For some reason using poll() is extremely slow here and I have to catch EAGAIN.
BTW: I figured out that each poll(coro::poll_op::read) takes exactly as long as my configured timeout! With timeout set to 0 it gets stuck forever for a very long time.
Would could have gone wrong?
Here is a repository with full code: https://github.com/niansa/libcoroExperiments Timeout gets set in main.cpp
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (11 by maintainers)
Ok this appears to be a setting with
SSL_CTX_set_read_aheadand thusepoll/polldon’t have any data remaining, its already pulled it off the socket but it hasn’t been processed by openssl yet. I’ve got a working test case that replicates this and I think fixes it, I’ll push a PR in a bit. It seems my original test cases the data was so small it never triggered this issue… so good find!edit: maybe not, i removed all the code changes but the test case and its still passing x.x
I updated the repository with the changes as you said. It’s still broken for me.
Maybe you could take a quick look at the newest commit? What did I do wrong?
Looks pretty straightforward, I’ll give it a go in a bit!