client trace messages

This commit is contained in:
Mike Dilger 2025-01-21 10:14:20 +13:00
parent e42a18efce
commit f6dbf63e64
No known key found for this signature in database
GPG Key ID: 47581A78D4329BA4
2 changed files with 4 additions and 0 deletions

View File

@ -368,6 +368,8 @@ struct WebSocketService {
impl WebSocketService {
async fn send(&mut self, m: Message) -> Result<(), Error> {
log::trace!(target: "Client", "{}: {}", self.peer, m);
// Throttling: we consume burst tokens, but we do not throttle on output
if m.len() > self.burst_tokens {
log::info!(target: "Client", "{}: Rate limited exceeded", self.peer);

View File

@ -18,6 +18,8 @@ impl WebSocketService {
self.buffer.resize(newlen, 0);
}
log::trace!(target: "Client", "{}: {}", self.peer, msg);
let input = msg.as_bytes();
let mut inpos = 0;
eat_whitespace(input, &mut inpos);