basic web view
This commit is contained in:
13
src/ports.rs
13
src/ports.rs
@@ -21,7 +21,7 @@ use tracing::{debug, error, info, instrument, warn};
|
||||
|
||||
use crate::{
|
||||
constants::{CACHE_STORE_INTERVAL, PORT_OWNERSHIP_TIMEOUT, PORT_RETRY_TIME},
|
||||
packets::{Packet, PacketKind},
|
||||
packets::Packet,
|
||||
spawn, Config, Number, Port, UnixTimestamp,
|
||||
};
|
||||
|
||||
@@ -302,17 +302,10 @@ impl Serialize for Rejector {
|
||||
S: Serializer,
|
||||
{
|
||||
let packet = &self.state.1;
|
||||
let kind = match packet.kind() {
|
||||
PacketKind::End => "end",
|
||||
PacketKind::Reject => "reject",
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
match packet.as_string() {
|
||||
Some(string) if string.chars().all(|c| !c.is_control()) => {
|
||||
(kind, string).serialize(serializer)
|
||||
}
|
||||
_ => (kind, packet.data()).serialize(serializer),
|
||||
Some(string) if string.chars().all(|c| !c.is_control()) => string.serialize(serializer),
|
||||
_ => packet.data().serialize(serializer),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user