File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/main/java/org/jruby/ext/openssl Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -615,10 +615,7 @@ private boolean flushData(boolean blocking) throws IOException {
615
615
netData .position (netData .limit ());
616
616
throw ioe ;
617
617
}
618
- if ( netData .hasRemaining () ) {
619
- return true ;
620
- }
621
- return false ;
618
+ return netData .hasRemaining ();
622
619
}
623
620
624
621
private int writeToChannel (ByteBuffer buffer , boolean blocking ) throws IOException {
@@ -755,11 +752,15 @@ private void closeInbound() {
755
752
}
756
753
757
754
private void doShutdown () throws IOException {
758
- if ( engine .isOutboundDone () ) return ;
755
+ if (engine .isOutboundDone ()) return ;
759
756
757
+ if (flushData (false )) {
758
+ debug (getRuntime (), "SSLSocket.doShutdown data in the data buffer - can't send close" );
759
+ return ;
760
+ }
760
761
netData .clear ();
761
762
try {
762
- engine .wrap (dummy , netData );
763
+ engine .wrap (dummy , netData ); // send close (after sslEngine.closeOutbound)
763
764
}
764
765
catch (SSLException e ) {
765
766
debug (getRuntime (), "SSLSocket.doShutdown" , e );
You can’t perform that action at this time.
0 commit comments