Making sure the required number of bytes are read
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
|||||||
package iscsit
|
package iscsit
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -122,7 +123,7 @@ func (c *iscsiConnection) init() {
|
|||||||
|
|
||||||
func (c *iscsiConnection) readData(size int) ([]byte, int, error) {
|
func (c *iscsiConnection) readData(size int) ([]byte, int, error) {
|
||||||
var buf = make([]byte, size)
|
var buf = make([]byte, size)
|
||||||
length, err := c.conn.Read(buf)
|
length, err := io.ReadFull(c.conn, buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, -1, err
|
return nil, -1, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user