Browse Source

* HTTPServer.cpp: drop boost::date_time dep

pull/489/head
hagen 9 years ago
parent
commit
849308e28d
  1. 25
      HTTPServer.cpp

25
HTTPServer.cpp

@ -6,7 +6,6 @@
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include "Base.h" #include "Base.h"
#include "FS.h" #include "FS.h"
@ -230,11 +229,29 @@ namespace http {
{ "stats.i2p", "http://7tbay5p4kzeekxvyvbf6v7eauazemsnnl2aoyqhg5jzpr5eke7tq.b32.i2p/cgi-bin/jump.cgi?a=" }, { "stats.i2p", "http://7tbay5p4kzeekxvyvbf6v7eauazemsnnl2aoyqhg5jzpr5eke7tq.b32.i2p/cgi-bin/jump.cgi?a=" },
}; };
void ShowUptime (std::stringstream& s, int seconds) {
int num;
if ((num = seconds / 86400) > 0) {
s << num << " days, ";
seconds -= num;
}
if ((num = seconds / 3600) > 0) {
s << num << " hours, ";
seconds -= num;
}
if ((num = seconds / 60) > 0) {
s << num << " min, ";
seconds -= num;
}
s << seconds << " seconds";
}
void ShowStatus (std::stringstream& s) void ShowStatus (std::stringstream& s)
{ {
s << "<b>Uptime:</b> " << boost::posix_time::to_simple_string ( s << "<b>Uptime:</b> ";
boost::posix_time::time_duration (boost::posix_time::seconds ( ShowUptime(s, i2p::context.GetUptime ());
i2p::context.GetUptime ()))) << "<br>\r\n"; s << "<br>\r\n";
s << "<b>Status:</b> "; s << "<b>Status:</b> ";
switch (i2p::context.GetStatus ()) switch (i2p::context.GetStatus ())
{ {

Loading…
Cancel
Save