From fa37709af6df90e3ac64a4eaba9babec3160ad48 Mon Sep 17 00:00:00 2001 From: stskeeps Date: Tue, 17 Jul 2001 21:37:47 +0000 Subject: [PATCH] +- Added correct uptime to web interface --- Changes | 3 ++- src/modules/web/phtml.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 2c964e0d6..5087b3fc8 100644 --- a/Changes +++ b/Changes @@ -708,4 +708,5 @@ seen. gmtime warning still there - Added a patch by Zogg to fix a socks scanner problem - Fixed a /sapart bug found by SubZero - Minor bugfix in scan_socks, + some comments -- Fixed some flaws in httpd, that made it break unmercifully \ No newline at end of file +- Fixed some flaws in httpd, that made it break unmercifully +- Added correct uptime to web interface diff --git a/src/modules/web/phtml.c b/src/modules/web/phtml.c index 262d4defe..50db855df 100644 --- a/src/modules/web/phtml.c +++ b/src/modules/web/phtml.c @@ -151,9 +151,16 @@ DLLFUNC int h_u_phtml(HTTPd_Request *r) else if (!strcmp(s, "DATA")) { + time_t tmpnow; + if (section == SECTION_STATS) { - sockprintf(r, "My name is %s
Been up for %lu", me.name, TStime()-me.since); + tmpnow = TStime() - me.since; + sockprintf(r, "My name is %s
", me.name); + sockprintf(r, + "Been up for %lu days, %lu hours, %lu minutes, %lu seconds", + tmpnow / 86400, (tmpnow / 3600) % 24, (tmpnow /60) %60, + tmpnow % 60); } }