2022-03-10 17:06:31 +00:00
|
|
|
From bdbbb4be07bb33fe083baef2bd0ef38b91c11120 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Pavel Zhukov <pzhukov@redhat.com>
|
|
|
|
Date: Thu, 21 Feb 2019 10:44:06 +0100
|
|
|
|
Subject: [PATCH 21/28] Load leases DB in non-replay mode only
|
2019-03-01 11:50:13 +00:00
|
|
|
|
2022-03-10 17:06:31 +00:00
|
|
|
---
|
|
|
|
server/confpars.c | 12 ++++++++++--
|
|
|
|
1 file changed, 10 insertions(+), 2 deletions(-)
|
2019-03-01 11:50:13 +00:00
|
|
|
|
2018-09-24 13:01:32 +00:00
|
|
|
diff --git a/server/confpars.c b/server/confpars.c
|
2022-03-10 17:06:31 +00:00
|
|
|
index 5a6396b..6e08ad7 100644
|
2018-09-24 13:01:32 +00:00
|
|
|
--- a/server/confpars.c
|
|
|
|
+++ b/server/confpars.c
|
|
|
|
@@ -134,6 +134,11 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
|
|
|
|
|
|
|
|
cfile = (struct parse *)0;
|
|
|
|
#if defined (TRACING)
|
|
|
|
+ // No need to dmalloc huge memory region if we're not going to re-play
|
2019-11-27 12:09:00 +00:00
|
|
|
+ if (!trace_record()){
|
2018-09-24 13:01:32 +00:00
|
|
|
+ status = new_parse(&cfile, file, NULL, 0, filename, 0);
|
|
|
|
+ goto noreplay;
|
|
|
|
+ };
|
|
|
|
flen = lseek (file, (off_t)0, SEEK_END);
|
|
|
|
if (flen < 0) {
|
|
|
|
boom:
|
2019-11-27 12:09:00 +00:00
|
|
|
@@ -165,7 +170,6 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
|
|
|
|
if (result != ulen)
|
|
|
|
log_fatal ("%s: short read of %d bytes instead of %d.",
|
|
|
|
filename, ulen, result);
|
|
|
|
- close (file);
|
|
|
|
memfile:
|
|
|
|
/* If we're recording, write out the filename and file contents. */
|
2018-09-24 13:01:32 +00:00
|
|
|
if (trace_record ())
|
2019-11-27 12:09:00 +00:00
|
|
|
@@ -174,6 +178,9 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
|
2018-09-24 13:01:32 +00:00
|
|
|
#else
|
|
|
|
status = new_parse(&cfile, file, NULL, 0, filename, 0);
|
|
|
|
#endif
|
2019-03-01 11:50:13 +00:00
|
|
|
+ noreplay:
|
2019-11-27 12:09:00 +00:00
|
|
|
+ if (!trace_playback())
|
|
|
|
+ close (file);
|
2019-03-01 11:50:13 +00:00
|
|
|
if (status != ISC_R_SUCCESS || cfile == NULL)
|
|
|
|
return status;
|
|
|
|
|
2019-11-27 12:09:00 +00:00
|
|
|
@@ -183,7 +190,8 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
|
2018-09-24 13:01:32 +00:00
|
|
|
status = conf_file_subparse (cfile, group, group_type);
|
|
|
|
end_parse (&cfile);
|
2019-11-27 12:09:00 +00:00
|
|
|
#if defined (TRACING)
|
2018-09-24 13:01:32 +00:00
|
|
|
- dfree (dbuf, MDL);
|
2019-11-27 12:09:00 +00:00
|
|
|
+ if (trace_record())
|
|
|
|
+ dfree (dbuf, MDL);
|
|
|
|
#endif
|
2018-09-24 13:01:32 +00:00
|
|
|
return status;
|
|
|
|
}
|
2022-03-10 17:06:31 +00:00
|
|
|
--
|
|
|
|
2.35.1
|
|
|
|
|