1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-11-26 20:35:21 +01:00

Merge pull request #421 from bantu/issue/418

SFTP: Only fclose($fp) when $mode & NET_SFTP_LOCAL_FILE.

* bantu/issue/418:
  Only fclose($fp) when $mode & NET_SFTP_LOCAL_FILE.
This commit is contained in:
Andreas Fischer 2014-07-24 17:04:24 +02:00
commit 48a2613cde

View File

@ -1871,7 +1871,9 @@ class Net_SFTP extends Net_SSH2
$subtemp = $offset + $sent;
$packet = pack('Na*N3a*', strlen($handle), $handle, $subtemp / 4294967296, $subtemp, strlen($temp), $temp);
if (!$this->_send_sftp_packet(NET_SFTP_WRITE, $packet)) {
fclose($fp);
if ($mode & NET_SFTP_LOCAL_FILE) {
fclose($fp);
}
return false;
}
$sent+= strlen($temp);