Skip to content

Commit 35c9ecf

Browse files
committed
Revert to previous code as its a little more clear.
1 parent 3cf6979 commit 35c9ecf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Renci.SshNet/Channels/ChannelSession.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,8 @@ public override ChannelTypes ChannelType
6464
/// </summary>
6565
public virtual void Open()
6666
{
67-
if (IsOpen)
68-
return;
69-
7067
// Try to open channel several times
71-
do
68+
while (!IsOpen && _failedOpenAttempts < ConnectionInfo.RetryAttempts)
7269
{
7370
SendChannelOpenMessage();
7471
try
@@ -81,7 +78,7 @@ public virtual void Open()
8178
ReleaseSemaphore();
8279
throw;
8380
}
84-
} while (!IsOpen && _failedOpenAttempts < ConnectionInfo.RetryAttempts);
81+
}
8582

8683
if (!IsOpen)
8784
throw new SshException(string.Format(CultureInfo.CurrentCulture, "Failed to open a channel after {0} attempts.", _failedOpenAttempts));

0 commit comments

Comments
 (0)