/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/rex/service.rb
48 строк
859 B
adfoster-r7
Update replicant pattern to increment refs
15 фев 2022, 19:08
Не верифицирован
15 фев 2022, 19:08
18b4ce8
Код
Авторство
О чём код?
# -*- coding: binary -*- require 'rex' module Rex ### # # The service module is used to extend classes that are passed into the # service manager start routine. It provides extra methods, such as reference # counting, that are used to track the service instances more uniformly. # ### module Service include Ref # # Returns the hardcore, as in porno, alias for this service. This is used # by the service manager to manage singleton services. # def self.hardcore_alias(*args) return "__#{args}" end def deref rv = super # If there's only one reference, then it's the service managers. if @_references == 1 Rex::ServiceManager.stop_service(self) return true end rv end # # Calls stop on the service once the ref count drops. # def cleanup stop end attr_accessor :alias end end