only report CLIENT_CONNECTION_ERROR once on some paths

In most cases the close api will see it should send the CCE because
we are still in the waiting server reply state until the end of the
interpretation.  Only if we completed the interpretation and moved
on to ESTABLISHED do we need to handle sending it ourselves.

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2016-01-14 11:38:31 +08:00
parent 389a4bb9f0
commit 7c15eb1e42

View file

@ -855,7 +855,7 @@ bail3:
close_reason = LWS_CLOSE_STATUS_NOSTATUS;
bail2:
if (wsi->protocol) {
if (wsi->protocol && wsi->state == LWSS_ESTABLISHED) {
if (isErrorCodeReceived && p) {
wsi->protocol->callback(wsi,
LWS_CALLBACK_CLIENT_CONNECTION_ERROR,