diff options
author | elijah <elijah@riseup.net> | 2013-05-15 22:03:08 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-05-15 22:03:08 -0700 |
commit | 51dc03481a9be5148f16e8022a1b00b658739ff3 (patch) | |
tree | e370f488b6ce4b79c09778621d9f8fc2d95ee88d /lib/nickserver/hkp | |
parent | b078659defeead5b68ca2f387d0e308fa7511eb4 (diff) |
add CouchDB support.
Diffstat (limited to 'lib/nickserver/hkp')
-rw-r--r-- | lib/nickserver/hkp/fetch_key.rb | 8 | ||||
-rw-r--r-- | lib/nickserver/hkp/fetch_key_info.rb | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/nickserver/hkp/fetch_key.rb b/lib/nickserver/hkp/fetch_key.rb index 211ae92..6f91d8c 100644 --- a/lib/nickserver/hkp/fetch_key.rb +++ b/lib/nickserver/hkp/fetch_key.rb @@ -16,8 +16,8 @@ module Nickserver; module HKP get_key_by_fingerprint(best.keyid) {|key| self.succeed key } - }.errback {|msg| - self.fail msg + }.errback {|status, msg| + self.fail status, msg } self end @@ -30,13 +30,13 @@ module Nickserver; module HKP http = EventMachine::HttpRequest.new(Config.hkp_url).get(:query => params) http.callback { if http.response_header.status != 200 - self.fail http.response_header.status #"Request failed with #{http.response_header.status}: #{http.response}" + self.fail http.response_header.status, "HKP Request failed" else yield http.response end } http.errback { - self.fail http.error + self.fail 0, http.error } end diff --git a/lib/nickserver/hkp/fetch_key_info.rb b/lib/nickserver/hkp/fetch_key_info.rb index dce0326..b341aad 100644 --- a/lib/nickserver/hkp/fetch_key_info.rb +++ b/lib/nickserver/hkp/fetch_key_info.rb @@ -17,12 +17,12 @@ module Nickserver; module HKP params = {:op => 'vindex', :search => uid, :exact => 'on', :options => 'mr', :fingerprint => 'on'} EventMachine::HttpRequest.new(Config.hkp_url).get(:query => params).callback {|http| if http.response_header.status != 200 - self.fail http.response_header.status + self.fail http.response_header.status, "Could net fetch keyinfo" else self.succeed parse(uid, http.response) end }.errback {|http| - self.fail http.error + self.fail 0, http.error } self end |