Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Refactor sending of dead host status #807

Merged

Conversation

ArnoStiefvater
Copy link
Member

What:

Refactor sending of dead host status. Its only a first small improvement. This will be improved more in the future.

Why:

Separate sending of progress status and sending of
this special status case.

How:

Checklist:

@ArnoStiefvater ArnoStiefvater requested a review from a team as a code owner July 21, 2021 05:44
src/attack.c Outdated
* @return 0 on success, -1 on failure.
*/
static int
comm_send_status_host_dead (kb_t main_kb, char *hostname)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use ip_str instead of hostname, since we are using the IP. Also, this change would fix the typo in the docstring.

Suggested change
comm_send_status_host_dead (kb_t main_kb, char *hostname)
comm_send_status_host_dead (kb_t main_kb, char *ip_str)

src/attack.c Outdated
* for implicit singalling that the host ist dead.
*
* @param main_kb Kb to use
* @param hostnae ip_str representation of host
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ip_str.

Suggested change
* @param hostnae ip_str representation of host
* @param ip_str ip_str representation of host

src/attack.c Outdated
@@ -511,10 +558,7 @@ attack_host (struct scan_globals *globals, struct in6_addr *ip, GSList *vhosts,
"<description/><type/><name/></source></detail></host>",
ip_str);
#if (PROGRESS_BAR_STYLE == 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this preprocessor directive. It is always set to 1 and other modules does not hanlde other option than this for dead hosts.. The DEFINE is above in the same file.

Separate sending of progress status and sending of
this special status case.
@ArnoStiefvater ArnoStiefvater force-pushed the improve-host-dead-status branch from 7815440 to b14e678 Compare July 21, 2021 07:06
@ArnoStiefvater ArnoStiefvater enabled auto-merge July 21, 2021 07:08
@ArnoStiefvater ArnoStiefvater merged commit 85fcb2c into greenbone:master Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants