lib/metasploit/aggregator/connection_manager.rb in metasploit-aggregator-0.1.2 vs lib/metasploit/aggregator/connection_manager.rb in metasploit-aggregator-0.1.3
- old
+ new
@@ -1,6 +1,7 @@
require 'openssl'
+require 'singleton'
require 'socket'
require 'metasploit/aggregator/logger'
require 'metasploit/aggregator/http_forwarder'
require 'metasploit/aggregator/https_forwarder'
@@ -8,10 +9,11 @@
module Metasploit
module Aggregator
class ConnectionManager
+ include Singleton
def initialize
@cables = []
@manager_mutex = Mutex.new
@router = Router.instance
@@ -117,10 +119,10 @@
end
@cables.each do |cable|
next unless cable.forwarder.connections.include?(payload)
# TODO: improve how time is exposed for live connections
time = cable.forwarder.connection_info(payload)['TIME']
- detail_map['LAST_SEEN'] = Time.now - time unless time.nil?
+ detail_map['LAST_SEEN'] = (Time.now - time).to_s unless time.nil?
end
detail_map
end
def cables