summaryrefslogtreecommitdiff
path: root/functions.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-09-07 12:43:04 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-09-07 12:43:04 +0100
commite4d1706031540ae74ff104c44adeb735ee0bfcf4 (patch)
tree46e12bb133f0810bf9f535ad8f34a7415746c31f /functions.c
parent38bd2b2761b7d0f556945ffad78f73536e12e157 (diff)
Add a configuration option to include the date in the timestamp when replaying the replay log.
Diffstat (limited to 'functions.c')
-rw-r--r--functions.c11
1 files changed, 10 insertions, 1 deletions
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);