Skip to content

Commit

Permalink
turn: Add relay_addr to AllocationInfo (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-avos authored Nov 17, 2024
1 parent c4f4031 commit 95949fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions turn/src/allocation/allocation_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ impl Manager {
AllocationInfo::new(
*five_tuple,
alloc.username.text.clone(),
alloc.relay_addr,
#[cfg(feature = "metrics")]
alloc.relayed_bytes.load(Ordering::Acquire),
),
Expand Down
6 changes: 6 additions & 0 deletions turn/src/allocation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ pub struct AllocationInfo {
/// Username of this [`Allocation`].
pub username: String,

/// Relay address of this [`Allocation`].
pub relay_addr: SocketAddr,

/// Relayed bytes with this [`Allocation`].
#[cfg(feature = "metrics")]
pub relayed_bytes: usize,
Expand All @@ -55,11 +58,13 @@ impl AllocationInfo {
pub fn new(
five_tuple: FiveTuple,
username: String,
relay_addr: SocketAddr,
#[cfg(feature = "metrics")] relayed_bytes: usize,
) -> Self {
Self {
five_tuple,
username,
relay_addr,
#[cfg(feature = "metrics")]
relayed_bytes,
}
Expand Down Expand Up @@ -255,6 +260,7 @@ impl Allocation {
.send(AllocationInfo {
five_tuple: self.five_tuple,
username: self.username.text.clone(),
relay_addr: self.relay_addr,
#[cfg(feature = "metrics")]
relayed_bytes: self.relayed_bytes.load(Ordering::Acquire),
})
Expand Down

0 comments on commit 95949fa

Please sign in to comment.