1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-20 13:16:36 +02:00

small refactor for incoming file transfers

This commit is contained in:
Jfreegman
2014-03-05 03:31:12 -05:00
parent 92d5b2fefc
commit d1153f96ca
4 changed files with 31 additions and 27 deletions

View File

@ -56,7 +56,6 @@ void init_logging_session(uint8_t *name, uint8_t *key, struct chatlog *log)
if (path_len > MAX_STR_SIZE) {
log->log_on = false;
log->file = NULL;
return;
}
@ -100,11 +99,10 @@ void write_to_log(uint8_t *msg, uint8_t *name, struct chatlog *log, bool event)
uint64_t curtime = (uint64_t) time(NULL);
if (timed_out(log->lastwrite, curtime, LOG_FLUSH_LIMIT))
if (timed_out(log->lastwrite, curtime, LOG_FLUSH_LIMIT)) {
fflush(log->file);
log->lastwrite = curtime;
log->lastwrite = curtime;
}
}
void log_enable(uint8_t *name, uint8_t *key, struct chatlog *log)