Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix SSL accept blocking the main acceptor #38

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

asabil commented Mar 28, 2013

This is an attempt at fixing extend/cowboy#303

Ali Sabil added some commits Mar 27, 2013

Ali Sabil Add a handshake/2 function to ranch_transport
This new callback can be used by the transport to complete the
setup of the connection after accepting it.
e655255
Ali Sabil Replace ranch:accept_ack/1 with ranch:accept_ack/4
This new accept_ack completes any pending transport setup by calling
the appropriate transport's handshake/2
2d7ae2c
Ali Sabil Update the tests to use ranch:accept_ack/4 ee5df97
Ali Sabil Update the guide and examples to refer to ranch:accept_ack/4 c77c1af
Owner

essen commented Mar 28, 2013

That's way too complex. It just needs a potentially configurable timeout value?

Contributor

asabil commented Mar 28, 2013

Yes I agree, I am actually not even sure if using ranch:accept_ack to do the ssl handshake is a good idea, maybe it would simply be better to call the Transport:handshake/2 directly from within the protocol implementation? Otherwise how would you implement it? I am very interested in getting this fixed asap

Contributor

fishcakez commented Mar 28, 2013

I'd like to see a fix for this too (hope you don't mind some outside alternative @asabil). I have a backwards compatible solution here: https://github.com/fishcakez/ranch/tree/jf-ssl-accept
I just realised I messed up the way timeout works so I'll push a second commit shortly. I can start a PR if this is an acceptable approach.
Edit: I've amended the commit in that branch to fix the timeout issue.

Contributor

asabil commented Mar 28, 2013

Of course not, this is great! I just want this issue to be fixed asap, I really like your approach much better since it will not break any existing user of ranch 👍

@fishcakez fishcakez referenced this pull request Mar 31, 2013

Closed

Improve SSL accept #44

Owner

essen commented Apr 8, 2013

More discussions here: extend#44 (comment)

Owner

essen commented Nov 26, 2013

Done in 99242f3. Thanks!

@essen essen closed this Nov 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment