Merge branch 'develop' of https://github.com/sshnet/SSH.NET into develop

This commit is contained in:
Gert Driesen
2017-02-06 17:45:10 +01:00
11 changed files with 111 additions and 18 deletions
@@ -890,9 +890,6 @@
<Compile Include="..\Renci.SshNet\Sftp\SftpOpenAsyncResult.cs">
<Link>Sftp\SftpOpenAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpOpenDirAsyncResult.cs">
<Link>Sftp\SftpOpenDirAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpReadAsyncResult.cs">
<Link>Sftp\SftpReadAsyncResult.cs</Link>
</Compile>
@@ -947,7 +944,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
<UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -845,6 +845,9 @@
<Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
<Link>Sftp\Responses\SftpVersionResponse.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpCloseAsyncResult.cs">
<Link>Sftp\SftpCloseAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
<Link>Sftp\SftpDownloadAsyncResult.cs</Link>
</Compile>
@@ -872,12 +875,21 @@
<Compile Include="..\Renci.SshNet\Sftp\SftpMessageTypes.cs">
<Link>Sftp\SftpMessageTypes.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpOpenAsyncResult.cs">
<Link>Sftp\SftpOpenAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpReadAsyncResult.cs">
<Link>Sftp\SftpReadAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpRealPathAsyncResult.cs">
<Link>Sftp\SftpRealPathAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSession.cs">
<Link>Sftp\SftpSession.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SFtpStatAsyncResult.cs">
<Link>Sftp\SFtpStatAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSynchronizeDirectoriesAsyncResult.cs">
<Link>Sftp\SftpSynchronizeDirectoriesAsyncResult.cs</Link>
</Compile>
@@ -925,7 +937,7 @@
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
<SilverlightProjectProperties />
</FlavorProperties>
<UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
<UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -854,6 +854,9 @@
<Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
<Link>Sftp\Responses\SftpVersionResponse.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpCloseAsyncResult.cs">
<Link>Sftp\SftpCloseAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
<Link>Sftp\SftpDownloadAsyncResult.cs</Link>
</Compile>
@@ -881,12 +884,21 @@
<Compile Include="..\Renci.SshNet\Sftp\SftpMessageTypes.cs">
<Link>Sftp\SftpMessageTypes.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpOpenAsyncResult.cs">
<Link>Sftp\SftpOpenAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpReadAsyncResult.cs">
<Link>Sftp\SftpReadAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpRealPathAsyncResult.cs">
<Link>Sftp\SftpRealPathAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSession.cs">
<Link>Sftp\SftpSession.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SFtpStatAsyncResult.cs">
<Link>Sftp\SFtpStatAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSynchronizeDirectoriesAsyncResult.cs">
<Link>Sftp\SftpSynchronizeDirectoriesAsyncResult.cs</Link>
</Compile>
@@ -931,7 +943,7 @@
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
<SilverlightProjectProperties />
</FlavorProperties>
<UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
<UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -1022,6 +1022,48 @@
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileAttributesTest.cs">
<Link>Classes\Sftp\SftpFileAttributesTest.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTestBase.cs">
<Link>Classes\Sftp\SftpFileReaderTestBase.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_DisposeShouldUnblockReadAndReadAhead.cs">
<Link>Classes\Sftp\SftpFileReaderTest_DisposeShouldUnblockReadAndReadAhead.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_LastChunkBeforeEofIsComplete.cs">
<Link>Classes\Sftp\SftpFileReaderTest_LastChunkBeforeEofIsComplete.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_LastChunkBeforeEofIsPartial.cs">
<Link>Classes\Sftp\SftpFileReaderTest_LastChunkBeforeEofIsPartial.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_PreviousChunkIsIncompleteAndEofIsNotReached.cs">
<Link>Classes\Sftp\SftpFileReaderTest_PreviousChunkIsIncompleteAndEofIsNotReached.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_PreviousChunkIsIncompleteAndEofIsReached.cs">
<Link>Classes\Sftp\SftpFileReaderTest_PreviousChunkIsIncompleteAndEofIsReached.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_ReadAheadBeginReadException.cs">
<Link>Classes\Sftp\SftpFileReaderTest_ReadAheadBeginReadException.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_ReadAheadEndInvokeException_DiscardsFurtherReadAheads.cs">
<Link>Classes\Sftp\SftpFileReaderTest_ReadAheadEndInvokeException_DiscardsFurtherReadAheads.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_ReadAheadEndInvokeException_PreventsFurtherReadAheads.cs">
<Link>Classes\Sftp\SftpFileReaderTest_ReadAheadEndInvokeException_PreventsFurtherReadAheads.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_ReadBackBeginReadException.cs">
<Link>Classes\Sftp\SftpFileReaderTest_ReadBackBeginReadException.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_ReadBackEndInvokeException.cs">
<Link>Classes\Sftp\SftpFileReaderTest_ReadBackEndInvokeException.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_Read_ReadAheadExceptionInWaitOnHandle_ChunkAvailable.cs">
<Link>Classes\Sftp\SftpFileReaderTest_Read_ReadAheadExceptionInWaitOnHandle_ChunkAvailable.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_Read_ReadAheadExceptionInWaitOnHandle_NoChunkAvailable.cs">
<Link>Classes\Sftp\SftpFileReaderTest_Read_ReadAheadExceptionInWaitOnHandle_NoChunkAvailable.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileReaderTest_Read_ReahAheadExceptionInBeginRead.cs">
<Link>Classes\Sftp\SftpFileReaderTest_Read_ReahAheadExceptionInBeginRead.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpFileStreamTest_CanRead_Closed_FileAccessRead.cs">
<Link>Classes\Sftp\SftpFileStreamTest_CanRead_Closed_FileAccessRead.cs</Link>
</Compile>
@@ -1346,7 +1388,7 @@
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="c45379b9-17b1-4e89-bc2e-6d41726413e8" />
<UserProperties ProjectLinkReference="c45379b9-17b1-4e89-bc2e-6d41726413e8" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -14,7 +14,6 @@ namespace Renci.SshNet.Tests.Classes.Sftp
public class SftpSessionTest_Connected_RequestRead
{
private Mock<ISession> _sessionMock;
private Mock<IServiceFactory> _serviceFactoryMock;
private Mock<IChannelSession> _channelSessionMock;
private SftpSession _sftpSession;
private int _operationTimeout;
@@ -40,7 +39,6 @@ namespace Renci.SshNet.Tests.Classes.Sftp
_sessionMock = new Mock<ISession>(MockBehavior.Strict);
_channelSessionMock = new Mock<IChannelSession>(MockBehavior.Strict);
_serviceFactoryMock = new Mock<IServiceFactory>(MockBehavior.Strict);
var sequence = new MockSequence();
@@ -84,7 +82,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp
}
);
_sftpSession = new SftpSession(_sessionMock.Object, _operationTimeout, _encoding, _serviceFactoryMock.Object);
_sftpSession = new SftpSession(_sessionMock.Object, _operationTimeout, _encoding);
_sftpSession.Connect();
}
@@ -14,7 +14,6 @@ namespace Renci.SshNet.Tests.Classes.Sftp
{
private Mock<ISession> _sessionMock;
private Mock<IChannelSession> _channelSessionMock;
private Mock<IServiceFactory> _serviceFactoryMock;
private SftpSession _sftpSession;
private int _operationTimeout;
private SftpFileSytemInformation _actual;
@@ -40,7 +39,6 @@ namespace Renci.SshNet.Tests.Classes.Sftp
_sessionMock = new Mock<ISession>(MockBehavior.Strict);
_channelSessionMock = new Mock<IChannelSession>(MockBehavior.Strict);
_serviceFactoryMock = new Mock<IServiceFactory>(MockBehavior.Strict);
var sequence = new MockSequence();
@@ -84,7 +82,7 @@ namespace Renci.SshNet.Tests.Classes.Sftp
}
);
_sftpSession = new SftpSession(_sessionMock.Object, _operationTimeout, _encoding, _serviceFactoryMock.Object);
_sftpSession = new SftpSession(_sessionMock.Object, _operationTimeout, _encoding);
_sftpSession.Connect();
}
@@ -924,6 +924,9 @@
<Compile Include="..\Renci.SshNet\Sftp\Responses\StatVfsResponse.cs">
<Link>Sftp\Responses\StatVfsResponse.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpCloseAsyncResult.cs">
<Link>Sftp\SftpCloseAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
<Link>Sftp\SftpDownloadAsyncResult.cs</Link>
</Compile>
@@ -951,12 +954,21 @@
<Compile Include="..\Renci.SshNet\Sftp\SftpMessageTypes.cs">
<Link>Sftp\SftpMessageTypes.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpOpenAsyncResult.cs">
<Link>Sftp\SftpOpenAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpReadAsyncResult.cs">
<Link>Sftp\SftpReadAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpRealPathAsyncResult.cs">
<Link>Sftp\SftpRealPathAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSession.cs">
<Link>Sftp\SftpSession.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SFtpStatAsyncResult.cs">
<Link>Sftp\SFtpStatAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSynchronizeDirectoriesAsyncResult.cs">
<Link>Sftp\SftpSynchronizeDirectoriesAsyncResult.cs</Link>
</Compile>
@@ -833,6 +833,9 @@
<Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
<Link>Sftp\Responses\SftpVersionResponse.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpCloseAsyncResult.cs">
<Link>Sftp\SftpCloseAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
<Link>Sftp\SftpDownloadAsyncResult.cs</Link>
</Compile>
@@ -860,12 +863,21 @@
<Compile Include="..\Renci.SshNet\Sftp\SftpMessageTypes.cs">
<Link>Sftp\SftpMessageTypes.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpOpenAsyncResult.cs">
<Link>Sftp\SftpOpenAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpReadAsyncResult.cs">
<Link>Sftp\SftpReadAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpRealPathAsyncResult.cs">
<Link>Sftp\SftpRealPathAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSession.cs">
<Link>Sftp\SftpSession.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SFtpStatAsyncResult.cs">
<Link>Sftp\SFtpStatAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSynchronizeDirectoriesAsyncResult.cs">
<Link>Sftp\SftpSynchronizeDirectoriesAsyncResult.cs</Link>
</Compile>
@@ -880,6 +880,9 @@
<Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
<Link>Sftp\Responses\SftpVersionResponse.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpCloseAsyncResult.cs">
<Link>Sftp\SftpCloseAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
<Link>Sftp\SftpDownloadAsyncResult.cs</Link>
</Compile>
@@ -907,12 +910,21 @@
<Compile Include="..\Renci.SshNet\Sftp\SftpMessageTypes.cs">
<Link>Sftp\SftpMessageTypes.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpOpenAsyncResult.cs">
<Link>Sftp\SftpOpenAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpReadAsyncResult.cs">
<Link>Sftp\SftpReadAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpRealPathAsyncResult.cs">
<Link>Sftp\SftpRealPathAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSession.cs">
<Link>Sftp\SftpSession.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SFtpStatAsyncResult.cs">
<Link>Sftp\SFtpStatAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSynchronizeDirectoriesAsyncResult.cs">
<Link>Sftp\SftpSynchronizeDirectoriesAsyncResult.cs</Link>
</Compile>
@@ -958,7 +970,7 @@
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
<UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+1 -1
View File
@@ -51,7 +51,7 @@ namespace Renci.SshNet
/// </returns>
public ISftpSession CreateSftpSession(ISession session, int operationTimeout, Encoding encoding)
{
return new SftpSession(session, operationTimeout, encoding, this);
return new SftpSession(session, operationTimeout, encoding);
}
/// <summary>
+1 -3
View File
@@ -17,7 +17,6 @@ namespace Renci.SshNet.Sftp
private readonly Dictionary<uint, SftpRequest> _requests = new Dictionary<uint, SftpRequest>();
//FIXME: obtain from SftpClient!
private readonly List<byte> _data = new List<byte>(32 * 1024);
private readonly IServiceFactory _serviceFactory;
private EventWaitHandle _sftpVersionConfirmed = new AutoResetEvent(false);
private IDictionary<string, string> _supportedExtensions;
@@ -50,10 +49,9 @@ namespace Renci.SshNet.Sftp
}
}
public SftpSession(ISession session, int operationTimeout, Encoding encoding, IServiceFactory serviceFactory)
public SftpSession(ISession session, int operationTimeout, Encoding encoding)
: base(session, "sftp", operationTimeout, encoding)
{
_serviceFactory = serviceFactory;
}
/// <summary>