From a8136fecccd2fc31f89c8c34f4bdc6ac8264193a Mon Sep 17 00:00:00 2001
From: Rick Carback <rick@privategrity.com>
Date: Wed, 31 Jul 2019 19:07:34 +0000
Subject: [PATCH] Whoops, fix for loop logic

---
 cmd/root.go     | 2 +-
 io/messaging.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/root.go b/cmd/root.go
index 180fb42e6..c2f704d9d 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -447,7 +447,7 @@ var rootCmd = &cobra.Command{
 			}
 		} else {
 			// Wait up to 45 seconds to receive a message
-			for end, timeout := true, time.After(45*time.Second); end; {
+			for end, timeout := false, time.After(45*time.Second); !end; {
 				if text.MessagesReceived > 0 {
 					end = true
 				}
diff --git a/io/messaging.go b/io/messaging.go
index e2c0f2219..74694176b 100644
--- a/io/messaging.go
+++ b/io/messaging.go
@@ -208,7 +208,7 @@ func handleE2ESending(session user.Session,
 
 	// FIXME: This is a hack to prevent a crash, this function should be
 	//        able to block until this condition is true.
-	for end, timeout := false, time.After(60*time.Second); end; {
+	for end, timeout := false, time.After(60*time.Second); !end; {
 		if rekey {
 			// Get send Rekey
 			key, action = km.PopRekey()
-- 
GitLab