mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
fix proxy traffic not count into traffic (#1229)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -986,7 +986,19 @@ impl PeerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn send_msg(&self, msg: ZCPacket, dst_peer_id: PeerId) -> Result<(), Error> {
|
pub async fn send_msg(&self, msg: ZCPacket, dst_peer_id: PeerId) -> Result<(), Error> {
|
||||||
Self::send_msg_internal(&self.peers, &self.foreign_network_client, msg, dst_peer_id).await
|
self.self_tx_counters
|
||||||
|
.self_tx_bytes
|
||||||
|
.add(msg.buf_len() as u64);
|
||||||
|
self.self_tx_counters.self_tx_packets.inc();
|
||||||
|
let msg_len = msg.buf_len() as u64;
|
||||||
|
let result =
|
||||||
|
Self::send_msg_internal(&self.peers, &self.foreign_network_client, msg, dst_peer_id)
|
||||||
|
.await;
|
||||||
|
if result.is_ok() {
|
||||||
|
self.self_tx_counters.self_tx_bytes.add(msg_len);
|
||||||
|
self.self_tx_counters.self_tx_packets.inc();
|
||||||
|
}
|
||||||
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn send_msg_internal(
|
async fn send_msg_internal(
|
||||||
|
|||||||
Reference in New Issue
Block a user