be more robust and careful breaking from the accept thread

bug/bundler_fix
Brent Cook 2016-01-23 01:46:58 -06:00
parent 91700f17e3
commit a587975f90
1 changed files with 9 additions and 6 deletions

View File

@ -91,15 +91,18 @@ module ReverseTcp
# Accept a client connection
begin
client = listener_sock.accept
if !client
wlog("#{handler_name}: No client received in call to accept, exiting...")
else
if client
self.pending_connections += 1
lqueue.push(client)
end
rescue StandardError
wlog("#{handler_name}: Exception raised during listener accept: #{$ERROR_INFO}\n\n#{$ERROR_POSITION.join("\n")}")
break
rescue Errno::ENOTCONN
nil
rescue StandardError => e
wlog [
"#{handler_name}: Exception raised during listener accept: #{e.class}",
"#{$ERROR_INFO}",
"#{$ERROR_POSITION.join("\n")}"
].join("\n")
end
end
}