Skip to content

Commit

Permalink
increased version
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovikov committed Sep 20, 2023
1 parent ca008fa commit 0fcf801
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions HFP.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/guumaster/logsymbols"
)

const AppVersion = "0.55.10"
const AppVersion = "0.55.12"

var localAddr *string = flag.String("l", ":9060", "Local HEP listening address")
var remoteAddr *string = flag.String("r", "192.168.2.2:9060", "Remote HEP address")
Expand Down Expand Up @@ -127,6 +127,8 @@ func handleConnection(clientConn net.Conn, destAddr, destProto string) {
destConn = connectToHEPBackend(destAddr, destProto)
}()

defer clientConn.Close()

//reader := bufio.NewReader(clientConn)
for {
//n, err := reader.Read(buf)
Expand All @@ -144,7 +146,6 @@ func handleConnection(clientConn net.Conn, destAddr, destProto string) {
clientLastMetricTimestamp.SetToCurrentTime()

if destConn != nil {

//
if *IPfilter != "" && *IPfilterAction == "pass" {
hepPkt, err := DecodeHEP(buf[:n])
Expand Down Expand Up @@ -210,7 +211,6 @@ func handleConnection(clientConn net.Conn, destAddr, destProto string) {
}
}
accepted = true

}
}
}
Expand Down Expand Up @@ -295,7 +295,7 @@ func handleConnection(clientConn net.Conn, destAddr, destProto string) {

} else {
//Send HEP out to backend
_, err_HEPout := destConn.Write(buf[:n])
bSend, err_HEPout := destConn.Write(buf[:n])
if err_HEPout != nil {
log.Println("||-->", logsymbols.Error, " Sending HEP OUT error:", err_HEPout)
// rb := bytes.NewReader(buf[:data])
Expand Down Expand Up @@ -333,14 +333,12 @@ func handleConnection(clientConn net.Conn, destAddr, destProto string) {
break
}
continue

// return
} else {
if *Debug == "on" {
if string(buf[:n]) == "HELLO HFP" {
log.Println("||-->", logsymbols.Success, " Sending init HELLO HFP successful without filters to", destConn.RemoteAddr())
} else {
log.Println("||-->", logsymbols.Success, " Sending HEP OUT successful without filters to", destConn.RemoteAddr())
log.Println("||-->", logsymbols.Success, " Sending HEP OUT successful without filters to ", destConn.RemoteAddr(), ", sendout: ", bSend)
}
}
}
Expand Down Expand Up @@ -387,7 +385,6 @@ func handleConnection(clientConn net.Conn, destAddr, destProto string) {
}
}
}

}
}

Expand Down Expand Up @@ -564,9 +561,9 @@ func main() {
return
}

for i := 1; i <= 2; i++ {
go handleConnection(clientConn, *remoteAddr, *remoteProto)
}
//for i := 1; i <= 2; i++ {
go handleConnection(clientConn, *remoteAddr, *remoteProto)
//}
}

}
Expand Down

0 comments on commit 0fcf801

Please sign in to comment.