mqtt3_db_message_timeout_check just initialize new_state out of loop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mosquitto |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
hi ,
in mqtt3_db_
it may be no bugs in reality, bug the code should better init new_state = mosq_ms_invalid; in the for、while loop.
maybe we need init it in the while loop .
int mqtt3_db_
{
int i;
time_t threshold;
enum mosquitto_msg_state new_state = mosq_ms_invalid;
struct mosquitto *context;
struct mosquitto_
threshold = mosquitto_time() - timeout;
for(i=0; i<db->context_
msg = context->msgs;
//add this line to init it every time.
new_state = mosq_ms_invalid;
}
}
return MOSQ_ERR_SUCCESS;
}
Changed in mosquitto: | |
milestone: | 1.4 → 1.3.2 |
status: | Fix Committed → Fix Released |
I agree, this doesn't look quite right but in practice probably didn't affect anything.
I've commited a change that fixes it.