From: Jaroslav Kysela Date: Mon, 10 Nov 2014 19:32:10 +0000 (+0100) Subject: access, esfilter: reindex calls fix, fixes #2462 X-Git-Tag: v4.1~788 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c00e47c247f0846ab6008d005df32fc9e3c8d99;p=thirdparty%2Ftvheadend.git access, esfilter: reindex calls fix, fixes #2462 --- diff --git a/src/access.c b/src/access.c index da3ce36fc..f4e2c0058 100644 --- a/src/access.c +++ b/src/access.c @@ -843,6 +843,7 @@ access_entry_create(const char *uuid, htsmsg_t *conf) TAILQ_INSERT_TAIL(&access_entries, ae, ae_link); } else { TAILQ_INSERT_TAIL(&access_entries, ae, ae_link); + access_entry_reindex(); } if (ae->ae_username == NULL) @@ -854,8 +855,6 @@ access_entry_create(const char *uuid, htsmsg_t *conf) if (TAILQ_FIRST(&ae->ae_ipmasks) == NULL) access_set_prefix_default(ae); - access_entry_reindex(); - return ae; } @@ -1357,6 +1356,7 @@ access_init(int createdefault, int noacl) (void)access_entry_create(f->hmf_name, m); } htsmsg_destroy(c); + access_entry_reindex(); } if(TAILQ_FIRST(&access_entries) == NULL) { diff --git a/src/esfilter.c b/src/esfilter.c index 802e0e5d2..6dabd87ff 100644 --- a/src/esfilter.c +++ b/src/esfilter.c @@ -180,8 +180,9 @@ esfilter_create TAILQ_INSERT_SORTED(&esfilters[esf->esf_class], esf, esf_link, esfilter_cmp); } else { TAILQ_INSERT_TAIL(&esfilters[esf->esf_class], esf, esf_link); - esfilter_reindex(esf->esf_class); } + if (!conf) + esfilter_reindex(esf->esf_class); if (save) esfilter_class_save((idnode_t *)esf); return esf; @@ -1045,6 +1046,9 @@ esfilter_init(void) esfilter_create(-1, f->hmf_name, e, 0); } htsmsg_destroy(c); + + for (i = 0; i <= ESF_CLASS_LAST; i++) + esfilter_reindex(i); } void