Merge pull request #47 from openebs/dev
Making sure the required number of bytes are read
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user