diff --git a/lib/core-net/close.c b/lib/core-net/close.c index 4162702d2..95f2201ef 100644 --- a/lib/core-net/close.c +++ b/lib/core-net/close.c @@ -376,9 +376,12 @@ just_kill_connection: #if !defined(LWS_NO_CLIENT) if ((lwsi_state(wsi) == LRS_WAITING_SERVER_REPLY || lwsi_state(wsi) == LRS_WAITING_CONNECT) && - !wsi->already_did_cce && wsi->protocol) + !wsi->already_did_cce && wsi->protocol) { + static const char _reason[] = "closed before established"; + lws_inform_client_conn_fail(wsi, - (void *)"closed before established", 24); + (void *)_reason, sizeof(_reason)); + } #endif /*