From a9fdd97a66d35c1c6ab606c89051b4ed0bbdf813 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 9 Mar 2011 02:41:58 +0100 Subject: [PATCH] brmstatus.txt interface support --- brmd.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/brmd.pl b/brmd.pl index 54e917c..89a8061 100644 --- a/brmd.pl +++ b/brmd.pl @@ -26,6 +26,7 @@ my $web = POE::Component::Server::HTTP->new( "/brmstatus.html" => \&web_brmstatus_html, "/brmstatus.js" => \&web_brmstatus_js, "/brmstatus.png" => \&web_brmstatus_png, + "/brmstatus.txt" => \&web_brmstatus_txt, "/" => \&web_index }, Headers => {Server => 'brmd/xxx'}, @@ -187,6 +188,20 @@ EOT return RC_OK; } +sub web_brmstatus_txt { + my ($request, $response) = @_; + + my $st = status_str(); + + $response->code(RC_OK); + $response->push_header("Content-Type", "text/plain"); + disable_caching($response); + + $response->content($st); + + return RC_OK; +} + sub web_brmstatus_png { my ($request, $response) = @_;