1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

retry: handle empty retry table

This commit is contained in:
Andy Green 2021-11-06 09:09:32 +00:00
parent 252890d19c
commit a81c7cccd0

View file

@ -496,11 +496,13 @@ lws_retry_get_delay_ms(struct lws_context *context,
*conceal = 0;
if (retry) {
if (*ctry < retry->retry_ms_table_count)
ms = retry->retry_ms_table[*ctry];
else
ms = retry->retry_ms_table[
retry->retry_ms_table_count - 1];
if (retry->retry_ms_table_count) {
if (*ctry < retry->retry_ms_table_count)
ms = retry->retry_ms_table[*ctry];
else
ms = retry->retry_ms_table[
retry->retry_ms_table_count - 1];
}
/* if no percent given, use the default 30% */
if (retry->jitter_percent)