Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Commit

Permalink
Check message type after checking for error
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwget authored and ibuildthecloud committed Mar 22, 2016
1 parent 546e503 commit a149a33
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions rancher/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,6 @@ func (r *RancherService) pipeLogs(container *rancherClient.Container, conn *webs

for {
messageType, bytes, err := conn.ReadMessage()
if messageType != websocket.TextMessage {
continue
}

if err == io.EOF {
return
Expand All @@ -562,7 +559,7 @@ func (r *RancherService) pipeLogs(container *rancherClient.Container, conn *webs
return
}

if len(bytes) <= 3 {
if messageType != websocket.TextMessage || len(bytes) <= 3 {
continue
}

Expand Down

0 comments on commit a149a33

Please sign in to comment.