浏览代码

cmd/syncthing: Increase timeout in hello message exchange

Required to establish connections on high latency links

Skip-check: authors

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3286
perewa 9 年之前
父节点
当前提交
11b9212948
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/connections/service.go

+ 1 - 1
lib/connections/service.go

@@ -554,7 +554,7 @@ func (s *Service) getListenerFactory(cfg config.Configuration, uri *url.URL) (li
 }
 
 func exchangeHello(c net.Conn, h protocol.HelloMessage) (protocol.HelloMessage, error) {
-	if err := c.SetDeadline(time.Now().Add(2 * time.Second)); err != nil {
+	if err := c.SetDeadline(time.Now().Add(20 * time.Second)); err != nil {
 		return protocol.HelloMessage{}, err
 	}
 	defer c.SetDeadline(time.Time{})