TRACE compile fixes, other fixes, and it basically works! It says HELLO.

This commit is contained in:
Adam Ierymenko 2015-04-09 20:54:00 -07:00
parent 38200cc6a5
commit 068d311ecc
12 changed files with 140 additions and 33 deletions

View file

@ -82,6 +82,7 @@ Node::Node(
std::string idtmp(dataStoreGet("identity.secret"));
if ((!idtmp.length())||(!RR->identity.fromString(idtmp))||(!RR->identity.hasPrivate())) {
TRACE("identity.secret not found, generating...");
RR->identity.generate();
idtmp = RR->identity.toString(true);
if (!dataStorePut("identity.secret",idtmp,true)) {
@ -444,10 +445,16 @@ void Node::postTrace(const char *module,unsigned int line,const char *fmt,...)
#ifdef __WINDOWS__
ctime_s(tmp3,sizeof(tmp3),&now);
const char *nowstr = tmp3;
char *nowstr = tmp3;
#else
const char *nowstr = ctime_r(&now,tmp3);
time_t now = (time_t)(_now / 1000ULL);
char *nowstr = ctime_r(&now,tmp3);
#endif
unsigned long nowstrlen = strlen(nowstr);
if (nowstr[nowstrlen-1] == '\n')
nowstr[--nowstrlen] = (char)0;
if (nowstr[nowstrlen-1] == '\r')
nowstr[--nowstrlen] = (char)0;
va_start(ap,fmt);
vsnprintf(tmp2,sizeof(tmp2),fmt,ap);