Przeglądaj źródła

Add NoticeEstablishTunnelTimeout

adam-p 7 lat temu
rodzic
commit
6ae5fb2f40
2 zmienionych plików z 9 dodań i 1 usunięć
  1. 1 1
      psiphon/controller.go
  2. 8 0
      psiphon/notice.go

+ 1 - 1
psiphon/controller.go

@@ -385,7 +385,7 @@ func (controller *Controller) establishTunnelWatcher() {
 		select {
 		select {
 		case <-timer.C:
 		case <-timer.C:
 			if !controller.hasEstablishedOnce() {
 			if !controller.hasEstablishedOnce() {
-				NoticeAlert("failed to establish tunnel before timeout")
+				NoticeEstablishTunnelTimeout(timeout)
 				controller.SignalComponentFailure()
 				controller.SignalComponentFailure()
 			}
 			}
 		case <-controller.runCtx.Done():
 		case <-controller.runCtx.Done():

+ 8 - 0
psiphon/notice.go

@@ -766,6 +766,14 @@ func NoticeLivenessTest(ipAddress string, metrics *livenessTestMetrics, success
 		"success", success)
 		"success", success)
 }
 }
 
 
+// NoticeEstablishTunnelTimeout reports that the configured EstablishTunnelTimeout
+// duration was exceeded.
+func NoticeEstablishTunnelTimeout(timeout time.Duration) {
+	singletonNoticeLogger.outputNotice(
+		"EstablishTunnelTimeout", noticeShowUser,
+		"timeout", timeout)
+}
+
 type repetitiveNoticeState struct {
 type repetitiveNoticeState struct {
 	message string
 	message string
 	repeats int
 	repeats int