Commit graph

45 commits

Author SHA1 Message Date
Jimmy Zelinskie b81a310eea bytepool: store *[]byte
This avoids allocations for the slice metadata.

For more details, see:
https://staticcheck.io/docs/checks#SA6002
2022-01-15 13:58:06 -05:00
Jimmy Zelinskie 65ce7c7c6b lint: lint files with golangci-lint 2022-01-15 13:31:14 -05:00
Leo Balduf cb88a11d6a frontend: add defaults for parser options 2019-10-12 12:52:16 +09:00
Cenk Alti 0de1d25448
fix listenAndServe comment 2018-12-27 15:17:43 +03:00
Cenk Alti b345eb3899
split listenAndServe into 2 functions 2018-12-26 18:15:05 +03:00
Cenk Alti 2a26215f2a
Revert "protect socket variable with mutex; fix #437"
This reverts commit 1b7ce4c378.
2018-12-26 18:10:48 +03:00
Cenk Alti 1b7ce4c378
protect socket variable with mutex; fix #437 2018-12-25 11:23:47 +03:00
Leo Balduf 495f2c2734 frontend/udp: pool connection ID generation state 2018-09-18 11:25:54 +02:00
Justin Li d95120c817 Return []error from Stop() channel, allow recursive stop groups 2018-09-09 11:30:15 -04:00
Jimmy Zelinskie f0780ad9cc frontend: isolate prometheus logic to one file 2018-06-15 13:33:26 -04:00
Leo Balduf fa19d1125c udp: support both BEP15 and old opentracker v6 announces 2018-02-17 13:41:36 +01:00
Leo Balduf fa6e360da4 udp: set address family for connect metrics 2017-12-06 23:00:36 +01:00
Jimmy Zelinskie 80558648d7 Merge pull request #363 from jzelinskie/req-san
Request Sanitizer via library
2017-10-18 12:45:25 -04:00
Jimmy Zelinskie ca823e0e5f frontend: update to use non-object sanization 2017-10-17 22:02:45 -04:00
Leo Balduf 89bc479a3b *: make use of timecache 2017-10-15 20:05:39 +02:00
Jimmy Zelinskie 47b5e67345 frontend/udp: add request sanitization 2017-10-08 18:02:34 -04:00
Leo Balduf 8ed171b0ea pkg/log: create wrapper around logrus 2017-06-26 20:46:40 +02:00
Cedric Charly f7becf952b frontend: TrackerLogic interface returns modified context
HandleAnnounce and HandleScrape must return the modified context changed
by the hooks. These contexts are passed to AfterAnnounce and AfterScrape
for further use.

Closes #304
2017-06-07 19:25:12 -05:00
Leo Balduf f61e7a9281 frontend: make request timing optional 2017-05-12 20:27:31 +02:00
Jimmy Zelinskie cb55019ab8 *: add structured logging 2017-05-07 04:30:22 -04:00
Jimmy Zelinskie ea0dba3a3d cmd/chihaya: refactor root run command
This change refactors a bunch of the state of execution into its own
object. It also attempts to simplify stopping and adjusts some other
packages to integrate with the stopper interface.

Fixes #309.
2017-05-01 15:56:38 -04:00
Leo Balduf 233c355526 udp: remove read deadline 2017-02-18 13:17:45 +01:00
Jimmy Zelinskie 215f33d862 frontend/*: only record ClientErrors to Prometheus
All ClientErrors are constant and should not cause Prometheus streams to
be generated for all possible failure scenarios in the program.

Fixes #294.
2017-02-16 01:01:38 -05:00
Leo Balduf fdf4ed8169 frontend: fix recording of address family 2017-02-05 17:24:53 +01:00
Jimmy Zelinskie 0e07b33827 prometheus: record IP AddressFamily 2017-02-02 19:19:33 -05:00
Jimmy Zelinskie 6deebdd6d4 frontend/udp: generate private key when empty 2017-01-31 19:53:36 -05:00
Jimmy Zelinskie acc051bcc4 frontend: rm copypasta metric recording
Fixes #271.
2017-01-23 14:06:32 -05:00
Leo Balduf 3ae3843944 bittorrent: add AddressField to ScrapeRequest 2017-01-20 20:34:39 +01:00
Leo Balduf 3c098c0703 middleware: add sanitization hook 2017-01-20 20:29:59 +01:00
Leo Balduf 5866d96cb0 udp: fix IP bytes not being copied out of the packet
Fixes #243
2016-10-04 18:23:25 +02:00
Jimmy Zelinskie fcfe5a2c2d frontend: add yaml tags to UDP and HTTP configs
This change also adds the missing fields to the example config.

Fixes #228.
2016-09-29 13:25:17 -04:00
Leo Balduf 1bd28b097c udp: add scrape address length to context 2016-09-08 16:02:03 -04:00
mrd0ll4r f6e362e506 Merge pull request #209 from jzelinskie/logrus
misc fixes for #207
2016-09-05 13:40:52 -04:00
Jimmy Zelinskie 57ee2d0c90 bytepool: enforce equal length and cap 2016-09-05 12:32:38 -04:00
Jimmy Zelinskie c4706022d7 udp: remove unnecessary returns in switch stmt 2016-09-05 12:27:00 -04:00
Jimmy Zelinskie 093a748457 frontend: s/ctx.TODO/ctx.Background 2016-09-05 12:25:11 -04:00
Leo Balduf d66ed27dd9 udp: add support for opentracker-style IPv6 announces 2016-09-03 15:15:11 -04:00
Leo Balduf a4639a1aac udp: clean up 2016-08-18 10:12:04 -04:00
Jimmy Zelinskie fc13031d96 move to std context package 2016-08-16 22:34:05 -04:00
Jimmy Zelinskie cc6614c474 rename back to chihaya 2016-08-16 22:17:10 -04:00
Jimmy Zelinskie 778773cb81 rm copyright 2016-08-16 22:17:10 -04:00
Jimmy Zelinskie c9fe95b103 s/backend/middleware 2016-08-16 22:17:10 -04:00
Jimmy Zelinskie 11d90b088c s/trackerfuncs/trackerlogic 2016-08-16 22:17:10 -04:00
Leo Balduf 9a8cdccc6c make frontend.TrackerFuncs an interface 2016-08-16 22:17:10 -04:00
Leo Balduf ae18d89627 rename frontends to frontend 2016-08-16 22:17:10 -04:00
Renamed from frontends/udp/frontend.go (Browse further)