Skip to content

Commit 95949fa

Browse files
authored
turn: Add relay_addr to AllocationInfo (#630)
1 parent c4f4031 commit 95949fa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

turn/src/allocation/allocation_manager.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ impl Manager {
6363
AllocationInfo::new(
6464
*five_tuple,
6565
alloc.username.text.clone(),
66+
alloc.relay_addr,
6667
#[cfg(feature = "metrics")]
6768
alloc.relayed_bytes.load(Ordering::Acquire),
6869
),

turn/src/allocation/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ pub struct AllocationInfo {
4545
/// Username of this [`Allocation`].
4646
pub username: String,
4747

48+
/// Relay address of this [`Allocation`].
49+
pub relay_addr: SocketAddr,
50+
4851
/// Relayed bytes with this [`Allocation`].
4952
#[cfg(feature = "metrics")]
5053
pub relayed_bytes: usize,
@@ -55,11 +58,13 @@ impl AllocationInfo {
5558
pub fn new(
5659
five_tuple: FiveTuple,
5760
username: String,
61+
relay_addr: SocketAddr,
5862
#[cfg(feature = "metrics")] relayed_bytes: usize,
5963
) -> Self {
6064
Self {
6165
five_tuple,
6266
username,
67+
relay_addr,
6368
#[cfg(feature = "metrics")]
6469
relayed_bytes,
6570
}
@@ -255,6 +260,7 @@ impl Allocation {
255260
.send(AllocationInfo {
256261
five_tuple: self.five_tuple,
257262
username: self.username.text.clone(),
263+
relay_addr: self.relay_addr,
258264
#[cfg(feature = "metrics")]
259265
relayed_bytes: self.relayed_bytes.load(Ordering::Acquire),
260266
})

0 commit comments

Comments
 (0)