mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
smd: add warning for queue depth
This commit is contained in:
parent
e11d78dc5e
commit
a13b34db1c
3 changed files with 8 additions and 2 deletions
|
@ -30,7 +30,7 @@
|
|||
#define LWS_SMD_INFLIGHT_GRACE_SECS (2)
|
||||
#endif
|
||||
#if !defined(LWS_SMD_MAX_QUEUE_DEPTH)
|
||||
#define LWS_SMD_MAX_QUEUE_DEPTH (12)
|
||||
#define LWS_SMD_MAX_QUEUE_DEPTH (20)
|
||||
#endif
|
||||
|
||||
#if defined(LWS_WITH_SECURE_STREAMS)
|
||||
|
|
|
@ -131,9 +131,12 @@ lws_smd_msg_send(struct lws_context *ctx, void *pay)
|
|||
lws_smd_msg_t *msg = (lws_smd_msg_t *)(((uint8_t *)pay) -
|
||||
LWS_SMD_SS_RX_HEADER_LEN_EFF - sizeof(*msg));
|
||||
|
||||
if (ctx->smd.owner_messages.count >= LWS_SMD_MAX_QUEUE_DEPTH)
|
||||
if (ctx->smd.owner_messages.count >= LWS_SMD_MAX_QUEUE_DEPTH) {
|
||||
lwsl_warn("%s: rejecting message on queue depth %d\n",
|
||||
__func__, (int)ctx->smd.owner_messages.count);
|
||||
/* reject the message due to max queue depth reached */
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ctx->smd.delivering)
|
||||
lws_mutex_lock(ctx->smd.lock_peers); /* +++++++++++++++ peers */
|
||||
|
|
|
@ -68,6 +68,9 @@ _thread_spam(void *d)
|
|||
(unsigned int)n)) {
|
||||
lwsl_info("%s: send failed\n", __func__);
|
||||
n--;
|
||||
fail++;
|
||||
interrupted = 1;
|
||||
lws_cancel_service(context);
|
||||
}
|
||||
#if defined(WIN32)
|
||||
Sleep(3);
|
||||
|
|
Loading…
Add table
Reference in a new issue