Permalink
Browse files

Bug 1464: Session instance could not be reused for multiple ScanFinge…

…rprint calls

https://winscp.net/tracker/1464
(cherry picked from commit 677ff5f)

Source commit: a248eac60318c6a6998b1192ef18649e476e40f4
  • Loading branch information...
martinprikryl committed Sep 30, 2016
1 parent 7995201 commit 1127768f28f27ba7e43489ec3006ee2399863889
Showing with 10 additions and 2 deletions.
  1. +10 −2 dotnet/Session.cs
@@ -114,8 +114,7 @@ public Session()
{
Timeout = new TimeSpan(0, 1, 0);
_reconnectTime = new TimeSpan(0, 2, 0); // keep in sync with TScript::OptionImpl
Output = new StringCollection();
_error = new StringCollection();
ResetOutput();
_operationResults = new List<OperationResultBase>();
_events = new List<Action>();
_eventsEvent = new AutoResetEvent(false);
@@ -127,6 +126,12 @@ public Session()
}
}
private void ResetOutput()
{
Output = new StringCollection();
_error = new StringCollection();
}
public void Dispose()
{
using (Logger.CreateCallstackAndLock())
@@ -176,6 +181,7 @@ public void Open(SessionOptions sessionOptions)
try
{
SetupTempPath();
ResetOutput();
_process = ExeSessionProcess.CreateForSession(this);
@@ -332,6 +338,8 @@ public string ScanFingerprint(SessionOptions sessionOptions)
try
{
ResetOutput();
string command;
string log; // unused
SessionOptionsToUrlAndSwitches(sessionOptions, true, out command, out log);

0 comments on commit 1127768

Please sign in to comment.