Skip to content

Commit

Permalink
Adds EOFError raise for when a session is dead
Browse files Browse the repository at this point in the history
  • Loading branch information
cgranleese-r7 committed Mar 15, 2024
1 parent 6347e91 commit f9decd3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ruby_smb/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ def recv_packet(encrypt: false)
begin
raw_response = dispatcher.recv_packet
rescue RubySMB::Error::CommunicationError => e
# If raw_response is nil the connection is dead
raise EOFError if raw_response.nil?

if encrypt
raise RubySMB::Error::EncryptionError, "Communication error with the "\
"remote host: #{e.message}. The server supports encryption but was "\
Expand Down

0 comments on commit f9decd3

Please sign in to comment.