mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Revert "[fix] jruby hang with TLS due not executing task"
This reverts commit d1731a5607
.
This commit is contained in:
parent
d1731a5607
commit
3c5727f9e3
1 changed files with 12 additions and 10 deletions
|
@ -355,6 +355,14 @@ public class MiniSSL extends RubyObject { // MiniSSL::Engine
|
|||
}
|
||||
}
|
||||
|
||||
// after each op, run any delegated tasks if needed
|
||||
if(res.getHandshakeStatus() == HandshakeStatus.NEED_TASK) {
|
||||
Runnable runnable;
|
||||
while ((runnable = engine.getDelegatedTask()) != null) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -372,12 +380,11 @@ public class MiniSSL extends RubyObject { // MiniSSL::Engine
|
|||
|
||||
HandshakeStatus handshakeStatus = engine.getHandshakeStatus();
|
||||
boolean done = false;
|
||||
SSLEngineResult res = null;
|
||||
while (!done) {
|
||||
SSLEngineResult res;
|
||||
switch (handshakeStatus) {
|
||||
case NEED_WRAP:
|
||||
res = doOp(SSLOperation.WRAP, inboundAppData, outboundNetData);
|
||||
handshakeStatus = res.getHandshakeStatus();
|
||||
break;
|
||||
case NEED_UNWRAP:
|
||||
res = doOp(SSLOperation.UNWRAP, inboundNetData, inboundAppData);
|
||||
|
@ -385,18 +392,13 @@ public class MiniSSL extends RubyObject { // MiniSSL::Engine
|
|||
// need more data before we can shake more hands
|
||||
done = true;
|
||||
}
|
||||
handshakeStatus = res.getHandshakeStatus();
|
||||
break;
|
||||
case NEED_TASK:
|
||||
Runnable runnable;
|
||||
while ((runnable = engine.getDelegatedTask()) != null) {
|
||||
runnable.run();
|
||||
}
|
||||
handshakeStatus = engine.getHandshakeStatus();
|
||||
break;
|
||||
default:
|
||||
done = true;
|
||||
}
|
||||
if (!done) {
|
||||
handshakeStatus = res.getHandshakeStatus();
|
||||
}
|
||||
}
|
||||
|
||||
if (inboundNetData.hasRemaining()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue