From 5d0ebc18cfb0ea1103282df256166ec58c6e5fcc Mon Sep 17 00:00:00 2001 From: HD Moore Date: Sun, 16 Nov 2008 21:00:44 +0000 Subject: [PATCH] See #250. Adds a wait() wrapper to the HTTP service as well git-svn-id: file:///home/svn/framework3/trunk@5927 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rex/proto/http/server.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/rex/proto/http/server.rb b/lib/rex/proto/http/server.rb index ae7c1bbea5..428ed7168f 100644 --- a/lib/rex/proto/http/server.rb +++ b/lib/rex/proto/http/server.rb @@ -127,6 +127,7 @@ class Server # Listens on the defined port and host and starts monitoring for clients. # def start + self.listener = Rex::Socket::TcpServer.create( 'LocalHost' => self.listen_host, 'LocalPort' => self.listen_port, @@ -153,6 +154,14 @@ class Server self.listener.close end + + # + # Waits for the HTTP service to terminate + # + def wait + self.listener.wait if self.listener + end + # # Closes the supplied client, if valid. # @@ -347,4 +356,4 @@ end end end -end \ No newline at end of file +end