daemon: allow synhesizing-only clients to register without commands.
authorKrisztian Litkey <kli@iki.fi>
Wed, 22 Oct 2014 14:18:41 +0000 (17:18 +0300)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Fri, 7 Nov 2014 09:18:07 +0000 (11:18 +0200)
src/daemon/client.c

index 2657942..a0b2544 100644 (file)
@@ -198,10 +198,12 @@ srs_client_t *client_create(srs_context_t *srs, srs_client_type_t type,
         return NULL;
     }
 
-    c->commands = parse_commands(commands, ncommand);
-    c->ncommand = ncommand;
+    if (commands != NULL) {
+        c->commands = parse_commands(commands, ncommand);
+        c->ncommand = ncommand;
+    }
 
-    if (c->commands == NULL || srs_srec_add_client(srs, c) != 0) {
+    if ((c->commands == NULL && ncommand) || srs_srec_add_client(srs, c) != 0) {
         client_destroy(c);
         return NULL;
     }