Przeglądaj źródła

Apply optimization changes to other projects.

Gert Driesen 11 lat temu
rodzic
commit
adfaafdda8
52 zmienionych plików z 128 dodań i 163 usunięć
  1. 9 6
      Renci.SshClient/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj
  2. 0 4
      Renci.SshClient/Renci.SshNet.NET35/Session.NET35.cs
  3. 1 3
      Renci.SshClient/Renci.SshNet.Silverlight/Common/Extensions.SilverlightShared.cs
  4. 9 6
      Renci.SshClient/Renci.SshNet.Silverlight/Renci.SshNet.Silverlight.csproj
  5. 5 3
      Renci.SshClient/Renci.SshNet.Silverlight/Session.SilverlightShared.cs
  6. 9 6
      Renci.SshClient/Renci.SshNet.Silverlight5/Renci.SshNet.Silverlight5.csproj
  7. 11 11
      Renci.SshClient/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj
  8. 1 1
      Renci.SshClient/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
  9. 2 11
      Renci.SshClient/Renci.SshNet.WindowsPhone/Common/Extensions.WP.cs
  10. 8 5
      Renci.SshClient/Renci.SshNet.WindowsPhone/Renci.SshNet.WindowsPhone.csproj
  11. 0 18
      Renci.SshClient/Renci.SshNet.WindowsPhone8/Common/Extensions.WP.cs
  12. 12 9
      Renci.SshClient/Renci.SshNet.WindowsPhone8/Renci.SshNet.WindowsPhone8.csproj
  13. 2 1
      Renci.SshClient/Renci.SshNet.WindowsPhone8/Session.WP.cs
  14. 2 3
      Renci.SshClient/Renci.SshNet/Common/Extensions.cs
  15. 2 2
      Renci.SshClient/Renci.SshNet/Messages/Authentication/BannerMessage.cs
  16. 1 1
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpen/ChannelOpenMessage.cs
  17. 2 2
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpen/DirectTcpipChannelInfo.cs
  18. 2 2
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpen/ForwardedTcpipChannelInfo.cs
  19. 1 1
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpen/X11ChannelOpenInfo.cs
  20. 2 2
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpenFailureMessage.cs
  21. 1 1
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ChannelRequestMessage.cs
  22. 2 2
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/EnvironmentVariableRequestInfo.cs
  23. 1 1
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ExecRequestInfo.cs
  24. 3 3
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ExitSignalRequestInfo.cs
  25. 1 1
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/SignalRequestInfo.cs
  26. 1 1
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/SubsystemRequestInfo.cs
  27. 1 1
      Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/X11ForwardingRequestInfo.cs
  28. 1 1
      Renci.SshClient/Renci.SshNet/Messages/Connection/GlobalRequestMessage.cs
  29. 2 2
      Renci.SshClient/Renci.SshNet/Messages/Transport/DebugMessage.cs
  30. 2 2
      Renci.SshClient/Renci.SshNet/Messages/Transport/DisconnectMessage.cs
  31. 1 2
      Renci.SshClient/Renci.SshNet/Renci.SshNet.csproj
  32. 2 2
      Renci.SshClient/Renci.SshNet/Security/GroupExchangeHashData.cs
  33. 2 2
      Renci.SshClient/Renci.SshNet/Security/KeyExchangeDiffieHellmanGroupSha1.cs
  34. 1 1
      Renci.SshClient/Renci.SshNet/Security/KeyHostAlgorithm.cs
  35. 1 12
      Renci.SshClient/Renci.SshNet/Session.NET.cs
  36. 4 11
      Renci.SshClient/Renci.SshNet/Session.cs
  37. 2 2
      Renci.SshClient/Renci.SshNet/Sftp/Requests/ExtendedRequests/HardLinkRequest.cs
  38. 2 2
      Renci.SshClient/Renci.SshNet/Sftp/Requests/ExtendedRequests/PosixRenameRequest.cs
  39. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/ExtendedRequests/StatVfsRequest.cs
  40. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpLStatRequest.cs
  41. 2 2
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpLinkRequest.cs
  42. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpMkDirRequest.cs
  43. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpOpenDirRequest.cs
  44. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpOpenRequest.cs
  45. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpReadLinkRequest.cs
  46. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpRealPathRequest.cs
  47. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpRemoveRequest.cs
  48. 2 2
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpRenameRequest.cs
  49. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpRmDirRequest.cs
  50. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpSetStatRequest.cs
  51. 1 1
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpStatRequest.cs
  52. 2 2
      Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpSymLinkRequest.cs

+ 9 - 6
Renci.SshClient/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj

@@ -22,7 +22,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
@@ -30,7 +30,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;TUNING</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\Renci.SshNet.xml</DocumentationFile>
@@ -135,6 +135,9 @@
     <Compile Include="..\Renci.SshNet\Common\ChannelEventArgs.cs">
       <Link>Common\ChannelEventArgs.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\ChannelExtendedDataEventArgs.cs">
+      <Link>Common\ChannelExtendedDataEventArgs.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\ChannelOpenConfirmedEventArgs.cs">
       <Link>Common\ChannelOpenConfirmedEventArgs.cs</Link>
     </Compile>
@@ -222,6 +225,9 @@
     <Compile Include="..\Renci.SshNet\Common\SshData.cs">
       <Link>Common\SshData.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\SshDataStream.cs">
+      <Link>Common\SshDataStream.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\SshException.cs">
       <Link>Common\SshException.cs</Link>
     </Compile>
@@ -861,9 +867,6 @@
     <Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
       <Link>Sftp\Responses\SftpVersionResponse.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Sftp\SftpDataMessage.cs">
-      <Link>Sftp\SftpDataMessage.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
       <Link>Sftp\SftpDownloadAsyncResult.cs</Link>
     </Compile>
@@ -943,7 +946,7 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <ProjectExtensions>
     <VisualStudio>
-      <UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
+      <UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
     </VisualStudio>
   </ProjectExtensions>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 0 - 4
Renci.SshClient/Renci.SshNet.NET35/Session.NET35.cs

@@ -1,11 +1,7 @@
 using System.Linq;
 using System;
-using System.Net.Sockets;
-using System.Net;
 using Renci.SshNet.Messages;
-using Renci.SshNet.Common;
 using System.Threading;
-using Renci.SshNet.Messages.Transport;
 using System.Reflection;
 using System.Collections.Generic;
 using System.Diagnostics;

+ 1 - 3
Renci.SshClient/Renci.SshNet.Silverlight/Common/Extensions.SilverlightShared.cs

@@ -1,7 +1,5 @@
 using System;
-using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using System.Net.Sockets;
 using System.Threading;
 using System.Security.Cryptography;
@@ -13,7 +11,7 @@ namespace Renci.SshNet.Common
     /// <summary>
     /// Collection of different extension method specific for Silverlight
     /// </summary>
-    public static partial class Extensions
+    internal static partial class Extensions
     {
         /// <summary>
         /// Determines whether [is null or white space] [the specified value].

+ 9 - 6
Renci.SshClient/Renci.SshNet.Silverlight/Renci.SshNet.Silverlight.csproj

@@ -33,7 +33,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>Bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;TUNING</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -44,7 +44,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>Bin\Release</OutputPath>
-    <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+    <DefineConstants>TRACE;SILVERLIGHT;TUNING</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -148,6 +148,9 @@
     <Compile Include="..\Renci.SshNet\Common\ChannelEventArgs.cs">
       <Link>Common\ChannelEventArgs.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\ChannelExtendedDataEventArgs.cs">
+      <Link>Common\ChannelExtendedDataEventArgs.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\ChannelOpenConfirmedEventArgs.cs">
       <Link>Common\ChannelOpenConfirmedEventArgs.cs</Link>
     </Compile>
@@ -211,6 +214,9 @@
     <Compile Include="..\Renci.SshNet\Common\SshData.cs">
       <Link>Common\SshData.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\SshDataStream.cs">
+      <Link>Common\SshDataStream.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\SshException.cs">
       <Link>Common\SshException.cs</Link>
     </Compile>
@@ -808,9 +814,6 @@
     <Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
       <Link>Sftp\Responses\SftpVersionResponse.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Sftp\SftpDataMessage.cs">
-      <Link>Sftp\SftpDataMessage.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
       <Link>Sftp\SftpDownloadAsyncResult.cs</Link>
     </Compile>
@@ -891,7 +894,7 @@
       <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
         <SilverlightProjectProperties />
       </FlavorProperties>
-      <UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
+      <UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
     </VisualStudio>
   </ProjectExtensions>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 5 - 3
Renci.SshClient/Renci.SshNet.Silverlight/Session.SilverlightShared.cs

@@ -176,17 +176,19 @@ namespace Renci.SshNet
         /// Writes the specified data to the server.
         /// </summary>
         /// <param name="data">The data to write to the server.</param>
+        /// <param name="offset">The zero-based offset in <paramref name="data"/> at which to begin taking data from.</param>
+        /// <param name="length">The number of bytes of <paramref name="data"/> to write.</param>
         /// <exception cref="SshOperationTimeoutException">The write has timed-out.</exception>
         /// <exception cref="SocketException">The write failed.</exception>
-        partial void SocketWrite(byte[] data)
+        private void SocketWrite(byte[] data, int offset, int length)
         {
             var timeout = ConnectionInfo.Timeout;
             var totalBytesSent = 0;  // how many bytes are already sent
-            var totalBytesToSend = data.Length;
+            var totalBytesToSend = length;
 
             do
             {
-                var args = CreateSocketAsyncEventArgs(_sendEvent, data, 0, totalBytesToSend - totalBytesSent);
+                var args = CreateSocketAsyncEventArgs(_sendEvent, data, offset + totalBytesSent, totalBytesToSend - totalBytesSent);
                 if (_socket.SendAsync(args))
                 {
                     if (!_sendEvent.WaitOne(timeout))

+ 9 - 6
Renci.SshClient/Renci.SshNet.Silverlight5/Renci.SshNet.Silverlight5.csproj

@@ -34,7 +34,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>Bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;TUNING</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -46,7 +46,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>Bin\Release</OutputPath>
-    <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+    <DefineConstants>TRACE;SILVERLIGHT;TUNING</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -190,6 +190,9 @@
     <Compile Include="..\Renci.SshNet\Common\ChannelEventArgs.cs">
       <Link>Common\ChannelEventArgs.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\ChannelExtendedDataEventArgs.cs">
+      <Link>Common\ChannelExtendedDataEventArgs.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\ChannelOpenConfirmedEventArgs.cs">
       <Link>Common\ChannelOpenConfirmedEventArgs.cs</Link>
     </Compile>
@@ -256,6 +259,9 @@
     <Compile Include="..\Renci.SshNet\Common\SshData.cs">
       <Link>Common\SshData.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\SshDataStream.cs">
+      <Link>Common\SshDataStream.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\SshException.cs">
       <Link>Common\SshException.cs</Link>
     </Compile>
@@ -853,9 +859,6 @@
     <Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
       <Link>Sftp\Responses\SftpVersionResponse.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Sftp\SftpDataMessage.cs">
-      <Link>Sftp\SftpDataMessage.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
       <Link>Sftp\SftpDownloadAsyncResult.cs</Link>
     </Compile>
@@ -923,7 +926,7 @@
       <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
         <SilverlightProjectProperties />
       </FlavorProperties>
-      <UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
+      <UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
     </VisualStudio>
   </ProjectExtensions>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 11 - 11
Renci.SshClient/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj

@@ -25,7 +25,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
@@ -33,7 +33,7 @@
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;TUNING</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>0</WarningLevel>
   </PropertyGroup>
@@ -529,9 +529,6 @@
     <Compile Include="..\Renci.SshNet.Tests\Classes\Messages\Authentication\RequestMessagePublicKeyTest.cs">
       <Link>Classes\Messages\Authentication\RequestMessagePublicKeyTest.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet.Tests\Classes\Messages\Authentication\RequestMessageTest.cs">
-      <Link>Classes\Messages\Authentication\RequestMessageTest.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet.Tests\Classes\Messages\Authentication\SuccessMessageTest.cs">
       <Link>Classes\Messages\Authentication\SuccessMessageTest.cs</Link>
     </Compile>
@@ -955,9 +952,6 @@
     <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\Responses\SftpVersionResponseTest.cs">
       <Link>Classes\Sftp\Responses\SftpVersionResponseTest.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpDataMessageTest.cs">
-      <Link>Classes\Sftp\SftpDataMessageTest.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpDownloadAsyncResultTest.cs">
       <Link>Classes\Sftp\SftpDownloadAsyncResultTest.cs</Link>
     </Compile>
@@ -1072,8 +1066,11 @@
     <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpListDirectoryAsyncResultTest.cs">
       <Link>Classes\Sftp\SftpListDirectoryAsyncResultTest.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpSessionTest.cs">
-      <Link>Classes\Sftp\SftpSessionTest.cs</Link>
+    <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpSessionTest_Connected_RequestRead.cs">
+      <Link>Classes\Sftp\SftpSessionTest_Connected_RequestRead.cs</Link>
+    </Compile>
+    <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpSessionTest_Connected_RequestStatVfs.cs">
+      <Link>Classes\Sftp\SftpSessionTest_Connected_RequestStatVfs.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpSynchronizeDirectoriesAsyncResultTest.cs">
       <Link>Classes\Sftp\SftpSynchronizeDirectoriesAsyncResultTest.cs</Link>
@@ -1081,6 +1078,9 @@
     <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpUploadAsyncResultTest.cs">
       <Link>Classes\Sftp\SftpUploadAsyncResultTest.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet.Tests\Classes\Sftp\SftpVersionResponseBuilder.cs">
+      <Link>Classes\Sftp\SftpVersionResponseBuilder.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet.Tests\Classes\ShellStreamTest.cs">
       <Link>Classes\ShellStreamTest.cs</Link>
     </Compile>
@@ -1258,7 +1258,7 @@
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ProjectExtensions>
     <VisualStudio>
-      <UserProperties ProjectLinkReference="c45379b9-17b1-4e89-bc2e-6d41726413e8" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
+      <UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="c45379b9-17b1-4e89-bc2e-6d41726413e8" />
     </VisualStudio>
   </ProjectExtensions>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 1 - 1
Renci.SshClient/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj

@@ -32,7 +32,7 @@
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;TUNING</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>0</WarningLevel>
   </PropertyGroup>

+ 2 - 11
Renci.SshClient/Renci.SshNet.WindowsPhone/Common/Extensions.WP.cs

@@ -1,18 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Net.Sockets;
-using System.Threading;
-using System.Security.Cryptography;
-using System.Diagnostics;
-
-namespace Renci.SshNet.Common
+namespace Renci.SshNet.Common
 {
     /// <summary>
     /// Collection of different extension method specific for Windows Phone
     /// </summary>
-    public static partial class Extensions
+    internal static partial class Extensions
     {
     }
 }

+ 8 - 5
Renci.SshClient/Renci.SshNet.WindowsPhone/Renci.SshNet.WindowsPhone.csproj

@@ -28,7 +28,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>Bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;TUNING</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -39,7 +39,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>Bin\Release</OutputPath>
-    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE;TUNING</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -133,6 +133,9 @@
     <Compile Include="..\Renci.SshNet\Common\ChannelEventArgs.cs">
       <Link>Common\ChannelEventArgs.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\ChannelExtendedDataEventArgs.cs">
+      <Link>Common\ChannelExtendedDataEventArgs.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\ChannelOpenConfirmedEventArgs.cs">
       <Link>Common\ChannelOpenConfirmedEventArgs.cs</Link>
     </Compile>
@@ -199,6 +202,9 @@
     <Compile Include="..\Renci.SshNet\Common\SshData.cs">
       <Link>Common\SshData.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\SshDataStream.cs">
+      <Link>Common\SshDataStream.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\SshException.cs">
       <Link>Common\SshException.cs</Link>
     </Compile>
@@ -808,9 +814,6 @@
     <Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
       <Link>Sftp\Responses\SftpVersionResponse.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Sftp\SftpDataMessage.cs">
-      <Link>Sftp\SftpDataMessage.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
       <Link>Sftp\SftpDownloadAsyncResult.cs</Link>
     </Compile>

+ 0 - 18
Renci.SshClient/Renci.SshNet.WindowsPhone8/Common/Extensions.WP.cs

@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Net.Sockets;
-using System.Threading;
-using System.Security.Cryptography;
-using System.Diagnostics;
-
-namespace Renci.SshNet.Common
-{
-    /// <summary>
-    /// Collection of different extension method specific for Windows Phone
-    /// </summary>
-    public static partial class Extensions
-    {
-    }
-}

+ 12 - 9
Renci.SshClient/Renci.SshNet.WindowsPhone8/Renci.SshNet.WindowsPhone8.csproj

@@ -31,7 +31,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>Bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;TUNING</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -43,7 +43,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>Bin\Release</OutputPath>
-    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE;TUNING</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -102,6 +102,9 @@
     <Compile Include="..\Renci.SshNet.Silverlight\Channels\ChannelDirectTcpip.SilverlightShared.cs">
       <Link>ChannelDirectTcpip.SilverlightShared.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet.WindowsPhone\Common\Extensions.WP.cs">
+      <Link>Common\Extensions.WP.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\AuthenticationMethod.cs">
       <Link>AuthenticationMethod.cs</Link>
     </Compile>
@@ -183,6 +186,9 @@
     <Compile Include="..\Renci.SshNet\Common\ChannelEventArgs.cs">
       <Link>Common\ChannelEventArgs.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\ChannelExtendedDataEventArgs.cs">
+      <Link>Common\ChannelExtendedDataEventArgs.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\ChannelOpenConfirmedEventArgs.cs">
       <Link>Common\ChannelOpenConfirmedEventArgs.cs</Link>
     </Compile>
@@ -249,6 +255,9 @@
     <Compile Include="..\Renci.SshNet\Common\SshData.cs">
       <Link>Common\SshData.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\SshDataStream.cs">
+      <Link>Common\SshDataStream.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\SshException.cs">
       <Link>Common\SshException.cs</Link>
     </Compile>
@@ -858,9 +867,6 @@
     <Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
       <Link>Sftp\Responses\SftpVersionResponse.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Sftp\SftpDataMessage.cs">
-      <Link>Sftp\SftpDataMessage.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
       <Link>Sftp\SftpDownloadAsyncResult.cs</Link>
     </Compile>
@@ -918,9 +924,6 @@
     <Compile Include="..\Renci.SshNet\SubsystemSession.cs">
       <Link>SubsystemSession.cs</Link>
     </Compile>
-    <Compile Include="Common\Extensions.WP.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="ForwardedPortLocal.SilverlightShared.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="..\Renci.SshNet\Properties\CommonAssemblyInfo.cs">
@@ -932,7 +935,7 @@
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
   <ProjectExtensions>
     <VisualStudio>
-      <UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
+      <UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
     </VisualStudio>
   </ProjectExtensions>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 2 - 1
Renci.SshClient/Renci.SshNet.WindowsPhone8/Session.WP.cs

@@ -13,7 +13,8 @@ namespace Renci.SshNet
         {
             if (message == null)
                 throw new ArgumentNullException("message");
-            else if (message is DisconnectMessage)
+
+            if (message is DisconnectMessage)
                 this.HandleMessage((DisconnectMessage)message);
             else if (message is IgnoreMessage)
                 this.HandleMessage((IgnoreMessage)message);

+ 2 - 3
Renci.SshClient/Renci.SshNet/Common/Extensions.cs

@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Globalization;
 using System.Net;
 using Renci.SshNet.Messages;
@@ -41,7 +40,7 @@ namespace Renci.SshNet.Common
 
         internal static ServiceName ToServiceName(this byte[] data)
         {
-            var sshServiceName = SshData.Ascii.GetString(data);
+            var sshServiceName = SshData.Ascii.GetString(data, 0, data.Length);
             switch (sshServiceName)
             {
                 case "ssh-userauth":
@@ -55,7 +54,7 @@ namespace Renci.SshNet.Common
 
         internal static GlobalRequestName ToGlobalRequestName(this byte[] data)
         {
-            var sshGlobalRequestName = SshData.Ascii.GetString(data);
+            var sshGlobalRequestName = SshData.Ascii.GetString(data, 0, data.Length);
             switch (sshGlobalRequestName)
             {
                 case "tcpip-forward":

+ 2 - 2
Renci.SshClient/Renci.SshNet/Messages/Authentication/BannerMessage.cs

@@ -19,7 +19,7 @@ namespace Renci.SshNet.Messages.Authentication
 #if TUNING
         public string Message
         {
-            get { return Utf8.GetString(_message); }
+            get { return Utf8.GetString(_message, 0, _message.Length); }
         }
 #else
         public string Message { get; private set; }
@@ -31,7 +31,7 @@ namespace Renci.SshNet.Messages.Authentication
 #if TUNING
         public string Language
         {
-            get { return Utf8.GetString(_language); }
+            get { return Utf8.GetString(_language, 0, _language.Length); }
         }
 #else
         public string Language { get; private set; }

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpen/ChannelOpenMessage.cs

@@ -138,7 +138,7 @@ namespace Renci.SshNet.Messages.Connection
 #if TUNING
             _infoBytes = ReadBytes();
 
-            var channelName = Ascii.GetString(ChannelType);
+            var channelName = Ascii.GetString(ChannelType, 0, ChannelType.Length);
 #else
             var _infoBytes = ReadBytes();
 #endif

+ 2 - 2
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpen/DirectTcpipChannelInfo.cs

@@ -34,7 +34,7 @@ namespace Renci.SshNet.Messages.Connection
 #if TUNING
         public string HostToConnect
         {
-            get { return Utf8.GetString(_hostToConnect); }
+            get { return Utf8.GetString(_hostToConnect, 0, _hostToConnect.Length); }
             private set { _hostToConnect = Utf8.GetBytes(value); }
         }
 #else
@@ -52,7 +52,7 @@ namespace Renci.SshNet.Messages.Connection
 #if TUNING
         public string OriginatorAddress
         {
-            get { return Utf8.GetString(_originatorAddress); }
+            get { return Utf8.GetString(_originatorAddress, 0, _originatorAddress.Length); }
             private set { _originatorAddress = Utf8.GetBytes(value); }
         }
 #else

+ 2 - 2
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpen/ForwardedTcpipChannelInfo.cs

@@ -56,7 +56,7 @@ namespace Renci.SshNet.Messages.Connection
 #if TUNING
         public string ConnectedAddress
         {
-            get { return Utf8.GetString(_connectedAddress); }
+            get { return Utf8.GetString(_connectedAddress, 0, _connectedAddress.Length); }
             private set { _connectedAddress = Utf8.GetBytes(value); }
         }
 #else
@@ -74,7 +74,7 @@ namespace Renci.SshNet.Messages.Connection
 #if TUNING
         public string OriginatorAddress
         {
-            get { return Utf8.GetString(_originatorAddress); }
+            get { return Utf8.GetString(_originatorAddress, 0, _originatorAddress.Length); }
             private set { _originatorAddress = Utf8.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpen/X11ChannelOpenInfo.cs

@@ -33,7 +33,7 @@ namespace Renci.SshNet.Messages.Connection
 #if TUNING
         public string OriginatorAddress
         {
-            get { return Utf8.GetString(_originatorAddress); }
+            get { return Utf8.GetString(_originatorAddress, 0, _originatorAddress.Length); }
             private set { _originatorAddress = Utf8.GetBytes(value); }
         }
 #else

+ 2 - 2
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelOpenFailureMessage.cs

@@ -27,7 +27,7 @@
 #if TUNING
         public string Description
         {
-            get { return Utf8.GetString(_description); }
+            get { return Utf8.GetString(_description, 0, _description.Length); }
             private set { _description = Utf8.GetBytes(value); }
         }
 #else
@@ -40,7 +40,7 @@
 #if TUNING
         public string Language
         {
-            get { return Utf8.GetString(_language); }
+            get { return Utf8.GetString(_language, 0, _language.Length); }
             private set { _language = Utf8.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ChannelRequestMessage.cs

@@ -85,7 +85,7 @@
 
 #if TUNING
             _requestNameBytes = ReadBinary();
-            _requestName = Ascii.GetString(_requestNameBytes);
+            _requestName = Ascii.GetString(_requestNameBytes, 0, _requestNameBytes.Length);
 #else
             RequestName = ReadAsciiString();
 #endif

+ 2 - 2
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/EnvironmentVariableRequestInfo.cs

@@ -35,7 +35,7 @@
 #if TUNING
         public string VariableName
         {
-            get { return Utf8.GetString(_variableName); }
+            get { return Utf8.GetString(_variableName, 0, _variableName.Length); }
         }
 #else
         public string VariableName { get; set; }
@@ -50,7 +50,7 @@
 #if TUNING
         public string VariableValue
         {
-            get { return Utf8.GetString(_variableValue); }
+            get { return Utf8.GetString(_variableValue, 0, _variableValue.Length); }
         }
 #else
         public string VariableValue { get; set; }

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ExecRequestInfo.cs

@@ -37,7 +37,7 @@ namespace Renci.SshNet.Messages.Connection
 #if TUNING
         public string Command
         {
-            get { return Encoding.GetString(_command); }
+            get { return Encoding.GetString(_command, 0, _command.Length); }
         }
 #else
         public string Command { get; private set; }

+ 3 - 3
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ExitSignalRequestInfo.cs

@@ -36,7 +36,7 @@
 #if TUNING
         public string SignalName
         {
-            get { return Ascii.GetString(_signalName); }
+            get { return Ascii.GetString(_signalName, 0, _signalName.Length); }
             private set { _signalName = Ascii.GetBytes(value); }
         }
 #else
@@ -57,7 +57,7 @@
 #if TUNING
         public string ErrorMessage
         {
-            get { return Utf8.GetString(_errorMessage); }
+            get { return Utf8.GetString(_errorMessage, 0, _errorMessage.Length); }
             private set { _errorMessage = Utf8.GetBytes(value); }
         }
 #else
@@ -70,7 +70,7 @@
 #if TUNING
         public string Language
         {
-            get { return Utf8.GetString(_language); }
+            get { return Utf8.GetString(_language, 0, _language.Length); }
             private set { _language = Utf8.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/SignalRequestInfo.cs

@@ -34,7 +34,7 @@
 #if TUNING
         public string SignalName
         {
-            get { return Ascii.GetString(_signalName); }
+            get { return Ascii.GetString(_signalName, 0, _signalName.Length); }
             private set { _signalName = Ascii.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/SubsystemRequestInfo.cs

@@ -36,7 +36,7 @@ namespace Renci.SshNet.Messages.Connection
 #if TUNING
         public string SubsystemName
         {
-            get { return Ascii.GetString(_subsystemName); }
+            get { return Ascii.GetString(_subsystemName, 0, _subsystemName.Length); }
             private set { _subsystemName = Ascii.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/X11ForwardingRequestInfo.cs

@@ -42,7 +42,7 @@
 #if TUNING
         public string AuthenticationProtocol
         {
-            get { return Ascii.GetString(_authenticationProtocol); }
+            get { return Ascii.GetString(_authenticationProtocol, 0, _authenticationProtocol.Length); }
             private set { _authenticationProtocol = Ascii.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Connection/GlobalRequestMessage.cs

@@ -43,7 +43,7 @@ namespace Renci.SshNet.Messages.Connection
 #if TUNING
         public string AddressToBind
         {
-            get { return Utf8.GetString(_addressToBind); }
+            get { return Utf8.GetString(_addressToBind, 0, _addressToBind.Length); }
             private set { _addressToBind = Utf8.GetBytes(value); }
         }
 #else

+ 2 - 2
Renci.SshClient/Renci.SshNet/Messages/Transport/DebugMessage.cs

@@ -25,7 +25,7 @@
 #if TUNING
         public string Message
         {
-            get { return Utf8.GetString(_message); }
+            get { return Utf8.GetString(_message, 0, _message.Length); }
         }
 #else
         public string Message { get; private set; }
@@ -37,7 +37,7 @@
 #if TUNING
         public string Language
         {
-            get { return Utf8.GetString(_language); }
+            get { return Utf8.GetString(_language, 0, _language.Length); }
         }
 #else
         public string Language { get; private set; }

+ 2 - 2
Renci.SshClient/Renci.SshNet/Messages/Transport/DisconnectMessage.cs

@@ -22,7 +22,7 @@
 #if TUNING
         public string Description
         {
-            get { return Utf8.GetString(_description); }
+            get { return Utf8.GetString(_description, 0, _description.Length); }
             private set { _description = Utf8.GetBytes(value); }
         }
 #else
@@ -35,7 +35,7 @@
 #if TUNING
         public string Language
         {
-            get { return Utf8.GetString(_language); }
+            get { return Utf8.GetString(_language, 0, _language.Length); }
             private set { _language = Utf8.GetBytes(value); }
         }
 #else

+ 1 - 2
Renci.SshClient/Renci.SshNet/Renci.SshNet.csproj

@@ -31,8 +31,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>
-    </DefineConstants>
+    <DefineConstants>TUNING</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\Renci.SshNet.xml</DocumentationFile>

+ 2 - 2
Renci.SshClient/Renci.SshNet/Security/GroupExchangeHashData.cs

@@ -18,7 +18,7 @@ namespace Renci.SshNet.Security
 #if TUNING
         public string ServerVersion
         {
-            private get { return Utf8.GetString(_serverVersion); }
+            private get { return Utf8.GetString(_serverVersion, 0, _serverVersion.Length); }
             set { _serverVersion = Utf8.GetBytes(value); }
         }
 #else
@@ -28,7 +28,7 @@ namespace Renci.SshNet.Security
 #if TUNING
         public string ClientVersion
         {
-            private get { return Utf8.GetString(_clientVersion); }
+            private get { return Utf8.GetString(_clientVersion, 0, _clientVersion.Length); }
             set { _clientVersion = Utf8.GetBytes(value); }
         }
 #else

+ 2 - 2
Renci.SshClient/Renci.SshNet/Security/KeyExchangeDiffieHellmanGroupSha1.cs

@@ -100,7 +100,7 @@ namespace Renci.SshNet.Security
 
             public string ServerVersion
             {
-                private get { return Utf8.GetString(_serverVersion); }
+                private get { return Utf8.GetString(_serverVersion, 0, _serverVersion.Length); }
                 set { _serverVersion = Utf8.GetBytes(value); }
             }
 #else
@@ -110,7 +110,7 @@ namespace Renci.SshNet.Security
 #if TUNING
             public string ClientVersion
             {
-                private get { return Utf8.GetString(_clientVersion); }
+                private get { return Utf8.GetString(_clientVersion, 0, _clientVersion.Length); }
                 set { _clientVersion = Utf8.GetBytes(value); }
             }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Security/KeyHostAlgorithm.cs

@@ -113,7 +113,7 @@ namespace Renci.SshNet.Security
 #if TUNING
             private string Name
             {
-                get { return Utf8.GetString(_name); }
+                get { return Utf8.GetString(_name, 0, _name.Length); }
                 set { _name = Utf8.GetBytes(value); }
             }
 #else

+ 1 - 12
Renci.SshClient/Renci.SshNet/Session.NET.cs

@@ -237,17 +237,6 @@ namespace Renci.SshNet
             } while (receivedTotal < length);
         }
 
-        /// <summary>
-        /// Writes the specified data to the server.
-        /// </summary>
-        /// <param name="data">The data to write to the server.</param>
-        /// <exception cref="SshOperationTimeoutException">The write has timed-out.</exception>
-        /// <exception cref="SocketException">The write failed.</exception>
-        partial void SocketWrite(byte[] data)
-        {
-            SocketWrite(data, 0, data.Length);
-        }
-
         /// <summary>
         /// Writes the specified data to the server.
         /// </summary>
@@ -256,7 +245,7 @@ namespace Renci.SshNet
         /// <param name="length">The number of bytes of <paramref name="data"/> to write.</param>
         /// <exception cref="SshOperationTimeoutException">The write has timed-out.</exception>
         /// <exception cref="SocketException">The write failed.</exception>
-        partial void SocketWrite(byte[] data, int offset, int length)
+        private void SocketWrite(byte[] data, int offset, int length)
         {
             var totalBytesSent = 0;  // how many bytes are already sent
             var totalBytesToSend = length;

+ 4 - 11
Renci.SshClient/Renci.SshNet/Session.cs

@@ -1830,17 +1830,10 @@ namespace Renci.SshNet
         /// <param name="data">The data to write to the server.</param>
         /// <exception cref="SshOperationTimeoutException">The write has timed-out.</exception>
         /// <exception cref="SocketException">The write failed.</exception>
-        partial void SocketWrite(byte[] data);
-
-        /// <summary>
-        /// Writes the specified data to the server.
-        /// </summary>
-        /// <param name="data">The data to write to the server.</param>
-        /// <param name="offset">The zero-based offset in <paramref name="data"/> at which to begin taking data from.</param>
-        /// <param name="length">The number of bytes of <paramref name="data"/> to write.</param>
-        /// <exception cref="SshOperationTimeoutException">The write has timed-out.</exception>
-        /// <exception cref="SocketException">The write failed.</exception>
-        partial void SocketWrite(byte[] data, int offset, int length);
+        private void SocketWrite(byte[] data)
+        {
+            SocketWrite(data, 0, data.Length);
+        }
 
         /// <summary>
         /// Disconnects and disposes the socket.

+ 2 - 2
Renci.SshClient/Renci.SshNet/Sftp/Requests/ExtendedRequests/HardLinkRequest.cs

@@ -10,13 +10,13 @@ namespace Renci.SshNet.Sftp.Requests
 
         public string OldPath
         {
-            get { return Utf8.GetString(_oldPath); }
+            get { return Utf8.GetString(_oldPath, 0, _oldPath.Length); }
             private set { _oldPath = Utf8.GetBytes(value); }
         }
 
         public string NewPath
         {
-            get { return Utf8.GetString(_newPath); }
+            get { return Utf8.GetString(_newPath, 0, _newPath.Length); }
             private set { _newPath = Utf8.GetBytes(value); }
         }
 

+ 2 - 2
Renci.SshClient/Renci.SshNet/Sftp/Requests/ExtendedRequests/PosixRenameRequest.cs

@@ -11,13 +11,13 @@ namespace Renci.SshNet.Sftp.Requests
 
         public string OldPath
         {
-            get { return Encoding.GetString(_oldPath); }
+            get { return Encoding.GetString(_oldPath, 0, _oldPath.Length); }
             private set { _oldPath = Encoding.GetBytes(value); }
         }
 
         public string NewPath
         {
-            get { return Encoding.GetString(_newPath); }
+            get { return Encoding.GetString(_newPath, 0, _newPath.Length); }
             private set { _newPath = Encoding.GetBytes(value); }
         }
 

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/ExtendedRequests/StatVfsRequest.cs

@@ -10,7 +10,7 @@ namespace Renci.SshNet.Sftp.Requests
 
         public string Path
         {
-            get { return Encoding.GetString(_path); }
+            get { return Encoding.GetString(_path, 0, _path.Length); }
             private set { _path = Encoding.GetBytes(value); }
         }
 

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpLStatRequest.cs

@@ -18,7 +18,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Path
         {
-            get { return Encoding.GetString(_path); }
+            get { return Encoding.GetString(_path, 0, _path.Length); }
             private set { _path = Encoding.GetBytes(value); }
         }
 #else

+ 2 - 2
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpLinkRequest.cs

@@ -18,7 +18,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string NewLinkPath
         {
-            get { return Utf8.GetString(_newLinkPath); }
+            get { return Utf8.GetString(_newLinkPath, 0, _newLinkPath.Length); }
             private set { _newLinkPath = Utf8.GetBytes(value); }
         }
 #else
@@ -28,7 +28,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string ExistingPath
         {
-            get { return Utf8.GetString(_existingPath); }
+            get { return Utf8.GetString(_existingPath, 0, _existingPath.Length); }
             private set { _existingPath = Utf8.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpMkDirRequest.cs

@@ -19,7 +19,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Path
         {
-            get { return Encoding.GetString(_path); }
+            get { return Encoding.GetString(_path, 0, _path.Length); }
             private set { _path = Encoding.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpOpenDirRequest.cs

@@ -18,7 +18,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Path
         {
-            get { return Encoding.GetString(_path); }
+            get { return Encoding.GetString(_path, 0, _path.Length); }
             private set { _path = Encoding.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpOpenRequest.cs

@@ -19,7 +19,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Filename
         {
-            get { return Encoding.GetString(_fileName); }
+            get { return Encoding.GetString(_fileName, 0, _fileName.Length); }
             private set { _fileName = Encoding.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpReadLinkRequest.cs

@@ -18,7 +18,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Path
         {
-            get { return Encoding.GetString(_path); }
+            get { return Encoding.GetString(_path, 0, _path.Length); }
             private set { _path = Encoding.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpRealPathRequest.cs

@@ -18,7 +18,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Path
         {
-            get { return Encoding.GetString(_path); }
+            get { return Encoding.GetString(_path, 0, _path.Length); }
             private set { _path = Encoding.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpRemoveRequest.cs

@@ -18,7 +18,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Filename
         {
-            get { return Encoding.GetString(_fileName); }
+            get { return Encoding.GetString(_fileName, 0, _fileName.Length); }
             private set { _fileName = Encoding.GetBytes(value); }
         }
 #else

+ 2 - 2
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpRenameRequest.cs

@@ -19,7 +19,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string OldPath
         {
-            get { return Encoding.GetString(_oldPath); }
+            get { return Encoding.GetString(_oldPath, 0, _oldPath.Length); }
             private set { _oldPath = Encoding.GetBytes(value); }
         }
 #else
@@ -29,7 +29,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string NewPath
         {
-            get { return Encoding.GetString(_newPath); }
+            get { return Encoding.GetString(_newPath, 0, _newPath.Length); }
             private set { _newPath = Encoding.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpRmDirRequest.cs

@@ -18,7 +18,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Path
         {
-            get { return Encoding.GetString(_path); }
+            get { return Encoding.GetString(_path, 0, _path.Length); }
             private set { _path = Encoding.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpSetStatRequest.cs

@@ -19,7 +19,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Path
         {
-            get { return Encoding.GetString(_path); }
+            get { return Encoding.GetString(_path, 0, _path.Length); }
             private set { _path = Encoding.GetBytes(value); }
         }
 #else

+ 1 - 1
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpStatRequest.cs

@@ -18,7 +18,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string Path
         {
-            get { return Encoding.GetString(_path); }
+            get { return Encoding.GetString(_path, 0, _path.Length); }
             private set { _path = Encoding.GetBytes(value); }
         }
 #else

+ 2 - 2
Renci.SshClient/Renci.SshNet/Sftp/Requests/SftpSymLinkRequest.cs

@@ -19,7 +19,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string NewLinkPath
         {
-            get { return Encoding.GetString(_newLinkPath); }
+            get { return Encoding.GetString(_newLinkPath, 0, _newLinkPath.Length); }
             private set { _newLinkPath = Encoding.GetBytes(value); }
         }
 #else
@@ -29,7 +29,7 @@ namespace Renci.SshNet.Sftp.Requests
 #if TUNING
         public string ExistingPath
         {
-            get { return Encoding.GetString(_existingPath); }
+            get { return Encoding.GetString(_existingPath, 0, _existingPath.Length); }
             private set { _existingPath = Encoding.GetBytes(value); }
         }
 #else