Skip to content

Commit

Permalink
fixed panic for multiple hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovikov committed Jun 24, 2024
1 parent 5011c66 commit c8545bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/sipcapture/heplify/sniffer"
)

const version = "heplify 1.66.3"
const version = "heplify 1.66.4"

func createFlags() {

Expand Down
7 changes: 7 additions & 0 deletions publish/hep.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net"
"os"
"runtime/debug"
"strconv"
"strings"
"time"
"unicode"
Expand Down Expand Up @@ -149,6 +150,12 @@ func (h *HEPOutputer) ReSendPingPacket() {

func (h *HEPOutputer) Send(msg []byte) {
for n := range h.addr {

if h.client[n].conn == nil || h.client[n].writer == nil {
logp.Debug("connection is not up, index: ", strconv.Itoa(n))
continue
}

h.client[n].writer.Write(msg)
err := h.client[n].writer.Flush()
if err != nil {
Expand Down

0 comments on commit c8545bb

Please sign in to comment.