Fixes #201. Better error processing of client sockets

git-svn-id: file:///home/svn/framework3/trunk@5872 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-11-10 21:30:35 +00:00
parent e2a70dd615
commit 6dd840e4b3
1 changed files with 11 additions and 5 deletions

View File

@ -158,7 +158,7 @@ protected
def monitor_clients
begin
if (clients.length == 0)
Rex::ThreadSafe::sleep(0.2)
Rex::ThreadSafe::sleep(0.25)
next
end
@ -170,22 +170,28 @@ protected
rescue EOFError
on_client_close(fd)
close_client(fd)
rescue
rescue ::Interrupt
raise $!
rescue ::Exception
close_client(fd)
elog("Error in stream server client monitor: #{$!}")
rlog(ExceptionCallStack)
end
}
rescue ::Rex::StreamClosedError => e
# Remove the closed stream from the list
clients.delete(e.stream)
rescue
rescue ::Interrupt
raise $!
rescue ::Exception
elog("Error in stream server client monitor: #{$!}")
rlog(ExceptionCallStack)
rlog(ExceptionCallStack)
end while true
end
end
end
end
end