Fix #246
This commit is contained in:
parent
0290a1610a
commit
e9386d1016
|
@ -46,6 +46,12 @@ func TestClientDefault(t *testing.T) {
|
||||||
cl.Close()
|
cl.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestClientNilConfig(t *testing.T) {
|
||||||
|
cl, err := NewClient(nil)
|
||||||
|
require.NoError(t, err)
|
||||||
|
cl.Close()
|
||||||
|
}
|
||||||
|
|
||||||
func TestBoltPieceCompletionClosedWhenClientClosed(t *testing.T) {
|
func TestBoltPieceCompletionClosedWhenClientClosed(t *testing.T) {
|
||||||
cfg := TestingConfig()
|
cfg := TestingConfig()
|
||||||
pc, err := storage.NewBoltPieceCompletion(cfg.DataDir)
|
pc, err := storage.NewBoltPieceCompletion(cfg.DataDir)
|
||||||
|
|
|
@ -161,6 +161,9 @@ func (cfg *Config) setDefaults() {
|
||||||
if cfg.DhtStartingNodes == nil {
|
if cfg.DhtStartingNodes == nil {
|
||||||
cfg.DhtStartingNodes = dht.GlobalBootstrapAddrs
|
cfg.DhtStartingNodes = dht.GlobalBootstrapAddrs
|
||||||
}
|
}
|
||||||
|
if cfg.ListenHost == nil {
|
||||||
|
cfg.ListenHost = func(string) string { return "" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type EncryptionPolicy struct {
|
type EncryptionPolicy struct {
|
||||||
|
|
Loading…
Reference in New Issue