struct websock *wsi = ws->ws;
if (wsi != NULL) {
ws->ws = NULL;
+ fdev_set_callback(ws->fdev, NULL, 0);
fdev_unref(ws->fdev);
websock_destroy(wsi);
free(ws->buffer.buffer);
static void fdevcb(void *ws, uint32_t revents, struct fdev *fdev)
{
- if ((revents & EPOLLIN) != 0)
- aws_on_readable(ws);
if ((revents & EPOLLHUP) != 0)
afb_ws_hangup(ws);
+ else if ((revents & EPOLLIN) != 0)
+ aws_on_readable(ws);
}
/*