Added (untested) fix for possibly spurious IPC crash condition.

shw_dev
Stephen Watt 7 years ago
parent 96f6e3bbe5
commit ae1f6f12d0

@ -337,12 +337,7 @@ const OzSocketName = "@oz-control"
var bSockName = OzSocketName
var messageFactory = ipc.NewMsgFactory(
new(ListProxiesMsg),
new(ListProxiesResp),
)
func clientConnect() (*ipc.MsgConn, error) {
func init() {
bSockName = os.Getenv("SOCKET_NAME")
if bSockName != "" {
@ -356,7 +351,14 @@ func clientConnect() (*ipc.MsgConn, error) {
} else {
bSockName = OzSocketName
}
}
var messageFactory = ipc.NewMsgFactory(
new(ListProxiesMsg),
new(ListProxiesResp),
)
func clientConnect() (*ipc.MsgConn, error) {
return ipc.Connect(bSockName, messageFactory, nil)
}

@ -248,7 +248,7 @@ func (r *Rule) parse(s string) bool {
r.saddr = nil
parts := strings.Split(s, "|")
if len(parts) < 4 || len(parts) > 6 {
log.Notice("invalid number ", len(parts), " of rule parts in line ", s)
log.Notice("Error: invalid number ", len(parts), " of rule parts in line ", s)
return false
}
if parts[2] == "SYSTEM" {
@ -276,7 +276,7 @@ func (r *Rule) parse(s string) bool {
r.saddr = net.ParseIP(parts[5])
if r.saddr == nil {
log.Notice("invalid source IP ", parts[5], " in line ", s)
log.Notice("Error: invalid source IP ", parts[5], " in line ", s)
return false
}

Loading…
Cancel
Save