[259] Fix crash when "lazy" type bridge attempts to reconnect.

Thanks to hakofugu41.

Bug: https://github.com/eclipse/mosquitto/issues/259
pull/223/merge
Roger A. Light 9 years ago
parent 20197e2496
commit 6b68371dbe

@ -1,3 +1,6 @@
Broker:
- Fix crash when "lazy" type bridge attempts to reconnect. Closes #259.
1.4.10 - 20160816
=================

@ -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;

Loading…
Cancel
Save