mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 06:38:21 +00:00
Merge pull request #12 from p-l-/enh-proto
Replace if / else if using a match
This commit is contained in:
commit
6da8a23ede
1 changed files with 8 additions and 9 deletions
|
@ -118,16 +118,15 @@ pub fn repl<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* proto over else (e.g., UDP) */
|
/* proto over else (e.g., UDP) */
|
||||||
if id == PROTO_HTTP {
|
match id {
|
||||||
return http::repl(data, masscanned, client_info);
|
PROTO_HTTP => http::repl(data, masscanned, client_info),
|
||||||
} else if id == PROTO_STUN {
|
PROTO_STUN => stun::repl(data, masscanned, &mut client_info),
|
||||||
return stun::repl(data, masscanned, &mut client_info);
|
PROTO_SSH => ssh::repl(data, masscanned, &mut client_info),
|
||||||
} else if id == PROTO_SSH {
|
_ => {
|
||||||
return ssh::repl(data, masscanned, &mut client_info);
|
debug!("id: {}", id);
|
||||||
} else {
|
None
|
||||||
debug!("id: {}", id);
|
}
|
||||||
}
|
}
|
||||||
None
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue