Merge pull request #47 from openebs/dev

Making sure the required number of bytes are read
This commit is contained in:
Lei Xue
2017-02-18 14:37:49 +08:00
committed by GitHub

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
}