brmstatus.txt interface support

This commit is contained in:
Petr Baudis 2011-03-09 02:41:58 +01:00
parent 4e017cb3db
commit a9fdd97a66

15
brmd.pl
View file

@ -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) = @_;