mirror of
https://github.com/LBRYFoundation/reflector.go.git
synced 2025-08-23 17:27:25 +00:00
close unclosed handle
reduce idle timeout for http3 update QUIC library
This commit is contained in:
parent
beff466d18
commit
47f28002ff
5 changed files with 9 additions and 2 deletions
2
go.mod
2
go.mod
|
@ -22,7 +22,7 @@ require (
|
||||||
github.com/lbryio/lbry.go/v2 v2.4.5
|
github.com/lbryio/lbry.go/v2 v2.4.5
|
||||||
github.com/lbryio/lbryschema.go v0.0.0-20190602173230-6d2f69a36f46
|
github.com/lbryio/lbryschema.go v0.0.0-20190602173230-6d2f69a36f46
|
||||||
github.com/lbryio/types v0.0.0-20191228214437-05a22073b4ec
|
github.com/lbryio/types v0.0.0-20191228214437-05a22073b4ec
|
||||||
github.com/lucas-clemente/quic-go v0.17.1
|
github.com/lucas-clemente/quic-go v0.17.2
|
||||||
github.com/phayes/freeport v0.0.0-20171002185219-e27662a4a9d6
|
github.com/phayes/freeport v0.0.0-20171002185219-e27662a4a9d6
|
||||||
github.com/prometheus/client_golang v0.9.2
|
github.com/prometheus/client_golang v0.9.2
|
||||||
github.com/sirupsen/logrus v1.4.2
|
github.com/sirupsen/logrus v1.4.2
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -238,6 +238,8 @@ github.com/lbryio/types v0.0.0-20191228214437-05a22073b4ec/go.mod h1:CG3wsDv5BiV
|
||||||
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
github.com/lucas-clemente/quic-go v0.17.1 h1:ezsH76xpn6hKugfsXUy6voIJBFmAOwnM/Oy9F4b/n+M=
|
github.com/lucas-clemente/quic-go v0.17.1 h1:ezsH76xpn6hKugfsXUy6voIJBFmAOwnM/Oy9F4b/n+M=
|
||||||
github.com/lucas-clemente/quic-go v0.17.1/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE=
|
github.com/lucas-clemente/quic-go v0.17.1/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE=
|
||||||
|
github.com/lucas-clemente/quic-go v0.17.2 h1:4iQInIuNQkPNZmsy9rCnwuOzpH0qGnDo4jn0QfI/qE4=
|
||||||
|
github.com/lucas-clemente/quic-go v0.17.2/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE=
|
||||||
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
||||||
github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5 h1:AsEBgzv3DhuYHI/GiQh2HxvTP71HCCE9E/tzGUzGdtU=
|
github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5 h1:AsEBgzv3DhuYHI/GiQh2HxvTP71HCCE9E/tzGUzGdtU=
|
||||||
github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5/go.mod h1:c2mYKRyMb1BPkO5St0c/ps62L4S0W2NAkaTXj9qEI+0=
|
github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5/go.mod h1:c2mYKRyMb1BPkO5St0c/ps62L4S0W2NAkaTXj9qEI+0=
|
||||||
|
|
|
@ -63,7 +63,10 @@ type availabilityResponse struct {
|
||||||
// Start starts the server listener to handle connections.
|
// Start starts the server listener to handle connections.
|
||||||
func (s *Server) Start(address string) error {
|
func (s *Server) Start(address string) error {
|
||||||
log.Println("HTTP3 peer listening on " + address)
|
log.Println("HTTP3 peer listening on " + address)
|
||||||
quicConf := &quic.Config{HandshakeTimeout: 3 * time.Second}
|
quicConf := &quic.Config{
|
||||||
|
HandshakeTimeout: 3 * time.Second,
|
||||||
|
MaxIdleTimeout: 5 * time.Second,
|
||||||
|
}
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.HandleFunc("/get/{hash}", func(w http.ResponseWriter, r *http.Request) {
|
r.HandleFunc("/get/{hash}", func(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
|
|
|
@ -32,6 +32,7 @@ func NewStore(opts StoreOpts) *Store {
|
||||||
func (p *Store) getClient() (*Client, error) {
|
func (p *Store) getClient() (*Client, error) {
|
||||||
var qconf quic.Config
|
var qconf quic.Config
|
||||||
qconf.HandshakeTimeout = 3 * time.Second
|
qconf.HandshakeTimeout = 3 * time.Second
|
||||||
|
qconf.MaxIdleTimeout = 5 * time.Second
|
||||||
pool, err := x509.SystemCertPool()
|
pool, err := x509.SystemCertPool()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -109,6 +109,7 @@ func (d *DiskBlobStore) Get(hash string) (stream.Blob, error) {
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
defer file.Close()
|
||||||
|
|
||||||
return ioutil.ReadAll(file)
|
return ioutil.ReadAll(file)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue