mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-21 15:23:46 +08:00
[259] Fix crash when "lazy" type bridge attempts to reconnect.
Thanks to hakofugu41. Bug: https://github.com/eclipse/mosquitto/issues/259
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
Broker:
|
||||
- Fix crash when "lazy" type bridge attempts to reconnect. Closes #259.
|
||||
|
||||
1.4.10 - 20160816
|
||||
=================
|
||||
|
||||
|
||||
+10
-1
@@ -246,7 +246,16 @@ int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int li
|
||||
}else{
|
||||
if(context->bridge->start_type == bst_lazy && context->bridge->lazy_reconnect){
|
||||
rc = mqtt3_bridge_connect(db, context);
|
||||
if(rc){
|
||||
if(rc == MOSQ_ERR_SUCCESS){
|
||||
pollfds[pollfd_index].fd = context->sock;
|
||||
pollfds[pollfd_index].events = POLLIN;
|
||||
pollfds[pollfd_index].revents = 0;
|
||||
if(context->current_out_packet){
|
||||
pollfds[pollfd_index].events |= POLLOUT;
|
||||
}
|
||||
context->pollfd_index = pollfd_index;
|
||||
pollfd_index++;
|
||||
}else{
|
||||
context->bridge->cur_address++;
|
||||
if(context->bridge->cur_address == context->bridge->address_count){
|
||||
context->bridge->cur_address = 0;
|
||||
|
||||
Reference in New Issue
Block a user