From e4d1706031540ae74ff104c44adeb735ee0bfcf4 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sat, 7 Sep 2019 12:43:04 +0100 Subject: Add a configuration option to include the date in the timestamp when replaying the replay log. --- functions.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'functions.c') diff --git a/functions.c b/functions.c index b9f1080..bbbd9dd 100644 --- a/functions.c +++ b/functions.c @@ -811,7 +811,7 @@ int doreplay(int sourcefd, int replayseconds, struct client *clients, struct set // Replay those lines! for (int i = 0; i < numlines; i++) { - if (!readreplayline(replayseconds, i, outgoingmsg, settings->basedir)) { + if (!readreplayline(replayseconds, i, outgoingmsg, settings->basedir, settings->replaydates)) { debugprint(DEBUG_CRIT, "Error requesting replay line.\n"); return 0; } @@ -1124,6 +1124,15 @@ int rehash(struct settings *settings, char *failuremsg) { return 0; } + // Should sending replay logs include a datestamp? + int oldreplaydates = settings->replaydates; + settings->replaydates = getconfint("replaydates", settings->conffile); + if (errno == ECONFINT) { + settings->replaydates = oldreplaydates; + strcpy(failuremsg, "error getting 'replaydates' from configuration file"); + return 0; + } + // What is the password? char oldpassword[MAXCHAR]; strcpy(oldpassword, settings->password); -- cgit v1.2.3