mux init must happen before bridges are started.
This commit is contained in:
parent
f1f0396d86
commit
702aaabee2
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user