Skip to content

Commit

Permalink
Add gvmd option 'scanner-connection-retry'
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Mar 17, 2021
1 parent 5ecc8f9 commit 3428320
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gvmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,7 @@ gvmd (int argc, char** argv)
static gchar *scanner_credential = NULL;
static gchar *scanner_key_pub = NULL;
static gchar *scanner_key_priv = NULL;
static int scanner_connection_retry = SCANNER_CONNECTION_RETRY_DEFAULT;
static int schedule_timeout = SCHEDULE_TIMEOUT_DEFAULT;
static int secinfo_commit_size = SECINFO_COMMIT_SIZE_DEFAULT;
static int slave_commit_size = SLAVE_COMMIT_SIZE_DEFAULT;
Expand Down Expand Up @@ -1958,6 +1959,11 @@ gvmd (int argc, char** argv)
&scanner_ca_pub,
"Scanner CA Certificate path for --[create|modify]-scanner.",
"<scanner-ca-pub>" },
{ "scanner-connection-retry", '\0', 0, G_OPTION_ARG_INT,
&scanner_connection_retry,
"During a running task, number of auto retry on lost connection,"
" default: "G_STRINGIFY (SCANNER_CONNECTION_RETRY),
"<number>" },
{ "scanner-credential", '\0', 0, G_OPTION_ARG_STRING,
&scanner_credential,
"Scanner credential for --create-scanner and --modify-scanner."
Expand Down
5 changes: 5 additions & 0 deletions src/manage.h
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,11 @@ manage_system_report (const char *, const char *, const char *, const char *,
*/
#define SLAVE_COMMIT_SIZE_DEFAULT 0

/**
* @brief Default for max auto retry on connection to scanner lost.
*/
#define SCANNER_CONNECTION_RETRY_DEFAULT 3

int
manage_create_scanner (GSList *, const db_conn_info_t *, const char *,
const char *, const char *, const char *, const char *,
Expand Down

0 comments on commit 3428320

Please sign in to comment.