Send error replies on disconnection
[src/app-framework-binder.git] / src / afb-stub-ws.c
index 8475ae6..ae83e53 100644 (file)
 struct afb_stub_ws;
 
 
-/*
- * structure for recording calls on client side
- */
-struct client_call {
-       struct client_call *next;       /* the next call */
-       struct afb_stub_ws *stubws;     /* the stub_ws */
-       struct afb_xreq *xreq;          /* the request handle */
-       uint32_t msgid;                 /* the message identifier */
-};
-
 /*
  * structure for a ws request
  */
@@ -440,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);