Index: roard/clients.c
===================================================================
--- roard/clients.c	(revision 3925)
+++ roard/clients.c	(revision 3926)
@@ -412,4 +412,5 @@
  int r;
  int rv = 0;
+ uint32_t flags[2] = {COMMAND_FLAG_NONE, COMMAND_FLAG_NONE};
 
  _CHECK_CID(id);
@@ -433,5 +434,5 @@
     oldcmd = m.cmd;
 
-    if ( (r = command_exec(id, &m, data)) == -1 ) {
+    if ( (r = command_exec(id, &m, &data, flags)) == -1 ) {
      m.cmd     = ROAR_CMD_ERROR;
      m.datalen = 0;
Index: roard/commands.c
===================================================================
--- roard/commands.c	(revision 3811)
+++ roard/commands.c	(revision 3926)
@@ -48,5 +48,5 @@
 
   {ROAR_CMD_EXEC_STREAM,  _NAME("EXEC_STREAM"),  req_on_exec_stream},
-  {ROAR_CMD_QUIT,         _NAME("QUIT"),         (int(*)(int client, struct roar_message * mes, char * data))clients_delete},
+  {ROAR_CMD_QUIT,         _NAME("QUIT"),         (int(*)(int client, struct roar_message * mes, char ** data, uint32_t flags[2]))clients_delete},
 
   {ROAR_CMD_CON_STREAM,   _NAME("CON_STREAM"),   req_on_con_stream},
@@ -91,7 +91,7 @@
 }
 
-int command_exec (int client, struct roar_message * mes, char * data) {
+int command_exec (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  int cmd = command_get_id_by_cmd(mes->cmd);
- int (*func)(int client, struct roar_message * mes, char * data);
+ int (*func)(int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
  if ( cmd == -1 )
@@ -103,5 +103,5 @@
  ROAR_DBG("command_exec(*): Execing command %i(%s) via %p", cmd, g_commands[cmd].name, func);
 
- return func(client, mes, data);
+ return func(client, mes, data, flags);
 }
 
Index: roard/include/commands.h
===================================================================
--- roard/include/commands.h	(revision 3811)
+++ roard/include/commands.h	(revision 3926)
@@ -21,5 +21,5 @@
  *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
  *  Boston, MA 02110-1301, USA.
- *
+ nd_exec*
  */
 
@@ -32,4 +32,7 @@
 #define COMMAND_MAX_COMMANDS 32
 
+#define COMMAND_FLAG_NONE          0x00000000
+#define COMMAND_FLAG_OUT_CLOSECON  0x00000001
+
 struct roar_command {
  int cmd;
@@ -39,9 +42,9 @@
  char * name;
 #endif
- int (*handler)(int client, struct roar_message * mes, char * data);
+ int (*handler)(int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 };
 
 int command_get_id_by_cmd (int command);
-int command_exec (int client, struct roar_message * mes, char * data);
+int command_exec (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 int command_get_name (int command, char ** name);
 
Index: roard/include/req.h
===================================================================
--- roard/include/req.h	(revision 3811)
+++ roard/include/req.h	(revision 3926)
@@ -29,49 +29,49 @@
 #include <roaraudio.h>
 
-int req_on_noop        (int client, struct roar_message * mes, char * data);
+int req_on_noop        (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_identify    (int client, struct roar_message * mes, char * data);
-int req_on_auth        (int client, struct roar_message * mes, char * data);
+int req_on_identify    (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_auth        (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_whoami      (int client, struct roar_message * mes, char * data);
+int req_on_whoami      (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_new_stream  (int client, struct roar_message * mes, char * data);
-int req_on_exec_stream (int client, struct roar_message * mes, char * data);
-int req_on_con_stream  (int client, struct roar_message * mes, char * data);
-int req_on_passfh      (int client, struct roar_message * mes, char * data);
+int req_on_new_stream  (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_exec_stream (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_con_stream  (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_passfh      (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
 #ifdef ROAR_SUPPORT_META
-int req_on_set_meta    (int client, struct roar_message * mes, char * data);
-int req_on_get_meta    (int client, struct roar_message * mes, char * data);
-int req_on_list_meta   (int client, struct roar_message * mes, char * data);
+int req_on_set_meta    (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_get_meta    (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_list_meta   (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 #endif
 
-int req_on_get_standby (int client, struct roar_message * mes, char * data);
-int req_on_set_standby (int client, struct roar_message * mes, char * data);
+int req_on_get_standby (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_set_standby (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_exit        (int client, struct roar_message * mes, char * data);
+int req_on_exit        (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_server_oinfo(int client, struct roar_message * mes, char * data);
+int req_on_server_oinfo(int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_list_clients(int client, struct roar_message * mes, char * data);
-int req_on_list_streams(int client, struct roar_message * mes, char * data);
+int req_on_list_clients(int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_list_streams(int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_get_client  (int client, struct roar_message * mes, char * data);
-int req_on_get_stream  (int client, struct roar_message * mes, char * data);
+int req_on_get_client  (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_get_stream  (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_get_stream_para (int client, struct roar_message * mes, char * data);
-int req_on_set_stream_para (int client, struct roar_message * mes, char * data);
+int req_on_get_stream_para (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_set_stream_para (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_kick        (int client, struct roar_message * mes, char * data);
-int req_on_attach      (int client, struct roar_message * mes, char * data);
+int req_on_kick        (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_attach      (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_set_vol     (int client, struct roar_message * mes, char * data);
-int req_on_get_vol     (int client, struct roar_message * mes, char * data);
+int req_on_set_vol     (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
+int req_on_get_vol     (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_add_data    (int client, struct roar_message * mes, char * data);
+int req_on_add_data    (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-int req_on_beep        (int client, struct roar_message * mes, char * data);
+int req_on_beep        (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
-//int req_on_ (int client, struct roar_message * mes, char * data);
+//int req_on_ (int client, struct roar_message * mes, char ** data, uint32_t flags[2]);
 
 #endif
Index: roard/req.c
===================================================================
--- roard/req.c	(revision 3802)
+++ roard/req.c	(revision 3926)
@@ -26,5 +26,5 @@
 #include "roard.h"
 
-int req_on_noop        (int client, struct roar_message * mes, char * data) {
+int req_on_noop        (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  mes->cmd     = ROAR_CMD_OK;
  mes->pos     = g_pos;
@@ -33,5 +33,5 @@
 }
 
-int req_on_identify    (int client, struct roar_message * mes, char * data) {
+int req_on_identify    (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  struct roar_client * c;
  int max_len;
@@ -67,5 +67,5 @@
 }
 
-int req_on_auth        (int client, struct roar_message * mes, char * data) {
+int req_on_auth        (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  // TODO: add code to support some auth.
  mes->cmd     = ROAR_CMD_OK;
@@ -76,5 +76,5 @@
 
 
-int req_on_whoami      (int client, struct roar_message * mes, char * data) {
+int req_on_whoami      (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  mes->cmd     = ROAR_CMD_OK;
  mes->pos     = g_pos;
@@ -85,5 +85,5 @@
 
 
-int req_on_new_stream  (int client, struct roar_message * mes, char * data) {
+int req_on_new_stream  (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  int stream;
  struct roar_stream * s;
@@ -230,5 +230,5 @@
 }
 
-int req_on_exec_stream (int client, struct roar_message * mes, char * data) {
+int req_on_exec_stream (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  int r;
 
@@ -245,5 +245,5 @@
 }
 
-int req_on_con_stream  (int client, struct roar_message * mes, char * data) {
+int req_on_con_stream  (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  char   host[80] = {0};
  int    port = 0;
@@ -294,5 +294,5 @@
 }
 
-int req_on_passfh      (int client, struct roar_message * mes, char * data) {
+int req_on_passfh      (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  int sock = clients_get_fh(client);
  int16_t * d = (int16_t*)mes->data;
@@ -366,5 +366,5 @@
 
 #ifdef ROAR_SUPPORT_META
-int req_on_set_meta    (int client, struct roar_message * mes, char * data) {
+int req_on_set_meta    (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  int type;
  int mode;
@@ -438,5 +438,5 @@
 }
 
-int req_on_get_meta    (int client, struct roar_message * mes, char * data) {
+int req_on_get_meta    (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  int vallen;
  int type;
@@ -469,5 +469,5 @@
 }
 
-int req_on_list_meta   (int client, struct roar_message * mes, char * data) {
+int req_on_list_meta   (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  int i;
  int len = 0;
@@ -494,5 +494,5 @@
 #endif
 
-int req_on_server_oinfo    (int client, struct roar_message * mes, char * data) {
+int req_on_server_oinfo    (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  struct roar_stream s;
 //ROAR_DIR_OUTPUT
@@ -517,5 +517,5 @@
 
 
-int req_on_get_standby (int client, struct roar_message * mes, char * data) {
+int req_on_get_standby (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  mes->cmd     = ROAR_CMD_OK;
  mes->pos     = g_pos;
@@ -527,5 +527,5 @@
 }
 
-int req_on_set_standby (int client, struct roar_message * mes, char * data) {
+int req_on_set_standby (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  if ( mes->datalen != 2 )
   return -1;
@@ -540,5 +540,5 @@
 }
 
-int req_on_exit      (int client, struct roar_message * mes, char * data) {
+int req_on_exit      (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  int term = 0;
 
@@ -561,5 +561,5 @@
 }
 
-int req_on_list_clients(int client, struct roar_message * mes, char * data) {
+int req_on_list_clients(int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  unsigned char filter, cmp;
  uint32_t id;
@@ -586,5 +586,5 @@
  return 0;
 }
-int req_on_list_streams(int client, struct roar_message * mes, char * data) {
+int req_on_list_streams(int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  unsigned char filter, cmp;
  uint32_t id;
@@ -612,5 +612,5 @@
 }
 
-int req_on_get_client  (int client, struct roar_message * mes, char * data) {
+int req_on_get_client  (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  struct roar_client * c;
 
@@ -626,5 +626,5 @@
 }
 
-int req_on_get_stream  (int client, struct roar_message * mes, char * data) {
+int req_on_get_stream  (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  struct roar_stream_server * s;
 
@@ -641,5 +641,5 @@
 }
 
-int req_on_get_stream_para (int client, struct roar_message * mes, char * data) {
+int req_on_get_stream_para (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  struct roar_stream * s;
  struct roar_stream_server * ss;
@@ -741,5 +741,5 @@
 }
 
-int req_on_set_stream_para (int client, struct roar_message * mes, char * data) {
+int req_on_set_stream_para (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  uint16_t * d = (uint16_t *) mes->data;
  int i;
@@ -798,5 +798,5 @@
 }
 
-int req_on_kick (int client, struct roar_message * mes, char * data) {
+int req_on_kick (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  uint16_t * info = (uint16_t *) mes->data;
 
@@ -833,5 +833,5 @@
 }
 
-int req_on_attach      (int client, struct roar_message * mes, char * data) {
+int req_on_attach      (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  uint16_t * info = (uint16_t *) mes->data;
 
@@ -859,5 +859,5 @@
 }
 
-int req_on_set_vol (int client, struct roar_message * mes, char * data) {
+int req_on_set_vol (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  struct roar_stream_server * s;
  uint16_t * info = (uint16_t *) mes->data;
@@ -949,5 +949,5 @@
 }
 
-int req_on_get_vol (int client, struct roar_message * mes, char * data) {
+int req_on_get_vol (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  uint16_t * info = (uint16_t *) mes->data;
  uint16_t   version = -1;
@@ -1031,5 +1031,5 @@
 }
 
-int req_on_add_data (int client, struct roar_message * mes, char * data) {
+int req_on_add_data (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  struct roar_buffer * b;
  char               * buf;
@@ -1044,5 +1044,5 @@
   memcpy(buf, mes->data, mes->datalen);
  } else {
-  memcpy(buf, data, mes->datalen);
+  memcpy(buf, *data, mes->datalen);
  }
 
@@ -1058,5 +1058,5 @@
 }
 
-int req_on_beep        (int client, struct roar_message * mes, char * data) {
+int req_on_beep        (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) {
  struct roar_beep bs;
  int16_t * info = (int16_t*)mes->data;
