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
|
||||
html = ""
|
||||
|
||||
sock = UNIXSocket.new("/run/malpd/malpd.sock")
|
||||
sock.puts "info"
|
||||
info = JSON.parse(sock.gets)
|
||||
sock.close
|
||||
begin
|
||||
sock = UNIXSocket.new("/run/malpd/malpd.sock")
|
||||
sock.puts "info"
|
||||
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|
|
||||
case entry["type"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user