@@ -1781,21 +1781,24 @@ private void closeSocket(boolean selfInitiated) throws IOException {
1781
1781
if (conContext .inputRecord instanceof
1782
1782
SSLSocketInputRecord inputRecord && isConnected ) {
1783
1783
if (appInput .readLock .tryLock ()) {
1784
- int soTimeout = getSoTimeout ();
1785
1784
try {
1786
- // deplete could hang on the skip operation
1787
- // in case of infinite socket read timeout.
1788
- // Change read timeout to avoid deadlock.
1789
- // This workaround could be replaced later
1790
- // with the right synchronization
1791
- if (soTimeout == 0 )
1792
- setSoTimeout (DEFAULT_SKIP_TIMEOUT );
1793
- inputRecord .deplete (false );
1794
- } catch (java .net .SocketTimeoutException stEx ) {
1795
- // skip timeout exception during deplete
1785
+ int soTimeout = getSoTimeout ();
1786
+ try {
1787
+ // deplete could hang on the skip operation
1788
+ // in case of infinite socket read timeout.
1789
+ // Change read timeout to avoid deadlock.
1790
+ // This workaround could be replaced later
1791
+ // with the right synchronization
1792
+ if (soTimeout == 0 )
1793
+ setSoTimeout (DEFAULT_SKIP_TIMEOUT );
1794
+ inputRecord .deplete (false );
1795
+ } catch (java .net .SocketTimeoutException stEx ) {
1796
+ // skip timeout exception during deplete
1797
+ } finally {
1798
+ if (soTimeout == 0 )
1799
+ setSoTimeout (soTimeout );
1800
+ }
1796
1801
} finally {
1797
- if (soTimeout == 0 )
1798
- setSoTimeout (soTimeout );
1799
1802
appInput .readLock .unlock ();
1800
1803
}
1801
1804
}
0 commit comments