From 978a11607e311def7b4a40e7f292be7c101c6a10 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Mon, 10 May 2010 16:16:35 +0000 Subject: [PATCH] - more useful error message if the server closes the connection after sending their identification string git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@108 21d32557-59b3-4da0-833f-c5933fad653e --- phpseclib/Net/SSH2.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 74049332..8cce18dc 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -60,7 +60,7 @@ * @author Jim Wigginton * @copyright MMVII Jim Wigginton * @license http://www.gnu.org/licenses/lgpl.txt - * @version $Id: SSH2.php,v 1.46 2010-04-27 21:29:36 terrafrost Exp $ + * @version $Id: SSH2.php,v 1.47 2010-05-10 16:16:35 terrafrost Exp $ * @link http://phpseclib.sourceforge.net */ @@ -667,6 +667,11 @@ class Net_SSH2 { $temp.= fgets($this->fsock, 255); } + if (feof($this->fsock)) { + user_error('Connection closed by server', E_USER_NOTICE); + return false; + } + $ext = array(); if (extension_loaded('mcrypt')) { $ext[] = 'mcrypt';