diff options
author | azul <azul@riseup.net> | 2017-07-24 05:22:15 +0000 |
---|---|---|
committer | azul <azul@riseup.net> | 2017-07-24 05:22:15 +0000 |
commit | cdad3bedd7d90957d836d9d9c339e6b9dfc8b8d1 (patch) | |
tree | 2707fe4563d6be32cd6a9b2d1cb4c1f5f303273c /lib/nickserver/request_handlers | |
parent | 38dd81116b85c103dbc5e9f08a8ffce26238921a (diff) | |
parent | 406234367544a4207141230683dddaccd98fb21a (diff) |
Merge branch 'fix/fd-leak' into 'master'
fix: filedescriptor leak from http_adapters
See merge request !13
Diffstat (limited to 'lib/nickserver/request_handlers')
5 files changed, 9 insertions, 8 deletions
diff --git a/lib/nickserver/request_handlers/base.rb b/lib/nickserver/request_handlers/base.rb index e5d8992..495a6da 100644 --- a/lib/nickserver/request_handlers/base.rb +++ b/lib/nickserver/request_handlers/base.rb @@ -2,16 +2,17 @@ module Nickserver module RequestHandlers class Base - def self.call(request) - new(request).handle + def self.call(request, adapter = nil) + new(request, adapter).handle end - def initialize(request) + def initialize(request, adapter) @request = request + @adapter = adapter end protected - attr_reader :request + attr_reader :request, :adapter end end end diff --git a/lib/nickserver/request_handlers/fingerprint_handler.rb b/lib/nickserver/request_handlers/fingerprint_handler.rb index 5b2dc7d..ac3c3c8 100644 --- a/lib/nickserver/request_handlers/fingerprint_handler.rb +++ b/lib/nickserver/request_handlers/fingerprint_handler.rb @@ -22,7 +22,7 @@ module Nickserver end def source - Nickserver::Hkp::Source.new + Nickserver::Hkp::Source.new adapter end end diff --git a/lib/nickserver/request_handlers/hkp_email_handler.rb b/lib/nickserver/request_handlers/hkp_email_handler.rb index 2f73773..393ef87 100644 --- a/lib/nickserver/request_handlers/hkp_email_handler.rb +++ b/lib/nickserver/request_handlers/hkp_email_handler.rb @@ -16,7 +16,7 @@ module Nickserver end def source - Nickserver::Hkp::Source.new + Nickserver::Hkp::Source.new adapter end end diff --git a/lib/nickserver/request_handlers/leap_email_handler.rb b/lib/nickserver/request_handlers/leap_email_handler.rb index bdebc23..bc3ddef 100644 --- a/lib/nickserver/request_handlers/leap_email_handler.rb +++ b/lib/nickserver/request_handlers/leap_email_handler.rb @@ -13,7 +13,7 @@ module Nickserver protected def source - @source ||= Nicknym::Source.new + @source ||= Nicknym::Source.new adapter end def remote_email? diff --git a/lib/nickserver/request_handlers/local_email_handler.rb b/lib/nickserver/request_handlers/local_email_handler.rb index 9165ef2..08147a0 100644 --- a/lib/nickserver/request_handlers/local_email_handler.rb +++ b/lib/nickserver/request_handlers/local_email_handler.rb @@ -21,7 +21,7 @@ module Nickserver end def source - Nickserver::CouchDB::Source.new + Nickserver::CouchDB::Source.new adapter end end |