Skip to content

Commit

Permalink
Add functions to get/set scanner_connection_retry
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Mar 17, 2021
1 parent 3428320 commit b6a1107
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ static int relay_migrate_sensors = 0;
*/
static int schedule_timeout = SCHEDULE_TIMEOUT_DEFAULT;

/**
* @brief Default for max auto retry on connection to scanner lost.
*/
static int scanner_connection_retry = SCANNER_CONNECTION_RETRY_DEFAULT;


/* Certificate and key management. */

Expand Down Expand Up @@ -4679,6 +4684,29 @@ run_osp_task (task_t task, int from, char **report_id)
return 0;
}

/**
* @brief Get the number of retry on a scanner connection lost.
*
* @return The number of retry on a scanner connection lost.
*/
int
get_scanner_connection_retry ()
{
return scanner_connection_retry;
}

/**
* @brief Set the number of retry on a scanner connection lost.
*
* @param new_retry The number of retry on a scanner connection lost.
*/
void
set_scanner_connection_retry (int new_retry)
{
if (new_retry > 1)
scanner_connection_retry = new_retry;
}


/* CVE tasks. */

Expand Down
6 changes: 6 additions & 0 deletions src/manage.h
Original file line number Diff line number Diff line change
Expand Up @@ -2604,6 +2604,12 @@ osp_connect_with_data (const char *,
osp_connection_t *
osp_scanner_connect (scanner_t);

int
get_scanner_connection_retry ();

void
set_scanner_connection_retry (int);

int
verify_scanner (const char *, char **);

Expand Down

0 comments on commit b6a1107

Please sign in to comment.