From ddf59bf1cb743d27b804f22590375e2b80982c3c Mon Sep 17 00:00:00 2001 From: payes Date: Fri, 17 Feb 2017 18:55:27 +0530 Subject: [PATCH] Making sure the required number of bytes are read --- pkg/port/iscsit/conn.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/port/iscsit/conn.go b/pkg/port/iscsit/conn.go index a8aed77..f9b0775 100644 --- a/pkg/port/iscsit/conn.go +++ b/pkg/port/iscsit/conn.go @@ -17,6 +17,7 @@ limitations under the License. package iscsit import ( + "io" "net" "sort" "sync" @@ -122,7 +123,7 @@ func (c *iscsiConnection) init() { func (c *iscsiConnection) readData(size int) ([]byte, int, error) { var buf = make([]byte, size) - length, err := c.conn.Read(buf) + length, err := io.ReadFull(c.conn, buf) if err != nil { return nil, -1, err }