Make the embedded stats message display valid XHTML too

This commit is contained in:
Mukund Sivaraman 2008-07-14 15:09:02 +05:30
parent 74f5c3e417
commit 8b26558254

View File

@ -63,16 +63,21 @@ int
showstats(struct conn_s *connptr) showstats(struct conn_s *connptr)
{ {
static char *msg = static char *msg =
"<html><head><title>%s (%s) stats</title></head>\r\n" "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
"<body>\r\n" "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
"<center><h2>%s (%s) run-time statistics</h2></center><hr>\r\n" "<html>\n"
"<blockquote>\r\n" "<head><title>%s version %s run-time statistics</title></head>\n"
"Number of open connections: %lu<br>\r\n" "<body>\n"
"Number of requests: %lu<br>\r\n" "<h1>%s version %s run-time statistics</h1>\n"
"Number of bad connections: %lu<br>\r\n" "<p>\n"
"Number of denied connections: %lu<br>\r\n" "Number of open connections: %lu<br />\n"
"Number of refused connections due to high load: %lu\r\n" "Number of requests: %lu<br />\n"
"</blockquote>\r\n</body></html>\r\n"; "Number of bad connections: %lu<br />\n"
"Number of denied connections: %lu<br />\n"
"Number of refused connections due to high load: %lu\n"
"</p>\n"
"</body>\n"
"</html>\n";
char *message_buffer; char *message_buffer;
char opens[16], reqs[16], badconns[16], denied[16], refused[16]; char opens[16], reqs[16], badconns[16], denied[16], refused[16];