diff --git a/src/manage.c b/src/manage.c index 94d333fa8..0c53d78ae 100644 --- a/src/manage.c +++ b/src/manage.c @@ -4006,9 +4006,10 @@ get_osp_performance_string (scanner_t scanner, int start, int end, { char *host, *ca_pub, *key_pub, *key_priv; int port; - osp_connection_t *connection; + osp_connection_t *connection = NULL; osp_get_performance_opts_t opts; gchar *error; + int connection_retry; host = scanner_host (scanner); port = scanner_port (scanner); @@ -4016,7 +4017,14 @@ get_osp_performance_string (scanner_t scanner, int start, int end, key_pub = scanner_key_pub (scanner); key_priv = scanner_key_priv (scanner); - connection = osp_connect_with_data (host, port, ca_pub, key_pub, key_priv); + connection_retry = SCANNER_CONNECTION_RETRY_DEFAULT; + while(connection == NULL && connection_retry > 0) + { + connection = osp_connect_with_data (host, port, + ca_pub, key_pub, key_priv); + connection_retry--; + sleep(1); + } free (host); free (ca_pub); @@ -4031,7 +4039,17 @@ get_osp_performance_string (scanner_t scanner, int start, int end, opts.titles = g_strdup (titles); error = NULL; - if (osp_get_performance_ext (connection, opts, performance_str, &error)) + connection_retry = SCANNER_CONNECTION_RETRY_DEFAULT; + int return_value = 1; + while (return_value > 0 && connection_retry > 0) + { + return_value = osp_get_performance_ext (connection, opts, + performance_str, &error); + connection_retry--; + sleep(1); + } + + if (return_value) { osp_connection_close (connection); g_warning ("Error getting OSP performance report: %s", error);