diff --git a/sgfw/policy.go b/sgfw/policy.go index 33e3730..c7846b0 100644 --- a/sgfw/policy.go +++ b/sgfw/policy.go @@ -236,7 +236,6 @@ fmt.Println("processPromptResult(): p.promptInProgress = ", p.promptInProgress) func (p *Policy) nextPending() (pendingConnection, bool) { p.lock.Lock() -fmt.Println("nextPending(): len = ", len(p.pendingQueue)) defer p.lock.Unlock() if !DoMultiPrompt { if len(p.pendingQueue) == 0 { @@ -250,17 +249,13 @@ fmt.Println("nextPending(): len = ", len(p.pendingQueue)) } // for len(p.pendingQueue) != 0 { -fmt.Println("nextPending() loop: len = ", len(p.pendingQueue)) for i := 0; i < len(p.pendingQueue); i++ { - fmt.Printf("pendingqueue %v: %v\n", i, p.pendingQueue[i].getPrompting()) if !p.pendingQueue[i].getPrompting() { return p.pendingQueue[i], false } } // } -fmt.Println("nextPending() returning") - return nil, false } diff --git a/sgfw/prompt.go b/sgfw/prompt.go index 010dac0..3888bed 100644 --- a/sgfw/prompt.go +++ b/sgfw/prompt.go @@ -6,6 +6,7 @@ import ( "strconv" "strings" "sync" + "time" "github.com/godbus/dbus" "github.com/subgraph/fw-daemon/proc-coroner" @@ -195,7 +196,6 @@ func (p *prompter) processConnection(pc pendingConnection) { } func (p *prompter) nextConnection() (pendingConnection, bool) { -fmt.Println("nextConnection()") for { if len(p.policyQueue) == 0 { return nil, true @@ -205,6 +205,10 @@ fmt.Println("nextConnection()") if pc == nil && qempty { p.removePolicy(policy) } else { + if pc == nil && !qempty { + fmt.Println("FIX ME: I NEED TO SLEEP ON A WAKEABLE CONDITION PROPERLY!!") + time.Sleep(time.Millisecond * 300) + } return pc, qempty } }