GeezerVison is showing github.com — Remove clearing of buffer. · bazauto/SSH.NET@ad596e8
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/Renci.SshNet/Session.cs -27Lines changed: 0 additions & 27 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1893,39 +1893,12 @@ private void SocketDisconnectAndDispose() |
1893 | 1893 | // closed by the remote host) which we'll log and ignore as it means the socket |
1894 | 1894 | // was already shut down |
1895 | 1895 | _socket.Shutdown(SocketShutdown.Send); |
1896 | | - |
1897 | | -#if FEATURE_SOCKET_POLL |
1898 | | - // since we've shut down the socket, there should not be any reads in progress but |
1899 | | - // we still take a read lock to ensure IsSocketConnected continues to provide |
1900 | | - // correct results |
1901 | | - // |
1902 | | - // see IsSocketConnected for details on the race condition we avoid with this lock |
1903 | | - // |
1904 | | - // this race condition only exists if IsSocketConnected actually uses Socket.Poll, |
1905 | | - // and as such this read is also only required when Socket.Poll is available |
1906 | | - lock (_socketReadLock) |
1907 | | - { |
1908 | | -#endif // FEATURE_SOCKET_POLL |
1909 | | - SocketAbstraction.ClearReadBuffer(_socket); |
1910 | | -#if FEATURE_SOCKET_POLL |
1911 | | - } |
1912 | | -#endif // FEATURE_SOCKET_POLL |
1913 | | - } |
1914 | | - catch (SshOperationTimeoutException ex) |
1915 | | - { |
1916 | | - // TODO: log as info or debug |
1917 | | - DiagnosticAbstraction.Log("Time-out shutting down socket or clearing read buffer: " + ex); |
1918 | 1896 | } |
1919 | 1897 | catch (SocketException ex) |
1920 | 1898 | { |
1921 | 1899 | // TODO: log as info or debug |
1922 | 1900 | DiagnosticAbstraction.Log("Failure shutting down socket or clearing read buffer: " + ex); |
1923 | 1901 | } |
1924 | | - catch (Exception ex) |
1925 | | - { |
1926 | | - // TODO: log as warning |
1927 | | - DiagnosticAbstraction.Log("Time-out shutting down socket or clearing read buffer: " + ex); |
1928 | | - } |
1929 | 1902 | } |
1930 | 1903 |
|
1931 | 1904 | DiagnosticAbstraction.Log(string.Format("[{0}] Disposing socket.", ToHex(SessionId))); |
|