reorder ws disconnect order a bit.

This commit is contained in:
Joris Vink 2017-01-30 22:25:08 +01:00
parent 8b26ecdf14
commit 587a663f31
1 changed files with 3 additions and 3 deletions

View File

@ -353,11 +353,11 @@ websocket_recv_frame(struct netbuf *nb)
static void
websocket_disconnect(struct connection *c)
{
if (c->ws_disconnect != NULL)
kore_runtime_wsdisconnect(c->ws_disconnect, c);
if (!(c->flags & CONN_WS_CLOSE_SENT)) {
c->flags |= CONN_WS_CLOSE_SENT;
kore_websocket_send(c, WEBSOCKET_OP_CLOSE, NULL, 0);
}
if (c->ws_disconnect != NULL)
kore_runtime_wsdisconnect(c->ws_disconnect, c);
}