Making sure the required number of bytes are read

This commit is contained in:
payes
2017-02-17 18:55:27 +05:30
parent f2d7303a99
commit ddf59bf1cb

View File

@@ -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
}