Skip to content
Snippets Groups Projects
Commit bbedb793 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

events: reinserted mem_trim() where appropriate

parent 8332e2f4
Branches
Tags
No related merge requests found
......@@ -200,9 +200,6 @@ static int process_authenticated(uint16_t *rcode, struct query_data *qdata)
update_cleanup(ddns_chs);
changesets_free(&ddns_chs, NULL);
/* Trim extra heap. */
mem_trim();
/* Sync zonefile immediately if configured. */
if (zone->conf->dbsync_timeout == 0) {
zone_events_schedule(zone, ZONE_EVENT_FLUSH, ZONE_EVENT_NOW);
......
......@@ -591,14 +591,14 @@ int server_update_zones(const struct conf_t *conf, void *data)
/* Reload zone database and free old zones. */
int ret = zonedb_reload(conf, server);
/* Trim extra heap. */
mem_trim();
/* Plan events on new zones. */
if (server->zone_db) {
knot_zonedb_foreach(server->zone_db, zone_events_start);
}
/* Trim extra heap. */
mem_trim();
return ret;
}
......
......@@ -259,6 +259,9 @@ static int event_reload(zone_t *zone)
zone_contents_deep_free(&old);
}
/* Trim extra heap. */
mem_trim();
/* Schedule notify and refresh after load. */
if (zone_master(zone)) {
zone_events_schedule(zone, ZONE_EVENT_REFRESH, ZONE_EVENT_NOW);
......@@ -339,6 +342,8 @@ static int event_xfer(zone_t *zone)
zone_events_schedule(zone, ZONE_EVENT_NOTIFY, ZONE_EVENT_NOW);
zone->bootstrap_retry = ZONE_EVENT_NOW;
zone->flags &= ~ZONE_FORCE_AXFR;
/* Trim extra heap. */
mem_trim();
} else {
/* Zone contents is still empty, increment bootstrap retry timer
* and try again. */
......@@ -390,6 +395,9 @@ static int event_update(zone_t *zone)
knot_pkt_free(&update->query);
free(update);
/* Trim extra heap. */
mem_trim();
return KNOT_EOK;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment