Use dereferencing directly, and rename 'stop' to 'cleanup' for clarity

This commit is contained in:
Ashley Donaldson 2022-03-10 09:06:25 +11:00
parent 837cf199a0
commit c9d43aafe6
No known key found for this signature in database
GPG Key ID: 70277622B54D3BCE
3 changed files with 5 additions and 5 deletions

View File

@ -59,7 +59,7 @@ module Exploit::Remote::SocketServer
def cleanup
super
if service
stopped = stop_service
stopped = cleanup_service
if stopped
print_status("Server stopped.")
end
@ -79,9 +79,9 @@ module Exploit::Remote::SocketServer
end
#
# Stops the service.
# Cleans up the service; either closing the socket, or deferencing the service
#
def stop_service
def cleanup_service
if service
begin
if self.service.kind_of?(Rex::Service)

View File

@ -260,7 +260,7 @@ module ReverseHttp
def stop_handler
if self.service
self.service.remove_resource((luri + "/").gsub("//", "/"))
Rex::ServiceManager.stop_service(self.service)
self.service.deref
end
end

View File

@ -732,7 +732,7 @@ module HttpPacketDispatcher
resource_uri = "/" + self.conn_id.to_s.gsub(/(^\/|\/$)/, '') + "/"
self.passive_service.remove_resource(resource_uri) if self.passive_service
Rex::ServiceManager.stop_service(self.passive_service)
self.passive_service.deref
self.passive_service = nil
end
super