Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Use afb_token in contexts
[src/app-framework-binder.git]
/
src
/
afb-ws.c
diff --git
a/src/afb-ws.c
b/src/afb-ws.c
index
ca04c7f
..
bb35c9d
100644
(file)
--- a/
src/afb-ws.c
+++ b/
src/afb-ws.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2016
, 2017, 2018
"IoT.bzh"
+ * Copyright (C) 2016
-2019
"IoT.bzh"
* Author: José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author: José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@
-120,6
+120,7
@@
static void aws_disconnect(struct afb_ws *ws, int call_on_hangup)
struct websock *wsi = ws->ws;
if (wsi != NULL) {
ws->ws = NULL;
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);
fdev_unref(ws->fdev);
websock_destroy(wsi);
free(ws->buffer.buffer);
@@
-131,10
+132,10
@@
static void aws_disconnect(struct afb_ws *ws, int call_on_hangup)
static void fdevcb(void *ws, uint32_t revents, struct fdev *fdev)
{
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);
if ((revents & EPOLLHUP) != 0)
afb_ws_hangup(ws);
+ else if ((revents & EPOLLIN) != 0)
+ aws_on_readable(ws);
}
/*
}
/*