dns_one 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2e177edc18b9dee7569ef4f36ffe951cc8e37ec
4
- data.tar.gz: 2d30c670b7da2f45f598c4b61fe9793b45bf793b
3
+ metadata.gz: dafa640dc8815562ed27e6f49e9b0b5154f90673
4
+ data.tar.gz: 1544acf2162fffcc5d7bdb5b4a04cdeee96f1a5b
5
5
  SHA512:
6
- metadata.gz: 20cb2fa761289854fc132714969986ec8be21e4e4bef50e7cfada2c90690b14a2c2fc049b15ce7efe9fc8f24353ad31fd75ec242dce24eb8bcc62f0d64690250
7
- data.tar.gz: 6bac3289e65ac4b4bdc9973d650b0220280bc705f76a1a8844f0574887c9a7a9ed7f5bf4e1a8c96733573ad51cf06746b1936b1fc0e64b59f94f79c676095d2e
6
+ metadata.gz: a21555de7c3c263252ba6d8566535202fbc318010b8b4e22a6f41ceaee815f90999d6569b9df31277f987b4b31536c3d5d43276b3601bc5dc2f111c5e60a8829
7
+ data.tar.gz: f727d926263b706b1fae79b739ab3599357764443b16df3e025c93c701a33a816492e14f7b74011a10d2278767601536109d49d615bdeb2ca7e8d2ce22a8b15a
@@ -73,32 +73,36 @@ module DnsOne; class Server
73
73
  rcode = :ServFail
74
74
  end
75
75
 
76
- if conf[:save_stats]
77
- stat.save rcode, t.resource_class, from_cache
78
- end
76
+ begin
77
+ if conf[:save_stats]
78
+ stat.save rcode, t.resource_class, from_cache
79
+ end
79
80
 
80
- if conf[:log_result]
81
- Util.log_result ip_address, domain_name, t.resource_class, rcode, resp_log, from_cache
82
- end
81
+ if conf[:log_result]
82
+ Util.log_result ip_address, domain_name, t.resource_class, rcode, resp_log, from_cache
83
+ end
83
84
 
84
- if conf[:log_result_socket]
85
- log_result_mutex.synchronize {
86
- log_result[:requests] ||= 0
87
- log_result[:requests] += 1
88
-
89
- log_result[:cache] ||= 0
90
- log_result[:cache] += 1 if from_cache
91
-
92
- rcode_uc = Util.const_underscore rcode
93
- log_result[:rcode] ||= {}
94
- log_result[:rcode][rcode_uc] ||= 0
95
- log_result[:rcode][rcode_uc] += 1
96
-
97
- req_resource = Util.last_mod(t.resource_class).downcase
98
- log_result[:req_resource] ||= {}
99
- log_result[:req_resource][req_resource] ||= 0
100
- log_result[:req_resource][req_resource] += 1
101
- }
85
+ if conf[:log_result_socket]
86
+ log_result_mutex.synchronize {
87
+ log_result[:requests] ||= 0
88
+ log_result[:requests] += 1
89
+
90
+ log_result[:cache] ||= 0
91
+ log_result[:cache] += 1 if from_cache
92
+
93
+ rcode_uc = Util.const_underscore rcode
94
+ log_result[:rcode] ||= {}
95
+ log_result[:rcode][rcode_uc] ||= 0
96
+ log_result[:rcode][rcode_uc] += 1
97
+
98
+ req_resource = Util.last_mod(t.resource_class).downcase
99
+ log_result[:req_resource] ||= {}
100
+ log_result[:req_resource][req_resource] ||= 0
101
+ log_result[:req_resource][req_resource] += 1
102
+ }
103
+ end
104
+ rescue => e
105
+ Log.exc e
102
106
  end
103
107
 
104
108
  raise e if e
@@ -51,16 +51,17 @@ module DnsOne; class Util
51
51
 
52
52
  Log.i "result: #{ fields.join ' ' }"
53
53
  end
54
- end
55
54
 
56
- def const_underscore name
57
- name = name.to_s.dup
58
- name.gsub!('::', '/')
59
- name.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
60
- name.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
61
- name.tr!("-", "_")
62
- name.downcase!
63
- name
64
- end
55
+ def const_underscore name
56
+ name = name.to_s.dup
57
+ name.gsub!('::', '/')
58
+ name.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
59
+ name.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
60
+ name.tr!("-", "_")
61
+ name.downcase!
62
+ name
63
+ end
64
+
65
+ end
65
66
 
66
67
  end; end
@@ -1,3 +1,3 @@
1
1
  module DnsOne
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dns_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Lobato