anacrolix / confluence

Torrent client as a HTTP service
Mozilla Public License 2.0
237 stars 32 forks source link

crash when torrentGrace flag is set to - value #1

Closed arranlomas closed 7 years ago

arranlomas commented 7 years ago
server.go:2317: http: panic serving 127.0.0.1:58347: runtime error: invalid memory address or nil pointer dereference
goroutine 2255 [running]:
net/http.(*conn).serve.func1(0xc0423c6700)
        D:/Go/src/net/http/server.go:1491 +0x131
panic(0x8ad2c0, 0xc04200a0d0)
        D:/Go/src/runtime/panic.go:458 +0x251
github.com/anacrolix/missinggo/refclose.(*Ref).SetCloser(0x0, 0xc04234c240)
        D:/Go/projects/src/github.com/anacrolix/missinggo/refclose/refclose.go:69 +0x2d
github.com/anacrolix/confluence/confluence.withTorrentContext.func1(0xc098c0, 0xc042136000, 0xc04241a1e0)
        D:/Go/projects/src/github.com/anacrolix/confluence/confluence/middlewares.go:32 +0x1de
net/http.HandlerFunc.ServeHTTP(0xc0442240a0, 0xc098c0, 0xc042136000, 0xc04241a1e0)
        D:/Go/src/net/http/server.go:1726 +0x4b
github.com/anacrolix/confluence/confluence.infoHandler(0xc098c0, 0xc042136000, 0xc04241a1e0)
        D:/Go/projects/src/github.com/anacrolix/confluence/confluence/handlers.go:46 +0x9b
net/http.HandlerFunc.ServeHTTP(0x971310, 0xc098c0, 0xc042136000, 0xc04241a1e0)
        D:/Go/src/net/http/server.go:1726 +0x4b
net/http.(*ServeMux).ServeHTTP(0xc042134c60, 0xc098c0, 0xc042136000, 0xc04241a1e0)
        D:/Go/src/net/http/server.go:2022 +0x86
github.com/anacrolix/confluence/confluence.(*Handler).ServeHTTP(0xc04213d4c0, 0xc098c0, 0xc042136000, 0xc04241a1e0)
        D:/Go/projects/src/github.com/anacrolix/confluence/confluence/handler.go:19 +0x199
net/http.serverHandler.ServeHTTP(0xc042146a80, 0xc098c0, 0xc042136000, 0xc04241a000)
        D:/Go/src/net/http/server.go:2202 +0x84
net/http.(*conn).serve(0xc0423c6700, 0xc0a280, 0xc042008dc0)
        D:/Go/src/net/http/server.go:1579 +0x4be
created by net/http.(*Server).Serve
        D:/Go/src/net/http/server.go:2293 +0x454
arranlomas commented 7 years ago

note: makes no difference if other flags are set or not

anacrolix commented 7 years ago

Fixed in 6cdfb29f53dd149cbe53b12635c2a0feaf5a10fa