Author: mattm Date: 2017-08-12 16:35:18 +0200 (Sat, 12 Aug 2017) New Revision: 29343
Modified: trunk/gvm/ChangeLog trunk/gvm/src/gmp.c trunk/gvm/src/gmpd.c trunk/gvm/src/gvmd.c trunk/gvm/src/manage_sql.c Log: Remove remnants of --rebuild. * src/gmp.c (init_gmp): Correct arg doc. * src/gmpd.c (init_gmpd): Correct arg doc. * src/gvmd.c (update_or_rebuild_nvt_cache): Remove. Now update_nvt_cache. Reduce to update only. (update_nvt_cache): New function. Was update_or_rebuild_nvt_cache. (rebuild_nvt_cache_retry): Remove. Now update_nvt_cache_retry. (fork_update_nvt_cache): Update calls accordingly. * src/manage_sql.c (init_manage_process): Correct arg doc. Modified: trunk/gvm/ChangeLog =================================================================== --- trunk/gvm/ChangeLog 2017-08-12 14:04:53 UTC (rev 29342) +++ trunk/gvm/ChangeLog 2017-08-12 14:35:18 UTC (rev 29343) @@ -1,5 +1,21 @@ 2017-08-12 Matthew Mundell <matthew.mund...@greenbone.net> + Remove remnants of --rebuild. + + * src/gmp.c (init_gmp): Correct arg doc. + + * src/gmpd.c (init_gmpd): Correct arg doc. + + * src/gvmd.c (update_or_rebuild_nvt_cache): Remove. Now update_nvt_cache. + Reduce to update only. + (update_nvt_cache): New function. Was update_or_rebuild_nvt_cache. + (rebuild_nvt_cache_retry): Remove. Now update_nvt_cache_retry. + (fork_update_nvt_cache): Update calls accordingly. + + * src/manage_sql.c (init_manage_process): Correct arg doc. + +2017-08-12 Matthew Mundell <matthew.mund...@greenbone.net> + For the NVT sync, always delete the existing info in a single transaction, and always insert the new info in chunks. This combines parts of the old --update and --rebuild behaviours. Modified: trunk/gvm/src/gmp.c =================================================================== --- trunk/gvm/src/gmp.c 2017-08-12 14:04:53 UTC (rev 29342) +++ trunk/gvm/src/gmp.c 2017-08-12 14:35:18 UTC (rev 29343) @@ -30506,8 +30506,7 @@ /** * @brief Initialise GMP library data for a process. * - * @param[in] update_nvt_cache 0 operate normally, -1 just update NVT cache, - * -2 just rebuild NVT cache. + * @param[in] update_nvt_cache 0 operate normally, -1 just update NVT cache. * @param[in] database Location of manage database. * @param[in] write_to_client Function to write to client. * @param[in] write_to_client_data Argument to \p write_to_client. Modified: trunk/gvm/src/gmpd.c =================================================================== --- trunk/gvm/src/gmpd.c 2017-08-12 14:04:53 UTC (rev 29342) +++ trunk/gvm/src/gmpd.c 2017-08-12 14:35:18 UTC (rev 29343) @@ -98,8 +98,7 @@ * @brief Initialise the GMP library for the GMP daemon. * * @param[in] log_config Log configuration - * @param[in] nvt_cache_mode 0 operate normally, -1 just update NVT cache, - * -2 just rebuild NVT cache. + * @param[in] nvt_cache_mode 0 operate normally, -1 just update NVT cache. * @param[in] database Location of manage database. * @param[in] max_ips_per_target Max number of IPs per target. * @param[in] max_email_attachment_size Max size of email attachments. Modified: trunk/gvm/src/gvmd.c =================================================================== --- trunk/gvm/src/gvmd.c 2017-08-12 14:04:53 UTC (rev 29342) +++ trunk/gvm/src/gvmd.c 2017-08-12 14:35:18 UTC (rev 29343) @@ -925,31 +925,25 @@ } /** - * @brief Updates or rebuilds the NVT Cache and exits or returns exit code. + * @brief Updates the NVT Cache and exits or returns exit code. * - * @param[in] update_nvt_cache Whether the nvt cache should be updated - * (1) or rebuilt (0). * @param[in] register_cleanup Whether to register cleanup with atexit. * @param[in] skip_create_tables Whether to skip table creation. * * @return If this function did not exit itself, returns exit code. */ static int -update_or_rebuild_nvt_cache (int update_nvt_cache, int register_cleanup, - int skip_create_tables) +update_nvt_cache (int register_cleanup, int skip_create_tables) { int ret; gvm_connection_t connection; /* Initialise GMP daemon. */ - if (update_nvt_cache == 0) - proctitle_set ("gvmd: Rebuilding NVT cache"); - else - proctitle_set ("gvmd: Updating NVT cache"); + proctitle_set ("gvmd: Updating NVT cache"); switch (init_gmpd (log_config, - update_nvt_cache ? -1 : -2, + -1, database, manage_max_hosts (), 0, /* Max email attachment size. */ @@ -997,7 +991,7 @@ * value. This invokes a scanner-only manager loop which will * request and cache the plugins, then exit. */ - connection.socket = update_nvt_cache ? -1 : -2; + connection.socket = -1; ret = serve_gmp (&connection, database, NULL); openvas_scanner_close (); switch (ret) @@ -1016,21 +1010,18 @@ } /** - * @brief Rebuild NVT cache in forked child, retrying if scanner loading. + * @brief Update NVT cache in forked child, retrying if scanner loading. * * Forks a child process to rebuild the nvt cache, retrying again if the * child process reports that the scanner is still loading. * - * @param[in] update_or_rebuild Whether the nvt cache should be updated - * (1) or rebuilt (0). * @param[in] register_cleanup Whether to register cleanup with atexit. * @param[in] skip_create_tables Whether to skip table creation. * * @return Exit status of child spawned to do rebuild. */ static int -rebuild_nvt_cache_retry (int update_or_rebuild, int register_cleanup, - int skip_create_tables) +update_nvt_cache_retry (int register_cleanup, int skip_create_tables) { proctitle_set ("gvmd: Reloading"); @@ -1052,9 +1043,7 @@ else if (child_pid == 0) { /* Child: Try reload. */ - int ret = update_or_rebuild_nvt_cache (update_or_rebuild, - register_cleanup, - skip_create_tables); + int ret = update_nvt_cache (register_cleanup, skip_create_tables); exit (ret); } @@ -1114,7 +1103,7 @@ /* Update the cache. */ - rebuild_nvt_cache_retry (1, 0, 1); + update_nvt_cache_retry (0, 1); /* Exit. */ Modified: trunk/gvm/src/manage_sql.c =================================================================== --- trunk/gvm/src/manage_sql.c 2017-08-12 14:04:53 UTC (rev 29342) +++ trunk/gvm/src/manage_sql.c 2017-08-12 14:35:18 UTC (rev 29343) @@ -12762,8 +12762,7 @@ * * Open the SQL database, attach secondary databases, and define functions. * - * @param[in] update_nvt_cache 0 operate normally, -1 just update NVT cache, - * -2 just rebuild NVT cache. + * @param[in] update_nvt_cache 0 operate normally, -1 just update NVT cache. * @param[in] database Location of manage database. */ void _______________________________________________ Openvas-commits mailing list Openvas-commits@wald.intevation.org https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-commits