struct afb_wsreq
{
+ /*
+ * CAUTION: 'context' field should be the first because there
+ * is an implicit convertion to struct afb_context
+ */
struct afb_context context;
int refcount;
struct afb_ws_json1 *aws;
.context_get = (void*)afb_context_get,
.context_set = (void*)afb_context_set,
.addref = (void*)wsreq_addref,
- .unref = (void*)wsreq_unref
+ .unref = (void*)wsreq_unref,
+ .session_close = (void*)afb_context_close,
+ .session_set_LOA = (void*)afb_context_change_loa
};
static int aws_wsreq_parse(struct afb_wsreq *r, char *text, size_t size)
json_object_array_add(msg, json_object_new_string(token));
/* emits the reply */
- txt = json_object_to_json_string(msg);
+ txt = json_object_to_json_string_ext(msg, JSON_C_TO_STRING_PLAIN);
afb_ws_text(aws->ws, txt, strlen(txt));
json_object_put(msg);
}