diff --git a/cmd/magneticod/main.go b/cmd/magneticod/main.go index 0f00371..3fee76a 100644 --- a/cmd/magneticod/main.go +++ b/cmd/magneticod/main.go @@ -56,7 +56,7 @@ func main() { return } - zap.L().Info("magneticod v0.10.0 has been started.") + zap.L().Info("magneticod v0.11.0 has been started.") zap.L().Info("Copyright (C) 2017-2020 Mert Bora ALPER .") zap.L().Info("Dedicated to Cemile Binay, in whose hands I thrived.") zap.S().Infof("Compiled on %s", compiledOn) diff --git a/cmd/magneticow/api.go b/cmd/magneticow/api.go index 8728b00..f0573ed 100644 --- a/cmd/magneticow/api.go +++ b/cmd/magneticow/api.go @@ -13,17 +13,17 @@ import ( "strings" "time" - "golang.org/x/text/encoding/charmap" "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/storage" "github.com/gorilla/mux" "go.uber.org/zap" + "golang.org/x/text/encoding/charmap" "github.com/boramalper/magnetico/pkg/persistence" ) type ApiReadmeHandler struct { - client *torrent.Client + client *torrent.Client tempdir string } @@ -97,9 +97,9 @@ func (h *ApiReadmeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { zap.L().Warn("WAITING FOR INFO") select { - case <- t.GotInfo(): + case <-t.GotInfo(): - case <- time.After(30 * time.Second): + case <-time.After(30 * time.Second): respondError(w, http.StatusInternalServerError, "Timeout") return } @@ -124,7 +124,7 @@ func (h *ApiReadmeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // Cancel if the file is larger than 50 KiB - if file.Length() > 50 * 1024 { + if file.Length() > 50*1024 { w.WriteHeader(http.StatusRequestEntityTooLarge) return } diff --git a/cmd/magneticow/main.go b/cmd/magneticow/main.go index bfb9668..ea0e593 100644 --- a/cmd/magneticow/main.go +++ b/cmd/magneticow/main.go @@ -61,7 +61,7 @@ func main() { defer logger.Sync() zap.ReplaceGlobals(logger) - zap.L().Info("magneticow v0.10.0 has been started.") + zap.L().Info("magneticow v0.11.0 has been started.") zap.L().Info("Copyright (C) 2017-2020 Mert Bora ALPER .") zap.L().Info("Dedicated to Cemile Binay, in whose hands I thrived.") zap.S().Infof("Compiled on %s", compiledOn) diff --git a/go.mod b/go.mod index adca2b7..7385d15 100644 --- a/go.mod +++ b/go.mod @@ -2,27 +2,33 @@ module github.com/boramalper/magnetico require ( github.com/Wessie/appdirs v0.0.0-20141031215813-6573e894f8e2 - github.com/anacrolix/missinggo v1.1.0 - github.com/anacrolix/torrent v1.1.4 + github.com/anacrolix/dht v1.0.1 // indirect + github.com/anacrolix/missinggo v1.2.1 + github.com/anacrolix/missinggo/v2 v2.4.0 // indirect + github.com/anacrolix/torrent v1.14.0 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/dustin/go-humanize v1.0.0 github.com/google/pprof v0.0.0-20190515194954-54271f7e092f // indirect - github.com/gorilla/mux v1.7.2 + github.com/gorilla/mux v1.7.4 github.com/gorilla/schema v1.1.0 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 // indirect github.com/jessevdk/go-flags v1.4.0 github.com/kevinburke/go-bindata v3.16.0+incompatible // indirect github.com/libp2p/go-sockaddr v0.0.1 - github.com/mattn/go-sqlite3 v1.10.0 - github.com/pkg/errors v0.8.1 - github.com/pkg/profile v1.3.0 + github.com/mattn/go-sqlite3 v2.0.3+incompatible + github.com/pkg/errors v0.9.1 + github.com/pkg/profile v1.4.0 github.com/willf/bloom v2.0.3+incompatible - go.uber.org/atomic v1.4.0 // indirect - go.uber.org/multierr v1.1.0 // indirect - go.uber.org/zap v1.10.0 - golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f - golang.org/x/sys v0.0.0-20190516110030-61b9204099cb - golang.org/x/text v0.3.0 + go.uber.org/atomic v1.5.1 // indirect + go.uber.org/multierr v1.4.0 // indirect + go.uber.org/zap v1.14.0 + golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d + golang.org/x/lint v0.0.0-20200130185559-910be7a94367 // indirect + golang.org/x/net v0.0.0-20200222125558-5a598a2470a0 // indirect + golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c + golang.org/x/text v0.3.2 + golang.org/x/tools v0.0.0-20200221224223-e1da425f72fd // indirect + honnef.co/go/tools v0.0.1-2020.1.3 // indirect ) go 1.13