Report errors connecting to malpd socket

This commit is contained in:
Josh Holtrop 2026-04-01 20:58:34 -04:00
parent 7c907fe0ce
commit c717b5d589

View File

@ -85,10 +85,17 @@ if cgi.params.key?("content")
if authenticated
html = ""
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"]