Skip to content

Commit f008a0a

Browse files
committed
fix: test for request counters in http-tracker-core
The IP faimly related to the counter (inet or inet6) dependos on the server binding IP. If the server is listening on a inet6 IP, then inet6 lreated counters should be increased.
1 parent 0284bef commit f008a0a

File tree

1 file changed

+2
-2
lines changed
  • packages/http-tracker-core/src/statistics/event

1 file changed

+2
-2
lines changed

packages/http-tracker-core/src/statistics/event/handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ mod tests {
123123
Event::TcpAnnounce {
124124
connection: ConnectionContext::new(
125125
RemoteClientAddr::new(ResolvedIp::FromSocketAddr(remote_client_ip), Some(8080)),
126-
ServiceBinding::new(Protocol::HTTP, SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 7070)).unwrap(),
126+
ServiceBinding::new(Protocol::HTTP, SocketAddr::new(IpAddr::V6(Ipv6Addr::LOCALHOST), 7070)).unwrap(),
127127
),
128128
info_hash: sample_info_hash(),
129129
announcement: peer,
@@ -151,7 +151,7 @@ mod tests {
151151
))),
152152
Some(8080),
153153
),
154-
ServiceBinding::new(Protocol::HTTP, SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 7070)).unwrap(),
154+
ServiceBinding::new(Protocol::HTTP, SocketAddr::new(IpAddr::V6(Ipv6Addr::LOCALHOST), 7070)).unwrap(),
155155
),
156156
},
157157
&stats_repository,

0 commit comments

Comments
 (0)