Skip to content

Commit

Permalink
fix: when restful not set
Browse files Browse the repository at this point in the history
  • Loading branch information
iHsin authored Oct 27, 2024
1 parent ca3bbfb commit dea187c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tuic-server/src/restful.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,18 @@ pub async fn client_disconnect(uuid: &Uuid, conn: QuinnConnection) {
}

pub fn traffic_tx(uuid: &Uuid, size: u64) {
if CONFIG.restful.is_none() {
return;
}
if let Some((tx, _)) = TRAFFIC_STATS.get(uuid) {
tx.fetch_add(size, Ordering::SeqCst);
}
}

pub fn traffic_rx(uuid: &Uuid, size: u64) {
if CONFIG.restful.is_none() {
return;
}
if let Some((__, rx)) = TRAFFIC_STATS.get(uuid) {
rx.fetch_add(size, Ordering::SeqCst);
}
Expand Down

0 comments on commit dea187c

Please sign in to comment.