Skip to content

Commit

Permalink
Fix potential intermittent initial bridge connections when using poll().
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Jan 6, 2021
1 parent a69f125 commit 93c730f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Broker:
Closes #1979.
- Fix apparmor incorrectly denying access to
/var/lib/mosquitto/mosquitto.db.new. Closes #1978.
- Fix potential intermittent initial bridge connections when using poll().


2.0.4 - 2020-12-22
Expand Down
4 changes: 1 addition & 3 deletions src/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,19 +568,17 @@ int bridge__on_connect(struct mosquitto *context)

int bridge__register_local_connections(void)
{
#ifdef WITH_EPOLL
struct mosquitto *context, *ctxt_tmp = NULL;

HASH_ITER(hh_sock, db.contexts_by_sock, context, ctxt_tmp){
if(context->bridge){
if(mux__add_in(context)){
log__printf(NULL, MOSQ_LOG_ERR, "Error in epoll initial registering bridge: %s", strerror(errno));
log__printf(NULL, MOSQ_LOG_ERR, "Error in initial bridge registration: %s", strerror(errno));
return MOSQ_ERR_UNKNOWN;
}
mux__add_out(context);
}
}
#endif
return MOSQ_ERR_SUCCESS;
}

Expand Down

0 comments on commit 93c730f

Please sign in to comment.