Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Novgorodov Igor, PMK-TV-OP authored and Novgorodov Igor, PMK-TV-OP committed May 15, 2019
1 parent b2e83b2 commit b5d1665
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.3.0
14 changes: 7 additions & 7 deletions input.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"encoding/binary"
"encoding/json"
"fmt"
"io"
"net"
Expand Down Expand Up @@ -66,12 +65,12 @@ func newInput(c *inputCfg) (i *input, err error) {
}

if c.Listen == "" && c.ListenWS == "" {
return nil, fmt.Errorf("At least one of listenTCP/listenWS should be specified")
return nil, fmt.Errorf("At least one of listen/listenWS should be specified")
}

if c.Listen != "" {
if i.listener, err = listen(c.Listen); err != nil {
return nil, fmt.Errorf("Unable to listen to '%s': %s", c.Listen, err)
return nil, fmt.Errorf("Unable to listen on '%s': %s", c.Listen, err)
}

i.wgAccept.Add(1)
Expand Down Expand Up @@ -259,9 +258,7 @@ func (i *input) hanleWebsocketConnection(w http.ResponseWriter, r *http.Request)
)

sendWSError := func(msg string) error {
errMsg := &wsError{msg}
js, _ := json.Marshal(errMsg)
return c.WriteMessage(websocket.TextMessage, js)
return c.WriteJSON(wsError{msg})
}

for {
Expand Down Expand Up @@ -293,6 +290,9 @@ func (i *input) hanleWebsocketConnection(w http.ResponseWriter, r *http.Request)
}

i.sendEvents([]*Event{ev})
if err = c.WriteMessage(websocket.TextMessage, []byte(`{}`)); err != nil {
return
}
}
}

Expand All @@ -315,7 +315,7 @@ func (i *input) readTCPMessage(c net.Conn) (err error) {
if err = pb.Unmarshal(buf, msg); err != nil {
i.Errorf("Unable to unmarshal Protobuf message: %s", err)
// Don't disconnect just because of unmarshal error
// Try to send error message and wait for next event batch
// Try to send error message and wait for next message
return i.sendReply(false, "Unable to decode Protobuf message", c)
}

Expand Down

0 comments on commit b5d1665

Please sign in to comment.