Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/lbbs.logrotate.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
create 640 bbs bbs
sharedscripts
postrotate
systemctl reload bbsd.service > /dev/null 2>/dev/null || true
systemctl reload lbbs.service > /dev/null 2>/dev/null || true
endscript
}
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([lbbs],[1.7.7])
AC_INIT([lbbs],[1.7.8])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
Expand Down
10 changes: 2 additions & 8 deletions src/net_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,20 +830,14 @@ int net_server(const char *hostaddr, in_port_t port[])
BBS_eula_tm = file_stat.st_mtim.tv_sec;
}

if (detach_menu_shm(&bbs_menu) < 0)
{
log_error("detach_menu_shm(bbs_menu) error");
}
unload_menu(&bbs_menu);
if (load_menu(&bbs_menu, CONF_MENU) < 0)
{
log_error("load_menu(bbs_menu) error");
unload_menu(&bbs_menu);
}

if (detach_menu_shm(&top10_menu) < 0)
{
log_error("detach_menu_shm(top10_menu) error");
}
unload_menu(&top10_menu);
if (load_menu(&top10_menu, CONF_TOP10_MENU) < 0)
{
log_error("load_menu(top10_menu) error");
Expand Down
21 changes: 15 additions & 6 deletions src/section_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,14 +887,23 @@ int section_list_append_article(SECTION_LIST *p_section, const ARTICLE *p_articl
if (p_topic_head == NULL)
{
log_error("search head of topic (aid=%d) error", p_article->tid);
return -4;
}

p_topic_tail = p_topic_head->p_topic_prior;
if (p_topic_tail == NULL)
p_article->tid = 0; // Reset tid to 0 to avoid linking to non-existing topic
p_article->visible = 0; // Set invisible to avoid being displayed in topic list

p_section->topic_count++;

p_topic_head = p_article;
p_topic_tail = p_article;
}
else
{
log_error("tail of topic (aid=%d) is NULL", p_article->tid);
return -4;
p_topic_tail = p_topic_head->p_topic_prior;
if (p_topic_tail == NULL)
{
log_error("tail of topic (aid=%d) is NULL", p_article->tid);
return -4;
}
}
}
else
Expand Down
5 changes: 1 addition & 4 deletions src/section_list_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,7 @@ int load_section_config_from_db(int update_gen_ex)
{
snprintf(ex_menu_conf, sizeof(ex_menu_conf), "%s/%d", VAR_GEN_EX_MENU_DIR, p_section->sid);

if (detach_menu_shm(&(p_section->ex_menu_set)) < 0)
{
log_error("detach_menu_shm(%s) error", ex_menu_conf);
}
unload_menu(&(p_section->ex_menu_set));
if (load_menu(&(p_section->ex_menu_set), ex_menu_conf) < 0)
{
log_error("load_menu(%s) error", ex_menu_conf);
Expand Down
21 changes: 14 additions & 7 deletions src/trie_dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,27 @@ TRIE_NODE *trie_dict_create(void)
{
TRIE_NODE *p_dict = NULL;

if (p_trie_node_pool != NULL && p_trie_node_pool->p_node_free_list != NULL)
if (p_trie_node_pool == NULL)
{
p_dict = p_trie_node_pool->p_node_free_list;
p_trie_node_pool->p_node_free_list = p_dict->p_nodes[0];
log_error("trie_dict_pool not initialized");
return NULL;
}

memset(p_dict, 0, sizeof(*p_dict));
log_debug("trie_dict_node used %d of %d", p_trie_node_pool->node_count, p_trie_node_pool->node_count_limit);

p_trie_node_pool->node_count++;
}
else if (p_trie_node_pool != NULL)
if (p_trie_node_pool->p_node_free_list == NULL)
{
log_error("trie_dict_create() error: node depleted %d >= %d", p_trie_node_pool->node_count, p_trie_node_pool->node_count_limit);
return NULL;
}

p_dict = p_trie_node_pool->p_node_free_list;
p_trie_node_pool->p_node_free_list = p_dict->p_nodes[0];

memset(p_dict, 0, sizeof(*p_dict));

p_trie_node_pool->node_count++;

return p_dict;
}

Expand Down
Loading