From 46c09b5da9b35616d8944f450f7700e7b9a4cde3 Mon Sep 17 00:00:00 2001 From: "drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Tue, 12 Feb 2008 14:56:33 +0000 Subject: BUILD : 1.7.21 (1385) BUGS : 862 NOTES : rdb_close() where rdb_open() is used in rdb_dbase() functions. git-svn-id: svn://svn.anope.org/anope/trunk@1385 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1100 5417fbe8-f217-4b02-8779-1006273d7864 --- src/botserv.c | 6 +++--- src/chanserv.c | 18 +++++++++++++++--- src/hostserv.c | 6 +++--- src/nickserv.c | 19 +++++++++++++------ src/operserv.c | 13 ++++++++++--- 5 files changed, 44 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/botserv.c b/src/botserv.c index 46f5fe3ac..827f3b392 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -544,6 +544,7 @@ void save_bs_rdb_dbase(void) if (rdb_tag_table("anope_bs_core") == 0) { alog("Unable to tag table 'anope_bs_core' - BotServ RDB save failed."); + rdb_close(); return; } @@ -551,15 +552,14 @@ void save_bs_rdb_dbase(void) for (bi = botlists[i]; bi; bi = bi->next) { if (rdb_save_bs_core(bi) == 0) { alog("Unable to save BotInfo for %s - BotServ RDB save failed.", bi->nick); + rdb_close(); return; } } } - if (rdb_clean_table("anope_bs_core") == 0) { + if (rdb_clean_table("anope_bs_core") == 0) alog("Unable to clean table 'anope_bs_core' - BotServ RDB save failed."); - return; - } rdb_close(); #endif diff --git a/src/chanserv.c b/src/chanserv.c index d2fcc4d60..1d2b349f6 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -998,30 +998,37 @@ void save_cs_rdb_dbase(void) if (rdb_tag_table("anope_cs_info") == 0) { alog("Unable to tag table 'anope_cs_info' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_cs_access") == 0) { alog("Unable to tag table 'anope_cs_access' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_cs_levels") == 0) { alog("Unable to tag table 'anope_cs_levels' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_cs_akicks") == 0) { alog("Unable to tag table 'anope_cs_akicks' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_cs_badwords") == 0) { alog("Unable to tag table 'anope_cs_badwords' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_cs_ttb") == 0) { alog("Unable to tag table 'anope_cs_ttb' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table_where("anope_ms_info", "serv='CHAN'") == 0) { alog("Unable to tag table 'anope_ms_info' - ChanServ RDB save failed."); + rdb_close(); return; } @@ -1029,6 +1036,7 @@ void save_cs_rdb_dbase(void) for (ci = chanlists[i]; ci; ci = ci->next) { if (rdb_save_cs_info(ci) == 0) { alog("Unable to save ChanInfo for %s - ChanServ RDB save failed.", ci->name); + rdb_close(); return; } } /* for (chanlists[i]) */ @@ -1036,32 +1044,36 @@ void save_cs_rdb_dbase(void) if (rdb_clean_table("anope_cs_info") == 0) { alog("Unable to clean table 'anope_cs_info' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_clean_table("anope_cs_access") == 0) { alog("Unable to clean table 'anope_cs_access' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_clean_table("anope_cs_levels") == 0) { alog("Unable to clean table 'anope_cs_levels' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_clean_table("anope_cs_akicks") == 0) { alog("Unable to clean table 'anope_cs_akicks' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_clean_table("anope_cs_badwords") == 0) { alog("Unable to clean table 'anope_cs_badwords' - ChanServ RDB save failed."); + rdb_close(); return; } if (rdb_clean_table("anope_cs_ttb") == 0) { alog("Unable to clean table 'anope_cs_ttb' - ChanServ RDB save failed."); + rdb_close(); return; } - if (rdb_clean_table_where("anope_ms_info", "serv='CHAN'") == 0) { + if (rdb_clean_table_where("anope_ms_info", "serv='CHAN'") == 0) alog("Unable to clean table 'anope_ms_info' - ChanServ RDB save failed."); - return; - } rdb_close(); #endif diff --git a/src/hostserv.c b/src/hostserv.c index 02f4fa170..3f2a3c934 100644 --- a/src/hostserv.c +++ b/src/hostserv.c @@ -509,6 +509,7 @@ void save_hs_rdb_dbase(void) if (rdb_tag_table("anope_hs_core") == 0) { alog("Unable to tag table 'anope_hs_core' - HostServ RDB save failed."); + rdb_close(); return; } @@ -516,15 +517,14 @@ void save_hs_rdb_dbase(void) while (current != NULL) { if (rdb_save_hs_core(current) == 0) { alog("Unable to save HostCore for %s - HostServ RDB save failed.", current->nick); + rdb_close(); return; } current = current->next; } - if (rdb_clean_table("anope_hs_core") == 0) { + if (rdb_clean_table("anope_hs_core") == 0) alog("Unable to clean table 'anope_hs_core' - HostServ RDB save failed."); - return; - } rdb_close(); #endif diff --git a/src/nickserv.c b/src/nickserv.c index 1ea70c7e9..5e8afb423 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -860,18 +860,22 @@ void save_ns_rdb_dbase(void) if (rdb_tag_table("anope_ns_core") == 0) { alog("Unable to tag 'anope_ns_core' - NickServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_ns_alias") == 0) { alog("Unable to tag 'anope_ns_alias' - NickServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_ns_access") == 0) { alog("Unable to tag 'anope_ns_access' - NickServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table_where("anope_ms_info", "serv='NICK'") == 0) { alog("Unable to tag 'anope_ms_info' - NickServ RDB save failed."); + rdb_close(); return; } @@ -879,6 +883,7 @@ void save_ns_rdb_dbase(void) for (nc = nclists[i]; nc; nc = nc->next) { if (rdb_save_ns_core(nc) == 0) { alog("Unable to save NickCore for '%s' - NickServ RDB save failed.", nc->display); + rdb_close(); return; } } /* for (nc) */ @@ -888,6 +893,7 @@ void save_ns_rdb_dbase(void) for (na = nalists[i]; na; na = na->next) { if (rdb_save_ns_alias(na) == 0) { alog("Unable to save NickAlias for '%s' - NickServ RDB save failed.", na->nick); + rdb_close(); return; } } /* for (na) */ @@ -895,20 +901,21 @@ void save_ns_rdb_dbase(void) if (rdb_clean_table("anope_ns_core") == 0) { alog("Unable to clean table 'anope_ns_core' - NickServ RDB save failed."); + rdb_close(); return; } if (rdb_clean_table("anope_ns_alias") == 0) { alog("Unable to clean table 'anope_ns_alias' - NickServ RDB save failed."); + rdb_close(); return; } if (rdb_clean_table("anope_ns_access") == 0) { alog("Unable to clean table 'anope_ns_access' - NickServ RDB save failed."); + rdb_close(); return; } - if (rdb_clean_table_where("anope_ms_info", "serv='NICK'") == 0) { + if (rdb_clean_table_where("anope_ms_info", "serv='NICK'") == 0) alog("Unable to clean table 'anope_ms_info' - NickServ RDB save failed."); - return; - } rdb_close(); #endif @@ -925,6 +932,7 @@ void save_ns_req_rdb_dbase(void) if (rdb_tag_table("anope_ns_request") == 0) { alog("Unable to tag table 'anope_ns_request' - NickServ Request RDB save failed."); + rdb_close(); return; } @@ -933,15 +941,14 @@ void save_ns_req_rdb_dbase(void) if (rdb_save_ns_req(nr) == 0) { /* Something went wrong - abort saving */ alog("Unable to save NickRequest (nick '%s') - NickServ Request RDB save failed.", nr->nick); + rdb_close(); return; } } } - if (rdb_clean_table("anope_ns_request") == 0) { + if (rdb_clean_table("anope_ns_request") == 0) alog("Unable to clean table 'anope_ns_request' - NickServ Request RDB save failed."); - return; - } rdb_close(); #endif diff --git a/src/operserv.c b/src/operserv.c index d9c363b5d..ded9069eb 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -505,23 +505,28 @@ void save_os_rdb_dbase(void) if (rdb_tag_table("anope_os_akills") == 0) { alog("Unable to tag table 'anope_os_akills' - OperServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_os_sglines") == 0) { alog("Unable to tag table 'anope_os_sglines' - OperServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_os_sqlines") == 0) { alog("Unable to tag table 'anope_os_sqlines' - OperServ RDB save failed."); + rdb_close(); return; } if (rdb_tag_table("anope_os_szlines") == 0) { alog("Unable to tag table 'anope_os_szlines' - OperServ RDB save failed."); + rdb_close(); return; } /* We empty anope_os_core as required */ if (rdb_empty_table("anope_os_core") == 0) { alog("Unable to empty table 'anope_os_core' - OperServ RDB save failed"); + rdb_close(); return; } @@ -529,25 +534,27 @@ void save_os_rdb_dbase(void) (maxusercnt, maxusertime, &akills, &sglines, &sqlines, &szlines) == 0) { alog("Unable to save OperServ data - OperServ RDB save failed"); + rdb_close(); return; } if (rdb_clean_table("anope_os_akills") == 0) { alog("Unable to clean table 'anope_os_akills' - OperServ RDB save failed."); + rdb_close(); return; } if (rdb_clean_table("anope_os_sglines") == 0) { alog("Unable to clean table 'anope_os_sglines' - OperServ RDB save failed."); + rdb_close(); return; } if (rdb_clean_table("anope_os_sqlines") == 0) { alog("Unable to clean table 'anope_os_sqlines' - OperServ RDB save failed."); + rdb_close(); return; } - if (rdb_clean_table("anope_os_szlines") == 0) { + if (rdb_clean_table("anope_os_szlines") == 0) alog("Unable to clean table 'anope_os_szlines' - OperServ RDB save failed."); - return; - } rdb_close(); #endif -- cgit