Set limit of messages at 2000 characters
This commit is contained in:
parent
cea07a8e19
commit
de2523b083
@ -79,6 +79,14 @@ fn write_to_server(stream: TcpStream) {
|
||||
writer.flush().unwrap();
|
||||
}
|
||||
line => {
|
||||
if line.len() > 2000 {
|
||||
println!(
|
||||
"{}",
|
||||
"Cannot send a message longer than 2000 characters"
|
||||
.bright_red()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
writeln!(writer, "MSG {}", line).unwrap();
|
||||
writer.flush().unwrap();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user