mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
Tweaks
This commit is contained in:
parent
e2cd600fde
commit
ae827fbe62
|
|
@ -127,7 +127,7 @@ func Setup(instanceName, storageDirectory string) (*Node, error) {
|
|||
MaxIncomingUniStreams: 0,
|
||||
KeepAlive: true,
|
||||
MaxIdleTimeout: time.Minute * 30,
|
||||
HandshakeTimeout: time.Second * 30,
|
||||
HandshakeTimeout: time.Second * 15,
|
||||
}
|
||||
|
||||
n.log.Println("Public curve25519:", n.core.EncryptionPublicKey())
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ func (n *Node) DialContext(ctx context.Context, network, address string) (net.Co
|
|||
if v, ok := n.coords.Load(address); ok {
|
||||
coords, ok := v.(yggdrasil.Coords)
|
||||
if !ok {
|
||||
n.coords.Delete(address)
|
||||
return nil, errors.New("should have found yggdrasil.Coords but didn't")
|
||||
}
|
||||
n.log.Infof("Coords %s for %q cached, trying to dial", coords.String(), address)
|
||||
|
|
@ -132,7 +133,6 @@ func (n *Node) DialContext(ctx context.Context, network, address string) (net.Co
|
|||
// know about from our direct switch peers.
|
||||
for _, peer := range n.core.GetSwitchPeers() {
|
||||
if peer.PublicKey.String() == address {
|
||||
fmt.Println("*", peer.PublicKey.String(), address)
|
||||
coords = peer.Coords
|
||||
n.log.Infof("%q is a direct peer, coords are %s", address, coords.String())
|
||||
n.coords.Store(address, coords)
|
||||
|
|
|
|||
Loading…
Reference in a new issue