Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #29 from fisherxu/sync
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-wangzefeng authored Jun 1, 2021
2 parents e339319 + 76fc3a4 commit d832643
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pkg/client/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ func (c *WSClient) Connect() (conn.Connection, error) {
var respMsg string
if resp != nil {
body, errRead := ioutil.ReadAll(resp.Body)
if errRead != nil {
if errRead == nil {
respMsg = fmt.Sprintf("response code: %d, response body: %s", resp.StatusCode, string(body))
} else {
respMsg = fmt.Sprintf("response code: %d", resp.StatusCode)
}
resp.Body.Close()
return nil, err
}
klog.Errorf("dial websocket error(%+v), response message: %s", err, respMsg)

Expand Down
2 changes: 1 addition & 1 deletion pkg/conn/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func (conn *WSConnection) handleRawData() {
}

func (conn *WSConnection) handleMessage() {
msg := &model.Message{}
for {
msg := &model.Message{}
err := lane.NewLane(api.ProtocolTypeWS, conn.wsConn).ReadMessage(msg)
if err != nil {
if err != io.EOF {
Expand Down

0 comments on commit d832643

Please sign in to comment.