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:
parent
897eb02431
commit
c42c2adba9
1 changed files with 7 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue