Skip to content

Commit b21f73f

Browse files
committed
[refactor] a note on renegotiation_callback being incorrect
1 parent e1242f5 commit b21f73f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/main/java/org/jruby/ext/openssl/SSLSocket.java

+6-9
Original file line numberDiff line numberDiff line change
@@ -663,17 +663,14 @@ private void finishInitialHandshake() {
663663
session.putValue(SESSION_SOCKET_ID, getObjectId());
664664
}
665665
}
666-
666+
667+
// NOTE: gets called on negotiation connect/accept - not really on RE-negotiation as intended?!
667668
private void callRenegotiationCallback(final ThreadContext context) throws RaiseException {
668669
IRubyObject renegotiationCallback = sslContext.getInstanceVariable("@renegotiation_cb");
669-
if(renegotiationCallback == null || renegotiationCallback.isNil()) {
670-
return;
671-
}
672-
else {
673-
// the return of the Proc is not important
674-
// Can throw ruby exception to "disallow" renegotiations
675-
renegotiationCallback.callMethod(context, "call", this);
676-
}
670+
if (renegotiationCallback == null || renegotiationCallback.isNil()) return;
671+
// the return of the Proc is not important
672+
// Can throw ruby exception to "disallow" re-negotiations
673+
renegotiationCallback.callMethod(context, "call", this);
677674
}
678675

679676
public int write(ByteBuffer src, boolean blocking) throws SSLException, IOException {

0 commit comments

Comments
 (0)