summaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/icewind/smb/src/Connection.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/3rdparty/icewind/smb/src/Connection.php')
-rw-r--r--apps/files_external/3rdparty/icewind/smb/src/Connection.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Connection.php b/apps/files_external/3rdparty/icewind/smb/src/Connection.php
index c857398c327..f48dcb766e4 100644
--- a/apps/files_external/3rdparty/icewind/smb/src/Connection.php
+++ b/apps/files_external/3rdparty/icewind/smb/src/Connection.php
@@ -39,13 +39,22 @@ class Connection extends RawConnection {
if (!$this->isValid()) {
throw new ConnectionException('Connection not valid');
}
- $line = $this->readLine(); //first line is prompt
- $this->checkConnectionError($line);
+ $promptLine = $this->readLine(); //first line is prompt
+ $this->checkConnectionError($promptLine);
$output = array();
$line = $this->readLine();
if ($line === false) {
- throw new ConnectException('Unknown error');
+ if ($promptLine) { //maybe we have some error we missed on the previous line
+ throw new ConnectException('Unknown error (' . $promptLine . ')');
+ } else {
+ $error = $this->readError(); // maybe something on stderr
+ if ($error) {
+ throw new ConnectException('Unknown error (' . $error . ')');
+ } else {
+ throw new ConnectException('Unknown error');
+ }
+ }
}
$length = mb_strlen(self::DELIMITER);
while (mb_substr($line, 0, $length) !== self::DELIMITER) { //next prompt functions as delimiter