mux init must happen before bridges are started.

This commit is contained in:
Roger Light 2021-04-14 23:06:16 +01:00
parent f1f0396d86
commit 702aaabee2
3 changed files with 6 additions and 4 deletions

View File

@ -182,9 +182,6 @@ int mosquitto_main_loop(struct mosquitto__listener_sock *listensock, int listens
db.now_s = mosquitto_time();
db.now_real_s = time(NULL);
rc = mux__init(listensock, listensock_count);
if(rc) return rc;
#ifdef WITH_BRIDGE
rc = bridge__register_local_connections();
if(rc) return rc;

View File

@ -544,6 +544,9 @@ int main(int argc, char *argv[])
if(listeners__start()) return 1;
rc = mux__init(listensock, listensock_count);
if(rc) return rc;
signal__setup();
#ifdef WITH_BRIDGE

View File

@ -152,8 +152,10 @@ int mux_epoll__add_in(struct mosquitto *context)
ev.events = EPOLLIN;
ev.data.ptr = context;
if (epoll_ctl(db.epollfd, EPOLL_CTL_ADD, context->sock, &ev) == -1) {
if(errno != EEXIST){
log__printf(NULL, MOSQ_LOG_ERR, "Error in epoll accepting: %s", strerror(errno));
}
}
context->events = EPOLLIN;
return MOSQ_ERR_SUCCESS;
}