mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-12 09:51:32 +00:00
cosmetics
This commit is contained in:
parent
e58427221d
commit
b5e80bc176
@ -1807,6 +1807,9 @@ class SFTP extends SSH2
|
|||||||
$callback = false;
|
$callback = false;
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case $mode & self::SOURCE_CALLBACK;
|
case $mode & self::SOURCE_CALLBACK;
|
||||||
|
if (!is_callable($data)) {
|
||||||
|
throw new Exception('if you specify SOURCE_CALLBACK then $data should be callable');
|
||||||
|
}
|
||||||
$callback = $data;
|
$callback = $data;
|
||||||
// do nothing
|
// do nothing
|
||||||
break;
|
break;
|
||||||
@ -1852,7 +1855,9 @@ class SFTP extends SSH2
|
|||||||
while ($callback || $sent < $size) {
|
while ($callback || $sent < $size) {
|
||||||
if ($callback) {
|
if ($callback) {
|
||||||
$temp = call_user_func($callback, $sftp_packet_size);
|
$temp = call_user_func($callback, $sftp_packet_size);
|
||||||
if (is_null($temp)) break;
|
if (is_null($temp)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$temp = isset($fp) ? fread($fp, $sftp_packet_size) : substr($data, $sent, $sftp_packet_size);
|
$temp = isset($fp) ? fread($fp, $sftp_packet_size) : substr($data, $sent, $sftp_packet_size);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user