test(session): add unit tests for session behavior
This commit is contained in:
+3
-1
@@ -412,9 +412,11 @@ func readSSHString(reader io.Reader) (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
strBytes := make([]byte, length)
|
strBytes := make([]byte, length)
|
||||||
if _, err := reader.Read(strBytes); err != nil {
|
if length > 0 {
|
||||||
|
if _, err := io.ReadFull(reader, strBytes); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return string(strBytes), nil
|
return string(strBytes), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user