mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-05 21:38:27 +00:00
Merge pull request #103 from rlerdorf/patch-1
Fix a couple of minor logic problems
This commit is contained in:
commit
9ac94a7b74
@ -201,7 +201,7 @@ class Net_SCP {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$size = filesize($data);
|
$size = filesize($data);
|
||||||
for ($i = 0; $i < $length; $i++) {
|
for ($i = 0; $i < $size; $i += $this->packet_size) {
|
||||||
$this->_send(fgets($fp, $this->packet_size));
|
$this->_send(fgets($fp, $this->packet_size));
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
@ -262,7 +262,7 @@ class Net_SFTP_Stream {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->pos = $this->mode[0] != 'a' ? 0 : $size;
|
$this->pos = $this->mode[0] != 'a' ? 0 : $this->size;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -297,7 +297,7 @@ class Net_SFTP_Stream {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// seems that PHP calls stream_read in 8k chunks
|
// seems that PHP calls stream_read in 8k chunks
|
||||||
call_user_func($this->notification, STREAM_NOTIFY_PROGRESS, STREAM_NOTIFY_SEVERITY_INFO, '', 0, strlen($result), $size);
|
call_user_func($this->notification, STREAM_NOTIFY_PROGRESS, STREAM_NOTIFY_SEVERITY_INFO, '', 0, strlen($result), $this->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($result)) { // ie. false or empty string
|
if (empty($result)) { // ie. false or empty string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user