conn_waitpong: optionally require a PONG cookie before registration (anti-bot)
This commit is contained in:
parent
e0d849b4c9
commit
61954f6c5c
7 changed files with 70 additions and 2 deletions
|
|
@ -318,6 +318,7 @@ impl Server {
|
|||
addr,
|
||||
registered: false,
|
||||
dns_pending: false,
|
||||
waitpong: None,
|
||||
deferred: Vec::new(),
|
||||
cap: false,
|
||||
cap_302: false,
|
||||
|
|
@ -393,6 +394,8 @@ impl Server {
|
|||
"Couldn't look up your hostname; using your IP address instead",
|
||||
);
|
||||
}
|
||||
// conn_waitpong: optionally hold registration until the client PONGs a cookie
|
||||
crate::modules::conn_waitpong::arm(self, uid);
|
||||
}
|
||||
|
||||
/// Fire an HTTP POST on a worker thread and deliver `(status, body)` back to
|
||||
|
|
@ -1039,6 +1042,7 @@ mod tests {
|
|||
addr: "127.0.0.1:1".parse().unwrap(),
|
||||
registered: true,
|
||||
dns_pending: false,
|
||||
waitpong: None,
|
||||
deferred: Vec::new(),
|
||||
cap: false,
|
||||
cap_302: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue