aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-stub-ws.c
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2018-08-20 17:45:42 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-08-23 08:35:38 +0200
commite36f8d572ca660f5c06fe45297d13c7a6818cc65 (patch)
tree51cf8b93d3d7a636d2f6fbab8057f10ee0f3ef0d /src/afb-stub-ws.c
parenta1a507793efff92b35603e4948e9f6dff4fba99c (diff)
Send error replies on disconnection
The pending calls receive an error notification when the server hang up. Bug-AGL: SPEC-1668 Change-Id: I052dca5e338a7650d7630856e21f1d3a81c6f265 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-stub-ws.c')
-rw-r--r--src/afb-stub-ws.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/afb-stub-ws.c b/src/afb-stub-ws.c
index 10b3fc77..ae83e534 100644
--- a/src/afb-stub-ws.c
+++ b/src/afb-stub-ws.c
@@ -430,8 +430,7 @@ static void release_all_sessions(struct afb_stub_ws *stubws)
{
struct server_session *s, *n;
- s = stubws->sessions;
- stubws->sessions = NULL;
+ s = __atomic_exchange_n(&stubws->sessions, NULL, __ATOMIC_RELAXED);
while(s) {
n = s->next;
afb_session_unref(s->session);