Report errors connecting to malpd socket
This commit is contained in:
parent
7c907fe0ce
commit
c717b5d589
@ -85,10 +85,17 @@ if cgi.params.key?("content")
|
|||||||
if authenticated
|
if authenticated
|
||||||
html = ""
|
html = ""
|
||||||
|
|
||||||
sock = UNIXSocket.new("/run/malpd/malpd.sock")
|
begin
|
||||||
sock.puts "info"
|
sock = UNIXSocket.new("/run/malpd/malpd.sock")
|
||||||
info = JSON.parse(sock.gets)
|
sock.puts "info"
|
||||||
sock.close
|
info = JSON.parse(sock.gets)
|
||||||
|
sock.close
|
||||||
|
rescue
|
||||||
|
cgi.out("type" => "text/html", "charset" => "UTF-8") do
|
||||||
|
"Could not connect to malpd socket"
|
||||||
|
end
|
||||||
|
exit
|
||||||
|
end
|
||||||
|
|
||||||
info.each do |entry|
|
info.each do |entry|
|
||||||
case entry["type"]
|
case entry["type"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user