/*
- * Copyright 2016 IoT.bzh
+ * Copyright (C) 2016 "IoT.bzh"
* Author: José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
static void wsreq_unref(struct afb_wsreq *wsreq)
{
if (--wsreq->refcount == 0) {
+ struct afb_wsreq **prv = &wsreq->aws->requests;
+ while(*prv != NULL) {
+ if (*prv == wsreq) {
+ *prv = wsreq->next;
+ break;
+ }
+ prv = &(*prv)->next;
+ }
afb_context_disconnect(&wsreq->context);
+ json_object_put(wsreq->root);
free(wsreq->text);
free(wsreq);
}