dns_one 0.4.62 → 0.4.63
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dns_one/server.rb +21 -16
- data/lib/dns_one/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa014ca733029ef9e49e71451ac93b0d8a235155
|
4
|
+
data.tar.gz: a9b8a83b5e734f9a9a45735d3fe3ae14fa344962
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e6903cb7326a654bf59f056309f18ca55b070ba942549ac3efb200f36f0a4c94dde0a16d297f01c7b2d1fc1cf06ed3d1492b7d8d3d06bc3188fb909166c748b
|
7
|
+
data.tar.gz: 4efd70b798c88adb71f37e55050fdeb7fe1c92030cd27046aa18b7359627d92b8242e7bcde3078e396a5aa5a8c2a95ec519194355f11c304a0647e46ead9214e
|
data/lib/dns_one/server.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
|
2
2
|
require "dns_one/zone_search"
|
3
|
+
require 'socket'
|
4
|
+
require 'json'
|
3
5
|
|
4
6
|
module DnsOne; class Server
|
5
7
|
|
@@ -125,28 +127,31 @@ module DnsOne; class Server
|
|
125
127
|
def launch_log_result_socket
|
126
128
|
log_result = @log_result
|
127
129
|
log_result_mutex = @log_result_mutex
|
130
|
+
conf = @conf
|
128
131
|
sock = Thread.new do
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
132
|
+
begin
|
133
|
+
Socket.unix_server_loop(conf[:log_result_socket_file] || DEFAULT_LOG_RESULT_SOCKET_FILE) do |sock, addr|
|
134
|
+
Thread.new do
|
135
|
+
loop do
|
136
|
+
begin
|
137
|
+
log_result_mutex.synchronize {
|
138
|
+
sock.write "#{ log_result.to_json }\n"
|
139
|
+
}
|
140
|
+
rescue Errno::EPIPE => e
|
141
|
+
break
|
142
|
+
rescue => e
|
143
|
+
Log.exc e
|
144
|
+
break
|
145
|
+
end
|
146
|
+
Thread.pass
|
147
|
+
sleep 0.1
|
142
148
|
end
|
143
|
-
Thread.pass
|
144
|
-
sleep 0.1
|
145
149
|
end
|
146
150
|
end
|
151
|
+
rescue => e
|
152
|
+
Log.exc e
|
147
153
|
end
|
148
154
|
end
|
149
155
|
end
|
150
156
|
|
151
157
|
end; end
|
152
|
-
|
data/lib/dns_one/version.rb
CHANGED