File tree Expand file tree Collapse file tree 8 files changed +29
-21
lines changed
Security/Cryptography/Hashes Expand file tree Collapse file tree 8 files changed +29
-21
lines changed Original file line number Diff line number Diff line change 2
2
<package xmlns =" http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd" >
3
3
<metadata >
4
4
<id >SSH.NET</id >
5
- <version >2014.4.6-beta1 </version >
5
+ <version >2014.4.6-beta2 </version >
6
6
<title >SSH.NET</title >
7
7
<authors >Renci</authors >
8
8
<owners >olegkap</owners >
Original file line number Diff line number Diff line change @@ -257,22 +257,7 @@ public void SendKeepAlive()
257
257
{
258
258
CheckDisposed ( ) ;
259
259
260
- // only send keep-alive message when we still have a session
261
- if ( Session != null )
262
- {
263
- // do not send multiple keep-alive messages concurrently
264
- if ( Monitor . TryEnter ( _keepAliveLock ) )
265
- {
266
- try
267
- {
268
- Session . TrySendMessage ( new IgnoreMessage ( ) ) ;
269
- }
270
- finally
271
- {
272
- Monitor . Exit ( _keepAliveLock ) ;
273
- }
274
- }
275
- }
260
+ SendKeepAliveMessage ( ) ;
276
261
}
277
262
278
263
/// <summary>
@@ -401,6 +386,26 @@ private void StopKeepAliveTimer()
401
386
_keepAliveTimer = null ;
402
387
}
403
388
389
+ private void SendKeepAliveMessage ( )
390
+ {
391
+ // do nothing if we have disposed or disconnected
392
+ if ( Session == null )
393
+ return ;
394
+
395
+ // do not send multiple keep-alive messages concurrently
396
+ if ( Monitor . TryEnter ( _keepAliveLock ) )
397
+ {
398
+ try
399
+ {
400
+ Session . TrySendMessage ( new IgnoreMessage ( ) ) ;
401
+ }
402
+ finally
403
+ {
404
+ Monitor . Exit ( _keepAliveLock ) ;
405
+ }
406
+ }
407
+ }
408
+
404
409
/// <summary>
405
410
/// Starts the keep-alive timer.
406
411
/// </summary>
@@ -414,7 +419,7 @@ private void StartKeepAliveTimer()
414
419
return ;
415
420
416
421
if ( _keepAliveTimer == null )
417
- _keepAliveTimer = new Timer ( state => SendKeepAlive ( ) ) ;
422
+ _keepAliveTimer = new Timer ( state => SendKeepAliveMessage ( ) ) ;
418
423
_keepAliveTimer . Change ( _keepAliveInterval , _keepAliveInterval ) ;
419
424
}
420
425
}
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ protected override void StartPort()
63
63
/// Stops local port forwarding, and waits for the specified timeout until all pending
64
64
/// requests are processed.
65
65
/// </summary>
66
+ /// <param name="timeout">The maximum amount of time to wait for pending requests to finish processing.</param>
66
67
protected override void StopPort ( TimeSpan timeout )
67
68
{
68
69
if ( IsStarted )
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ protected override void StartPort()
112
112
/// Stops local port forwarding, and waits for the specified timeout until all pending
113
113
/// requests are processed.
114
114
/// </summary>
115
+ /// <param name="timeout">The maximum amount of time to wait for pending requests to finish processing.</param>
115
116
protected override void StopPort ( TimeSpan timeout )
116
117
{
117
118
if ( IsStarted )
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ protected override void StartPort()
134
134
/// <summary>
135
135
/// Stops remote port forwarding.
136
136
/// </summary>
137
+ /// <param name="timeout">The maximum amount of time to wait for pending requests to finish processing.</param>
137
138
protected override void StopPort ( TimeSpan timeout )
138
139
{
139
140
// if the port not started, then there's nothing to stop
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ internal partial interface IServiceFactory
24
24
/// Creates a new <see cref="ISftpSession"/> in a given <see cref="ISession"/> and with
25
25
/// the specified operation timeout and encoding.
26
26
/// </summary>
27
- /// <param name="session">The <see cref="ISession"/> to create the <see cref="INetConfSession "/> in.</param>
27
+ /// <param name="session">The <see cref="ISession"/> to create the <see cref="ISftpSession "/> in.</param>
28
28
/// <param name="operationTimeout">The operation timeout.</param>
29
29
/// <param name="encoding">The encoding.</param>
30
30
/// <returns>
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public override bool CanTransformMultipleBlocks
48
48
/// <summary>
49
49
/// Initializes a new instance of the <see cref="SHA512Hash" /> class.
50
50
/// </summary>
51
- public SHA2HashBase ( )
51
+ protected SHA2HashBase ( )
52
52
{
53
53
this . _buffer = new byte [ 8 ] ;
54
54
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public ISession CreateSession(ConnectionInfo connectionInfo)
27
27
/// Creates a new <see cref="ISftpSession"/> in a given <see cref="ISession"/> and with
28
28
/// the specified operation timeout and encoding.
29
29
/// </summary>
30
- /// <param name="session">The <see cref="ISession"/> to create the <see cref="INetConfSession "/> in.</param>
30
+ /// <param name="session">The <see cref="ISession"/> to create the <see cref="ISftpSession "/> in.</param>
31
31
/// <param name="operationTimeout">The operation timeout.</param>
32
32
/// <param name="encoding">The encoding.</param>
33
33
/// <returns>
You can’t perform that action at this time.
0 commit comments