Commit 0428972
committed
Merge #1374: Overhaul stats events: merge HTTP core events with a different IP version
1f30f8e ci: update git hooks scripts (Jose Celano)
3969c67 refactor: [1373] include client's port in stats events when provided (Jose Celano)
b8a3d44 refactor: [#1373] capture socket address from connection info in HTTP tracker (Jose Celano)
2de6c14 refactor: [#1373] merge HTTP stats events with different IP version (Jose Celano)
6de2dd9 refactor: [#1371] add connection context to HTTP core events (Jose Celano)
Pull request description:
Change HTTP core tracker events (`bittorrent_http_tracker_core::statistics::event::Event`) from this:
```rust
pub enum Event {
Tcp4Announce,
Tcp4Scrape,
Tcp6Announce,
Tcp6Scrape,
}
```
To this:
```rust
pub enum Event {
TcpAnnounce { connection: ConnectionContext },
TcpScrape { connection: ConnectionContext },
}
pub struct ConnectionContext {
client: ClientConnectionContext,
server: ServerConnectionContext,
}
pub struct ClientConnectionContext {
ip_addr: IpAddr,
port: Option<u16>,
}
pub struct ServerConnectionContext {
socket_addr: SocketAddr,
}
```
### Sub-tasks
- [x] Add `ConnectionContext` to events.
- [x] Merge events with the same request type (`announce` and `scrape`).
- [x] Add client port to `ConnectionContext`. `ClientIpSources` type and the `packages/axum-http-tracker-server/src/v1/extractors/client_ip_sources.rs` Axum extractor have to be changed to include also the port.
ACKs for top commit:
josecelano:
ACK 1f30f8e
Tree-SHA512: a9fe256de2baf493a23ad61c2d80073e9b6c1dde578632dbed73532d19d4730f01563c1df172fbf353b9b12bf9dcea3ec1a16109fced4995c929f0daae330067File tree
14 files changed
+379
-135
lines changed- contrib/dev-tools/git/hooks
- packages
- axum-http-tracker-server/src/v1
- extractors
- handlers
- http-protocol/src/v1/services
- http-tracker-core
- benches/helpers
- src
- services
- statistics
- event
14 files changed
+379
-135
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
Lines changed: 42 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| |||
71 | 81 | | |
72 | 82 | | |
73 | 83 | | |
| 84 | + | |
74 | 85 | | |
75 | 86 | | |
76 | 87 | | |
77 | | - | |
| 88 | + | |
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| |||
183 | 194 | | |
184 | 195 | | |
185 | 196 | | |
186 | | - | |
| 197 | + | |
187 | 198 | | |
188 | 199 | | |
189 | 200 | | |
| |||
196 | 207 | | |
197 | 208 | | |
198 | 209 | | |
| 210 | + | |
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
| |||
209 | 221 | | |
210 | 222 | | |
211 | 223 | | |
| 224 | + | |
| 225 | + | |
212 | 226 | | |
213 | 227 | | |
214 | 228 | | |
215 | 229 | | |
216 | 230 | | |
217 | 231 | | |
| 232 | + | |
218 | 233 | | |
219 | 234 | | |
220 | 235 | | |
| |||
236 | 251 | | |
237 | 252 | | |
238 | 253 | | |
| 254 | + | |
| 255 | + | |
239 | 256 | | |
240 | 257 | | |
241 | 258 | | |
242 | 259 | | |
243 | 260 | | |
244 | 261 | | |
| 262 | + | |
245 | 263 | | |
246 | 264 | | |
247 | 265 | | |
| |||
260 | 278 | | |
261 | 279 | | |
262 | 280 | | |
| 281 | + | |
| 282 | + | |
263 | 283 | | |
264 | 284 | | |
265 | 285 | | |
| |||
272 | 292 | | |
273 | 293 | | |
274 | 294 | | |
| 295 | + | |
| 296 | + | |
275 | 297 | | |
276 | 298 | | |
277 | 299 | | |
278 | 300 | | |
| 301 | + | |
279 | 302 | | |
280 | 303 | | |
281 | 304 | | |
| |||
297 | 320 | | |
298 | 321 | | |
299 | 322 | | |
| 323 | + | |
| 324 | + | |
300 | 325 | | |
301 | 326 | | |
302 | 327 | | |
| |||
310 | 335 | | |
311 | 336 | | |
312 | 337 | | |
313 | | - | |
| 338 | + | |
314 | 339 | | |
315 | 340 | | |
| 341 | + | |
| 342 | + | |
316 | 343 | | |
317 | 344 | | |
318 | 345 | | |
319 | 346 | | |
| 347 | + | |
320 | 348 | | |
321 | 349 | | |
322 | 350 | | |
| |||
335 | 363 | | |
336 | 364 | | |
337 | 365 | | |
| 366 | + | |
| 367 | + | |
338 | 368 | | |
339 | 369 | | |
340 | 370 | | |
| |||
348 | 378 | | |
349 | 379 | | |
350 | 380 | | |
351 | | - | |
| 381 | + | |
352 | 382 | | |
353 | 383 | | |
| 384 | + | |
| 385 | + | |
354 | 386 | | |
355 | 387 | | |
356 | 388 | | |
357 | 389 | | |
| 390 | + | |
358 | 391 | | |
359 | 392 | | |
360 | 393 | | |
| |||
0 commit comments