Rod Hynes 7 лет назад
Родитель
Сommit
73e15f5f2e
2 измененных файлов с 12 добавлено и 5 удалено
  1. 9 2
      vendor/github.com/sergeyfrolov/gotapdance/tapdance/conn_flow.go
  2. 3 3
      vendor/vendor.json

+ 9 - 2
vendor/github.com/sergeyfrolov/gotapdance/tapdance/conn_flow.go

@@ -394,7 +394,7 @@ func (flowConn *TapdanceFlowConn) actOnReadError(err error) error {
 			return errors.New("reconnect scheduling: timed out waiting for FIN back")
 			return errors.New("reconnect scheduling: timed out waiting for FIN back")
 		}
 		}
 		if flowConn.flowType != flowReadOnly {
 		if flowConn.flowType != flowReadOnly {
-			// notify writer, if needed
+			// notify writer, if there is a writer
 			select {
 			select {
 			case <-flowConn.closed:
 			case <-flowConn.closed:
 				return errors.New("reconnect scheduling: closed while notifiyng writer")
 				return errors.New("reconnect scheduling: closed while notifiyng writer")
@@ -431,7 +431,14 @@ func (flowConn *TapdanceFlowConn) actOnReadError(err error) error {
 	}
 	}
 
 
 	if willReconnect {
 	if willReconnect {
-		Logger().Infoln(flowConn.tdRaw.idStr() + " reconnecting")
+		if flowConn.flowType != flowReadOnly {
+			// notify writer, if there is a writer
+			select {
+			case <-flowConn.closed:
+				return errors.New("reconnect scheduling: closed while notifiyng writer")
+			case flowConn.reconnectStarted <- struct{}{}:
+			}
+		}
 		if (flowConn.flowType != flowUpload && !flowConn.finSent) ||
 		if (flowConn.flowType != flowUpload && !flowConn.finSent) ||
 			err == io.ErrUnexpectedEOF {
 			err == io.ErrUnexpectedEOF {
 			Logger().Infoln(flowConn.tdRaw.idStr() + " reconnect: FIN is unexpected")
 			Logger().Infoln(flowConn.tdRaw.idStr() + " reconnect: FIN is unexpected")

+ 3 - 3
vendor/vendor.json

@@ -496,10 +496,10 @@
 			"revisionTime": "2019-03-18T20:34:37Z"
 			"revisionTime": "2019-03-18T20:34:37Z"
 		},
 		},
 		{
 		{
-			"checksumSHA1": "OFEJ79I9RzBbfcBgS3FiDZ3/Zp4=",
+			"checksumSHA1": "yfje0scynTtzRYlG+pGGh3bi9rc=",
 			"path": "github.com/sergeyfrolov/gotapdance/tapdance",
 			"path": "github.com/sergeyfrolov/gotapdance/tapdance",
-			"revision": "f30ba05c9bd842d4221ccb73645fe2a0e1a0e1f6",
-			"revisionTime": "2019-03-18T20:34:37Z"
+			"revision": "a67708a49212a7fdf7dda54c0a1a488198dc8a0d",
+			"revisionTime": "2019-03-19T17:16:21Z"
 		},
 		},
 		{
 		{
 			"checksumSHA1": "Egp3n8yTaAuVtrA14LJrTWDgkO4=",
 			"checksumSHA1": "Egp3n8yTaAuVtrA14LJrTWDgkO4=",