mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-28 12:10:59 +00:00
SSH2: Logging updates
This commit is contained in:
parent
bf6da217c1
commit
093a182904
@ -2869,6 +2869,11 @@ class Net_SSH2 {
|
|||||||
*/
|
*/
|
||||||
function _append_log($message_number, $message)
|
function _append_log($message_number, $message)
|
||||||
{
|
{
|
||||||
|
// remove the byte identifying the message type from all but the first two messages (ie. the identification strings)
|
||||||
|
if (strlen($message_number) > 2) {
|
||||||
|
$this->_string_shift($message);
|
||||||
|
}
|
||||||
|
|
||||||
switch (NET_SSH2_LOGGING) {
|
switch (NET_SSH2_LOGGING) {
|
||||||
// useful for benchmarks
|
// useful for benchmarks
|
||||||
case NET_SSH2_LOG_SIMPLE:
|
case NET_SSH2_LOG_SIMPLE:
|
||||||
@ -2888,7 +2893,15 @@ class Net_SSH2 {
|
|||||||
// passwords won't be filtered out and select other packets may not be correctly
|
// passwords won't be filtered out and select other packets may not be correctly
|
||||||
// identified
|
// identified
|
||||||
case NET_SSH2_LOG_REALTIME:
|
case NET_SSH2_LOG_REALTIME:
|
||||||
echo "<pre>\r\n" . $this->_format_log(array($message), array($message_number)) . "\r\n</pre>\r\n";
|
switch (PHP_SAPI) {
|
||||||
|
case 'cli':
|
||||||
|
$start = $stop = "\r\n";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$start = '<pre>';
|
||||||
|
$stop = '</pre>';
|
||||||
|
}
|
||||||
|
echo $start . $this->_format_log(array($message), array($message_number)) . $stop;
|
||||||
@flush();
|
@flush();
|
||||||
@ob_flush();
|
@ob_flush();
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user