Fix excessive calls to message retry check.

pull/145/head
Roger A. Light 10 years ago
parent 17e942e9b5
commit 011de7ed19

@ -6,6 +6,7 @@ Broker:
connect. Closes #477571.
- Fix cross compiling of websockets. Closes #475807.
- Fix memory free related crashes on openwrt. Closes #475707.
- Fix excessive calls to message retry check.
1.4.3 - 20150818

@ -115,6 +115,7 @@ int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int li
#endif
int context_count;
time_t expiration_check_time = 0;
time_t last_timeout_check = 0;
char *id;
#ifndef WIN32
@ -307,7 +308,11 @@ int mosquitto_main_loop(struct mosquitto_db *db, mosq_sock_t *listensock, int li
expiration_check_time = time(NULL) + 3600;
}
mqtt3_db_message_timeout_check(db, db->config->retry_interval);
if(last_timeout_check < mosquitto_time()){
/* Only check at most once per second. */
mqtt3_db_message_timeout_check(db, db->config->retry_interval);
last_timeout_check = mosquitto_time();
}
#ifndef WIN32
sigprocmask(SIG_SETMASK, &sigblock, &origsig);

Loading…
Cancel
Save