+static void response_open_no_status(struct http_channel *c, const char *command)
+{
+ wrbuf_rewind(c->wrbuf);
+ wrbuf_printf(c->wrbuf, "%s<%s>",
+ HTTP_COMMAND_RESPONSE_PREFIX, command);
+}
+
+static void response_open(struct http_channel *c, const char *command)
+{
+ response_open_no_status(c, command);
+ wrbuf_puts(c->wrbuf, "<status>OK</status>");
+}
+
+static void response_close(struct http_channel *c, const char *command)
+{
+ struct http_response *rs = c->response;
+
+ wrbuf_printf(c->wrbuf, "</%s>", command);
+ rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf));
+ http_send_response(c);
+}
+