Skip to content

Commit 088972b

Browse files
committed
lejp-conf: add default retry at lws level
1 parent 3a3e5ac commit 088972b

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

lib/roles/http/server/lejp-conf.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,28 @@ lwsws_get_config_globals(struct lws_context_creation_info *info, const char *d,
11261126
return 0;
11271127
}
11281128

1129+
#if 0
1130+
typedef struct lws_retry_bo {
1131+
const uint32_t *retry_ms_table; /* base delay in ms */
1132+
uint16_t retry_ms_table_count; /* entries in table */
1133+
uint16_t conceal_count; /* max retries to conceal */
1134+
uint16_t secs_since_valid_ping; /* idle before PING issued */
1135+
uint16_t secs_since_valid_hangup; /* idle before hangup conn */
1136+
uint8_t jitter_percent; /* % additional random jitter */
1137+
} lws_retry_bo_t;
1138+
#endif
1139+
1140+
static const uint32_t rmst[] = { 1000, 2000, 5000, 10000, 30000 };
1141+
1142+
static const lws_retry_bo_t rebo = {
1143+
.retry_ms_table = rmst,
1144+
.retry_ms_table_count = LWS_ARRAY_SIZE(rmst),
1145+
.conceal_count = 2,
1146+
.secs_since_valid_ping = 15,
1147+
.secs_since_valid_hangup = 20,
1148+
.jitter_percent = 25,
1149+
};
1150+
11291151
int
11301152
lwsws_get_config_vhosts(struct lws_context *context,
11311153
struct lws_context_creation_info *info, const char *d,
@@ -1138,6 +1160,8 @@ lwsws_get_config_vhosts(struct lws_context *context,
11381160
memset(&a, 0, sizeof(a));
11391161

11401162
a.info = info;
1163+
if (!a.info->retry_and_idle_policy)
1164+
a.info->retry_and_idle_policy = &rebo;
11411165
a.p = *cs;
11421166
a.end = a.p + *len;
11431167
a.valid = 0;

0 commit comments

Comments
 (0)