feat: reject events that are too large

A new configuration setting controls the maximum size of event
messages, and sends a notice to the client if they exceed it.

Fixes https://todo.sr.ht/~gheartsfield/nostr-rs-relay/14
This commit is contained in:
Greg Heartsfield
2021-12-31 15:19:35 -06:00
parent 8f3891c781
commit 4171a8870e
6 changed files with 33 additions and 15 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ pub async fn db_writer(
}
}
loop {
if let Ok(_) = shutdown.try_recv() {
if shutdown.try_recv().is_ok() {
info!("shutting down database writer");
break;
}