Skip to content

Commit 665759c

Browse files
authored
Merge pull request #17 from matthewvukomanovic/develop
Use Infinite constants where appropriate
2 parents ee3f679 + ef80d2c commit 665759c

File tree

10 files changed

+22
-19
lines changed

10 files changed

+22
-19
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ src/TestResults/
1818
src/.vs/
1919

2020
# Expanded/resolved project.json files
21-
project.lock.json
21+
project.lock.json
22+
23+
# Build outputs
24+
build/target/

build/build.cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set MSBUILD_HOME=%WINDIR%\Microsoft.NET\Framework\v4.0.30319
66
rem MSBuild project file is located in the same directory as the current script
77
set MSBUILD_PROJECT=%~dp0\build.proj
88

9-
set MSBUILD_EXE=%MSBUILD_HOME%\msbuild.exe
9+
set MSBUILD_EXE="%MSBUILD_HOME%\msbuild.exe"
1010

1111
rem verify whether the version of MSBuild that we need is installed
1212
if not exist %MSBUILD_EXE% goto msbuild_missing
1313

1414
rem launch the build script
15-
call %MSBUILD_HOME%\msbuild.exe %MSBUILD_PROJECT% /verbosity:minimal /nologo
15+
call %MSBUILD_EXE% %MSBUILD_PROJECT% /verbosity:minimal /nologo
1616
if errorlevel 1 goto msbuild_failure
1717
goto :EOF
1818

build/build.proj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
<Target Name="Build">
4141
<ItemGroup>
42-
<ProjectToBuild Include="$(MSBuildThisFileDirectory)..\Renci.SshNet.VS2012.sln">
42+
<ProjectToBuild Include="$(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2012.sln">
4343
<Properties>Configuration=Release</Properties>
4444
</ProjectToBuild>
4545
</ItemGroup>
@@ -52,8 +52,8 @@
5252
<Target Name="CopyBuildOutputToPackage" DependsOnTargets="Build" Outputs="%(TargetFramework.Identity)">
5353
<ItemGroup>
5454
<BuildOutput Remove="@(BuildOutput)"/>
55-
<BuildOutput Include="$(MSBuildThisFileDirectory)..\%(TargetFramework.Project)\bin\$(Configuration)\Renci.SshNet.dll"/>
56-
<BuildOutput Include="$(MSBuildThisFileDirectory)..\%(TargetFramework.Project)\bin\$(Configuration)\Renci.SshNet.xml"/>
55+
<BuildOutput Include="$(MSBuildThisFileDirectory)..\src\%(TargetFramework.Project)\bin\$(Configuration)\Renci.SshNet.dll"/>
56+
<BuildOutput Include="$(MSBuildThisFileDirectory)..\src\%(TargetFramework.Project)\bin\$(Configuration)\Renci.SshNet.xml"/>
5757
</ItemGroup>
5858
<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(MSBuildThisFileDirectory)target\package\lib\%(TargetFramework.Moniker)"/>
5959
</Target>
@@ -63,8 +63,8 @@
6363

6464
<Target Name="GenerateSourceZip">
6565
<ItemGroup>
66-
<SourceFiles Include="$(MSBuildThisFileDirectory)..\Renci.SshNet\**" Exclude="$(MSBuildThisFileDirectory)..\Renci.SshNet\bin\**;$(MSBuildThisFileDirectory)..\Renci.SshNet\obj\**"/>
67-
<SourceFiles Include="$(MSBuildThisFileDirectory)..\Renci.SshNet.snk"/>
66+
<SourceFiles Include="$(MSBuildThisFileDirectory)..\src\Renci.SshNet\**" Exclude="$(MSBuildThisFileDirectory)..\src\Renci.SshNet\bin\**;$(MSBuildThisFileDirectory)..\src\Renci.SshNet\obj\**"/>
67+
<SourceFiles Include="$(MSBuildThisFileDirectory)..\src\Renci.SshNet.snk"/>
6868
</ItemGroup>
6969
<Zip
7070
Files="@(SourceFiles)"

build/sandcastle/SSH.NET.shfbproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<ComponentConfigurations>
3333
<ComponentConfig id="Code Block Component" enabled="True" xmlns="">
3434
<component id="Code Block Component">
35-
<basePath value="{@HtmlEncProjectFolder}..\..\Renci.SshNet\bin" />
35+
<basePath value="{@HtmlEncProjectFolder}..\..\src\Renci.SshNet\bin" />
3636
<outputPaths>{@HelpFormatOutputPaths}</outputPaths>
3737
<allowMissingSource value="false" />
3838
<removeRegionMarkers value="false" />
@@ -41,8 +41,8 @@
4141
</ComponentConfig>
4242
</ComponentConfigurations>
4343
<DocumentationSources>
44-
<DocumentationSource sourceFile="..\..\Renci.SshNet\bin\Release\Renci.SshNet.dll" xmlns="" />
45-
<DocumentationSource sourceFile="..\..\Renci.SshNet\bin\Release\Renci.SshNet.xml" xmlns="" />
44+
<DocumentationSource sourceFile="..\..\src\Renci.SshNet\bin\Release\Renci.SshNet.dll" xmlns="" />
45+
<DocumentationSource sourceFile="..\..\src\Renci.SshNet\bin\Release\Renci.SshNet.xml" xmlns="" />
4646
</DocumentationSources>
4747
<MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose</MissingTags>
4848
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>

src/Renci.SshNet.Tests/Classes/Channels/ChannelDirectTcpipTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void SocketShouldBeClosedAndBindShouldEndWhenForwardedPortSignalsClosingE
5757
new MessageEventArgs<ChannelOpenConfirmationMessage>(
5858
new ChannelOpenConfirmationMessage(((ChannelOpenMessage)m).LocalChannelNumber, _remoteWindowSize, _remotePacketSize, _remoteChannelNumber))));
5959
_sessionMock.Setup(p => p.WaitOnHandle(It.IsAny<EventWaitHandle>()))
60-
.Callback<WaitHandle>(p => p.WaitOne(-1));
60+
.Callback<WaitHandle>(p => p.WaitOne(Session.Infinite));
6161

6262
var localPortEndPoint = new IPEndPoint(IPAddress.Loopback, 8122);
6363
using (var localPortListener = new AsyncSocketListener(localPortEndPoint))
@@ -107,7 +107,7 @@ public void SocketShouldBeClosedAndBindShouldEndWhenOnErrorOccurredIsInvoked()
107107
new MessageEventArgs<ChannelOpenConfirmationMessage>(
108108
new ChannelOpenConfirmationMessage(((ChannelOpenMessage)m).LocalChannelNumber, _remoteWindowSize, _remotePacketSize, _remoteChannelNumber))));
109109
_sessionMock.Setup(p => p.WaitOnHandle(It.IsAny<EventWaitHandle>()))
110-
.Callback<WaitHandle>(p => p.WaitOne(-1));
110+
.Callback<WaitHandle>(p => p.WaitOne(Session.Infinite));
111111

112112
var localPortEndPoint = new IPEndPoint(IPAddress.Loopback, 8122);
113113
using (var localPortListener = new AsyncSocketListener(localPortEndPoint))
@@ -159,7 +159,7 @@ public void SocketShouldBeClosedAndEofShouldBeSentToServerWhenClientShutsDownSoc
159159
new ChannelOpenConfirmationMessage(((ChannelOpenMessage) m).LocalChannelNumber,
160160
_remoteWindowSize, _remotePacketSize, _remoteChannelNumber))));
161161
_sessionMock.Setup(p => p.WaitOnHandle(It.IsAny<EventWaitHandle>()))
162-
.Callback<WaitHandle>(p => p.WaitOne(-1));
162+
.Callback<WaitHandle>(p => p.WaitOne(Session.Infinite));
163163
_sessionMock.Setup(p => p.ConnectionInfo).Returns(_connectionInfoMock.Object);
164164
_connectionInfoMock.Setup(p => p.Timeout).Returns(TimeSpan.FromSeconds(60));
165165
_sessionMock.Setup(p => p.TrySendMessage(It.IsAny<ChannelEofMessage>()))

src/Renci.SshNet/NetConfClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private NetConfClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo)
126126
internal NetConfClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory)
127127
: base(connectionInfo, ownsConnectionInfo, serviceFactory)
128128
{
129-
OperationTimeout = new TimeSpan(0, 0, 0, 0, -1);
129+
OperationTimeout = SshNet.Session.InfiniteTimeSpan;
130130
AutomaticMessageIdHandling = true;
131131
}
132132

src/Renci.SshNet/ScpClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private ScpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo)
144144
internal ScpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory)
145145
: base(connectionInfo, ownsConnectionInfo, serviceFactory)
146146
{
147-
OperationTimeout = new TimeSpan(0, 0, 0, 0, -1);
147+
OperationTimeout = SshNet.Session.InfiniteTimeSpan;
148148
BufferSize = 1024 * 16;
149149

150150
if (_byteToChar == null)

src/Renci.SshNet/SftpClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private SftpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo)
229229
internal SftpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory)
230230
: base(connectionInfo, ownsConnectionInfo, serviceFactory)
231231
{
232-
OperationTimeout = new TimeSpan(0, 0, 0, 0, -1);
232+
OperationTimeout = SshNet.Session.InfiniteTimeSpan;
233233
BufferSize = 1024 * 32;
234234
}
235235

src/Renci.SshNet/ShellStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public string EndExpect(IAsyncResult asyncResult)
464464
/// </returns>
465465
public string Expect(string text)
466466
{
467-
return Expect(new Regex(Regex.Escape(text)), TimeSpan.FromMilliseconds(-1));
467+
return Expect(new Regex(Regex.Escape(text)), Session.InfiniteTimeSpan);
468468
}
469469

470470
/// <summary>

src/Renci.SshNet/SshCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ internal SshCommand(ISession session, string commandText, Encoding encoding)
143143
_session = session;
144144
CommandText = commandText;
145145
_encoding = encoding;
146-
CommandTimeout = new TimeSpan(0, 0, 0, 0, -1);
146+
CommandTimeout = Session.InfiniteTimeSpan;
147147
_sessionErrorOccuredWaitHandle = new AutoResetEvent(false);
148148

149149
_session.Disconnected += Session_Disconnected;

0 commit comments

Comments
 (0)