]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Set webseed.PrintDebug from environment
authorMatt Joiner <anacrolix@gmail.com>
Mon, 14 Jul 2025 12:15:55 +0000 (22:15 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 14 Jul 2025 12:15:55 +0000 (22:15 +1000)
webseed/client.go

index 9cd59c1ff853758be4bc8a9b20e5c9f605a95e45..f6e03da509e3ede9817ff3fb801460ce8e35a632 100644 (file)
@@ -8,6 +8,7 @@ import (
        "log"
        "log/slog"
        "net/http"
+       "os"
        "strings"
 
        "github.com/RoaringBitmap/roaring"
@@ -28,6 +29,10 @@ const MaxDiscardBytes = 48 << 10
 // Output debug information to stdout.
 var PrintDebug = false
 
+func init() {
+       _, PrintDebug = os.LookupEnv("TORRENT_WEBSEED_DEBUG")
+}
+
 type RequestSpec = segments.Extent
 
 type requestPart struct {