Skip to content

Commit

Permalink
fixed reconnect condition
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovikov committed Aug 14, 2024
1 parent 04b25db commit bc9f7c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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.6"
const version = "heplify 1.66.7"

func createFlags() {

Expand Down
12 changes: 6 additions & 6 deletions publish/hep.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ func (h *HEPOutputer) Send(msg []byte) {
onceSent := false
for n := range h.addr {

var err error

if h.client[n].conn == nil || h.client[n].writer == nil {
logp.Debug("connection is not up", fmt.Sprintf("index: %d, Len: %d, once: %v", n, len(h.addr), onceSent))
if config.Cfg.HEPBufferEnable && (!onceSent && n == (len(h.addr)-1)) {
h.copyHEPbufftoFile(msg)
}
continue
err = fmt.Errorf("connection is broken")
} else {
h.client[n].writer.Write(msg)
err = h.client[n].writer.Flush()
}

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

0 comments on commit bc9f7c3

Please sign in to comment.