Skip to content

Commit

Permalink
Added StaleDataCheck property (default = true) that allows you to ski…
Browse files Browse the repository at this point in the history
…p checking the socket for unexpected data in the Execute() method. See this discussion for details on why:

https://netftp.codeplex.com/discussions/535879

This change should in no way affect existing users unless you experience the bug in the above discussion.
  • Loading branch information
jptrosclair committed Mar 4, 2014
1 parent d298615 commit ec21d8d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 53 deletions.
33 changes: 2 additions & 31 deletions FtpClient.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,24 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Debug|Any CPU.ActiveCfg = Debug|x86
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Debug|Mixed Platforms.Build.0 = Debug|x86
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Debug|x86.ActiveCfg = Debug|x86
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Debug|x86.Build.0 = Debug|x86
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Release|Any CPU.ActiveCfg = Release|x86
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Release|Mixed Platforms.ActiveCfg = Release|x86
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Release|Mixed Platforms.Build.0 = Release|x86
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Release|x86.ActiveCfg = Release|x86
{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}.Release|x86.Build.0 = Release|x86
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Debug|x86.ActiveCfg = Debug|Any CPU
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Release|Any CPU.Build.0 = Release|Any CPU
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2E4F2A25-7133-455A-AC1D-FBE3E56CA1A1}.Release|x86.ActiveCfg = Release|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Debug|x86.ActiveCfg = Debug|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Release|Any CPU.Build.0 = Release|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{49B11591-C942-479F-A864-AB2738E50EF0}.Release|x86.ActiveCfg = Release|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Debug|x86.ActiveCfg = Debug|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Release|Any CPU.Build.0 = Release|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E963B766-56BF-4966-8917-88C1EE69D61A}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Tests\Tests.csproj
Expand Down
15 changes: 11 additions & 4 deletions Tests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Tests {
/// Torture test
/// </summary>
class Program {
static readonly string m_host = "localhost";
static readonly string m_host = "ftptest";
static readonly string m_user = "ftptest";
static readonly string m_pass = "ftptest";

Expand Down Expand Up @@ -45,7 +45,9 @@ static void Main(string[] args) {
}
}*/

TestManualEncoding();
TestServer();

//TestManualEncoding();

//TestServer();

Expand Down Expand Up @@ -95,9 +97,14 @@ static void TestManualEncoding() {

static void TestServer() {
using (FtpClient cl = new FtpClient()) {
cl.Host = "localhost";
cl.Host = "ftptest";
cl.Credentials = new NetworkCredential("ftptest", "ftptest");
foreach (FtpListItem i in cl.GetListing("/Examples/bin/")) {
cl.EncryptionMode = FtpEncryptionMode.Explicit;
cl.ValidateCertificate += (control, e) => {
e.Accept = true;
};

foreach (FtpListItem i in cl.GetListing("/")) {
Console.WriteLine(i.FullName);
}
}
Expand Down
24 changes: 6 additions & 18 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,27 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{28AA032E-CACF-4C07-BF12-C4FBE71BC8BD}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<OutputPath>bin\Debug</OutputPath>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down

0 comments on commit ec21d8d

Please sign in to comment.