mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-13 03:58:10 -07:00
frontend: add defaults for parser options
This commit is contained in:
@@ -20,6 +20,13 @@ type ParseOptions struct {
|
||||
MaxScrapeInfoHashes uint32 `yaml:"max_scrape_infohashes"`
|
||||
}
|
||||
|
||||
// Default parser config constants.
|
||||
const (
|
||||
defaultMaxNumWant uint32 = 100
|
||||
defaultDefaultNumWant uint32 = 50
|
||||
defaultMaxScrapeInfoHashes uint32 = 50
|
||||
)
|
||||
|
||||
// ParseAnnounce parses an bittorrent.AnnounceRequest from an http.Request.
|
||||
func ParseAnnounce(r *http.Request, opts ParseOptions) (*bittorrent.AnnounceRequest, error) {
|
||||
qp, err := bittorrent.ParseURLData(r.RequestURI)
|
||||
|
||||
Reference in New Issue
Block a user