Compare commits
3 Commits
v1.0.0-rc1
...
v1.0.0-rc3
Author | SHA1 | Date | |
---|---|---|---|
874b1c541a | |||
28dd17ccee | |||
a84e22ce61 |
@ -26,7 +26,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
version = "1.0.0-rc"
|
||||
version = "1.0.0-rc3"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -177,8 +177,6 @@ func handleConnection(connClt net.Conn, conLdap *ldap.Conn) {
|
||||
if err.Error() != "EOF" && !strings.HasSuffix(err.Error(), "i/o timeout") {
|
||||
logstream.Errorf("Error reading connection: %v\n", err.Error())
|
||||
}
|
||||
//sendResponse(connClt, err.Error(), 500)
|
||||
//continue
|
||||
return
|
||||
}
|
||||
|
||||
@ -303,7 +301,7 @@ func connectLdap() (*ldap.Conn, error) {
|
||||
}
|
||||
err = conLdap.Bind(*ldapUser, *ldapPass)
|
||||
if err != nil {
|
||||
logstream.Errorf("Error binding LDAP: ", err)
|
||||
logstream.Errorf("Error binding LDAP: %s", err)
|
||||
return conLdap, err
|
||||
}
|
||||
return conLdap, err
|
||||
@ -351,7 +349,7 @@ func main() {
|
||||
ldapBaseDN = fs.String("ldapDN", "", "LDAP base DN (also via LDAPDN env var)")
|
||||
ldapUser = fs.String("ldapUser", "", "LDAP user DN (also via LDAPUSER env var)")
|
||||
ldapPass = fs.String("ldapPass", "", "LDAP user password (also via LDAPPASS env var)")
|
||||
pidFilePath = fs.String("pidfile", "/var/run/mynettcptable/mynettcptable.pid", "PID File (also via PIDFILE env var)")
|
||||
pidFilePath = fs.String("pidfile", "", "PID File (also via PIDFILE env var). Creates pidfile only if defined")
|
||||
refreshInterval = fs.Int("refresh", 300, "Net cache update interval in seconds")
|
||||
timeout = fs.Int("timeout", 5, "timeout in seconds")
|
||||
_ = fs.String("config", "", "config file (optional)")
|
||||
@ -405,14 +403,14 @@ func main() {
|
||||
logstream.Hooks.Add(hook)
|
||||
}
|
||||
|
||||
if pid, err := pidfile.Create(*pidFilePath); err != nil {
|
||||
logstream.Fatal(err)
|
||||
} else {
|
||||
defer pid.Clear()
|
||||
if len(*pidFilePath) > 0 {
|
||||
if pid, err := pidfile.Create(*pidFilePath); err != nil {
|
||||
logstream.Fatal(err)
|
||||
} else {
|
||||
defer pid.Clear()
|
||||
}
|
||||
}
|
||||
|
||||
//defer logstream.Close()
|
||||
|
||||
logstream.Infof("Start listening for incoming connections on %s\n", *listen)
|
||||
run()
|
||||
}
|
||||
|
Reference in New Issue
Block a user