From 79e055c7fdfbc01f39a564407cea97e4cd48e281 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Sun, 8 Jan 2006 19:49:14 +0000 Subject: [PATCH] fix termination of bind handler thread git-svn-id: file:///home/svn/incoming/trunk@3349 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/handler/bind_tcp.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/msf/core/handler/bind_tcp.rb b/lib/msf/core/handler/bind_tcp.rb index 520e2b13e2..1676cadb14 100644 --- a/lib/msf/core/handler/bind_tcp.rb +++ b/lib/msf/core/handler/bind_tcp.rb @@ -65,7 +65,7 @@ module BindTcp # Starts monitoring for an outbound connection to become established. # def start_handler - listener_thread = Thread.new { + self.listener_thread = Thread.new { client = nil print_status("Started bind handler") @@ -124,11 +124,17 @@ module BindTcp # Nothing to speak of. # def stop_handler + # Stop the listener thread. + if (listener_thread) + listener_thread.kill + self.listener_thread = nil + end end protected attr_accessor :conn_threads # :nodoc: + attr_accessor :listener_thread # :nodoc: end