diff --git a/doc/json_schema.json b/doc/json_schema.json index 32a992b93..7e64a7cf5 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -2107,9 +2107,9 @@ "default": false }, "parallel": { - "description": "Set if the command should be executed in parallel with other commands\nMight improve performance when using multiple commands, but may cause issues with some commands", + "description": "Set if the command should be executed in parallel with other commands\nImprove performance when using multiple commands, but may cause issues with some commands", "type": "boolean", - "default": false + "default": true }, "key": { "$ref": "#/$defs/key" diff --git a/src/detection/command/command.c b/src/detection/command/command.c index b75132117..f99c4fda5 100644 --- a/src/detection/command/command.c +++ b/src/detection/command/command.c @@ -45,8 +45,8 @@ const char* ffDetectCommand(FFCommandOptions* options, FFstrbuf* result) FFCommandResultBundle bundle = {}; if (!options->parallel) bundle.error = spawnProcess(options, &bundle.handle); - else - ffListShift(&commandQueue, &bundle); + else if (!ffListShift(&commandQueue, &bundle)) + return "[BUG] command queue is empty"; if (bundle.error) return bundle.error; diff --git a/src/modules/command/command.c b/src/modules/command/command.c index 0ba430a3a..59f6b4951 100644 --- a/src/modules/command/command.c +++ b/src/modules/command/command.c @@ -131,7 +131,7 @@ void ffInitCommandOptions(FFCommandOptions* options) ); ffStrbufInit(&options->text); options->useStdErr = false; - options->parallel = false; + options->parallel = true; } void ffDestroyCommandOptions(FFCommandOptions* options)