shw-merge
xSmurf 7 years ago
parent 8054062418
commit c01894f35c

@ -319,7 +319,7 @@ func createListStore(general bool) *gtk.ListStore {
func addRequest(listStore *gtk.ListStore, path, proto string, pid int, ipaddr, hostname string, port, uid, gid int, origin string, is_socks bool, optstring string, sandbox string) *decisionWaiter {
if listStore == nil {
listStore = globalLS
waitTimes := []int{ 1, 2, 5, 10 }
waitTimes := []int{1, 2, 5, 10}
if listStore == nil {
log.Print("SGFW prompter was not ready to receive firewall request... waiting")
@ -344,10 +344,10 @@ func addRequest(listStore *gtk.ListStore, path, proto string, pid int, ipaddr, h
iter := listStore.Append()
if (is_socks) {
if ((optstring != "") && (strings.Index(optstring, "SOCKS") == -1)) {
if is_socks {
if (optstring != "") && (strings.Index(optstring, "SOCKS") == -1) {
optstring = "SOCKS5 / " + optstring
} else if (optstring == "") {
} else if optstring == "" {
optstring = "SOCKS5"
}
}
@ -868,7 +868,7 @@ func main() {
box.PackStart(bb, false, false, 5)
box.PackStart(editbox, false, false, 5)
scrollbox.Add(tv)
// box.PackStart(tv, false, true, 5)
// box.PackStart(tv, false, true, 5)
box.PackStart(scrollbox, false, true, 5)
tv.AppendColumn(createColumn("#", 0))
@ -1005,9 +1005,9 @@ func main() {
})
scrollbox.SetSizeRequest(600, 400)
// Notebook.AppendPage(scrollbox, nbLabel)
// Notebook.AppendPage(scrollbox, nbLabel)
Notebook.AppendPage(box, nbLabel)
// setup_settings()
// setup_settings()
mainWin.Add(Notebook)
if userPrefs.Winheight > 0 && userPrefs.Winwidth > 0 {

@ -5,8 +5,8 @@ import (
"fmt"
"os"
"path/filepath"
"regexp"
"reflect"
"regexp"
"github.com/gotk3/gotk3/glib"
"github.com/gotk3/gotk3/gtk"
@ -39,9 +39,9 @@ func builderForDefinition(uiName string) *gtk.Builder {
maj := gtk.GetMajorVersion()
min := gtk.GetMinorVersion()
if ((maj == 3) && (min < 20)) {
if (maj == 3) && (min < 20) {
fmt.Fprintf(os.Stderr,
"Attempting runtime work-around for older versions of libgtk-3...\n");
"Attempting runtime work-around for older versions of libgtk-3...\n")
dep_re := regexp.MustCompile(`<\s?property\s+name\s?=\s?"icon_size"\s?>.+<\s?/property\s?>`)
template = dep_re.ReplaceAllString(template, ``)

@ -53,11 +53,11 @@ func (p *prompter) prompt(policy *Policy) {
func (p *prompter) promptLoop() {
p.lock.Lock()
for {
// fmt.Println("XXX: promptLoop() outer")
// fmt.Println("XXX: promptLoop() outer")
for p.processNextPacket() {
// fmt.Println("XXX: promptLoop() inner")
// fmt.Println("XXX: promptLoop() inner")
}
// fmt.Println("promptLoop() wait")
// fmt.Println("promptLoop() wait")
p.cond.Wait()
}
}
@ -79,7 +79,7 @@ func (p *prompter) processNextPacket() bool {
empty := true
for {
pc, empty = p.nextConnection()
// fmt.Println("XXX: processNextPacket() loop; empty = ", empty, " / pc = ", pc)
// fmt.Println("XXX: processNextPacket() loop; empty = ", empty, " / pc = ", pc)
if pc == nil && empty {
return false
} else if pc == nil {
@ -90,7 +90,7 @@ func (p *prompter) processNextPacket() bool {
}
p.lock.Unlock()
defer p.lock.Lock()
// fmt.Println("XXX: Waiting for prompt lock go...")
// fmt.Println("XXX: Waiting for prompt lock go...")
for {
promptLock.Lock()
if outstandingPrompts >= MAX_PROMPTS {
@ -106,9 +106,9 @@ func (p *prompter) processNextPacket() bool {
break
}
// fmt.Println("XXX: Passed prompt lock!")
// fmt.Println("XXX: Passed prompt lock!")
outstandingPrompts++
// fmt.Println("XXX: Incremented outstanding to ", outstandingPrompts)
// fmt.Println("XXX: Incremented outstanding to ", outstandingPrompts)
promptLock.Unlock()
// if !pc.getPrompting() {
pc.setPrompting(true)
@ -120,7 +120,7 @@ func (p *prompter) processNextPacket() bool {
func processReturn(pc pendingConnection) {
promptLock.Lock()
outstandingPrompts--
// fmt.Println("XXX: Return decremented outstanding to ", outstandingPrompts)
// fmt.Println("XXX: Return decremented outstanding to ", outstandingPrompts)
promptLock.Unlock()
pc.setPrompting(false)
}

Loading…
Cancel
Save