File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
main/java/org/jruby/ext/openssl Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -883,12 +883,11 @@ private void forceClose() {
883
883
close (true );
884
884
}
885
885
886
- //private boolean closed;
887
-
888
886
private void close (boolean force ) {
889
- //closed = true;
890
-
891
- if ( engine == null ) throw getRuntime ().newEOFError ();
887
+ if ( engine == null ) {
888
+ // if ( force ) throw getRuntime().newEOFError();
889
+ return ;
890
+ }
892
891
893
892
engine .closeOutbound ();
894
893
@@ -903,8 +902,6 @@ private void close(boolean force) {
903
902
}
904
903
}
905
904
906
- //final boolean isClosed() { return closed; }
907
-
908
905
@ JRubyMethod
909
906
public IRubyObject sysclose (final ThreadContext context ) {
910
907
//if ( isClosed() ) return context.runtime.getNil();
Original file line number Diff line number Diff line change @@ -42,4 +42,16 @@ def test_attr_methods
42
42
socket . inspect
43
43
end
44
44
45
+ def test_sync_close_without_connect
46
+ require 'socket'
47
+ Socket . open ( :INET , :STREAM ) do |socket |
48
+ assert ! socket . closed?
49
+ ssl = OpenSSL ::SSL ::SSLSocket . new ( socket )
50
+ ssl . sync_close = true
51
+ assert ! ssl . closed?
52
+ ssl . close
53
+ assert socket . closed?
54
+ end
55
+ end
56
+
45
57
end
You can’t perform that action at this time.
0 commit comments