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 897eb02431
commit c42c2adba9

View file

@ -417,11 +417,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)