Jelajahi Sumber

Merge pull request #49 from sshnet/develop

Prepare for beta 3
Gert Driesen 9 tahun lalu
induk
melakukan
177812fac9

+ 1 - 1
src/Renci.SshNet.NETCore/project.json

@@ -3,7 +3,7 @@
   "configurations": {
     "debug": {
       "buildOptions": {
-        "debugType": "full",
+        "debugType": "portable",
         "define": [ "DEBUG", "TRACE" ]
       }
     },

+ 6 - 0
src/Renci.SshNet.VS2015.sln.DotSettings

@@ -1,6 +1,7 @@
 <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
 	<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
 	<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertIfStatementToConditionalTernaryExpression/@EntryIndexedValue">DO_NOT_SHOW</s:String>
+	<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertIfStatementToNullCoalescingExpression/@EntryIndexedValue">DO_NOT_SHOW</s:String>
 	<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertPropertyToExpressionBody/@EntryIndexedValue">DO_NOT_SHOW</s:String>
 	<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToAutoProperty/@EntryIndexedValue">DO_NOT_SHOW</s:String>
 	<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBeMadeStatic_002ELocal/@EntryIndexedValue">SUGGESTION</s:String>
@@ -8,6 +9,11 @@
 	<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNameofExpression/@EntryIndexedValue">DO_NOT_SHOW</s:String>
 	<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNullPropagation/@EntryIndexedValue">DO_NOT_SHOW</s:String>
 	<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseStringInterpolation/@EntryIndexedValue">DO_NOT_SHOW</s:String>
+	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_ARGUMENT/@EntryValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue">True</s:Boolean>
+	<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_PARAMETER/@EntryValue">True</s:Boolean>
+	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">NEXT_LINE_SHIFTED_2</s:String>
+	<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_ARGUMENTS_STYLE/@EntryValue">CHOP_IF_LONG</s:String>
 	<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HMACMD/@EntryIndexedValue">HMACMD</s:String>
 	<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HMACSHA/@EntryIndexedValue">HMACSHA</s:String>
 	<s:String x:Key="/Default/Environment/UnitTesting/ExcludedCategoriesList/@EntryValue">integration,LongRunning</s:String></wpf:ResourceDictionary>

+ 1 - 18
src/Renci.SshNet/ForwardedPortLocal.NET.cs

@@ -32,24 +32,7 @@ namespace Renci.SshNet
             // consider port started when we're listening for inbound connections
             _status = ForwardedPortStatus.Started;
 
-            try
-            {
-                StartAccept(null);
-            }
-            catch (ObjectDisposedException)
-            {
-                // AcceptAsync will throw an ObjectDisposedException when the server is closed before
-                // the listener has started accepting connections.
-                //
-                // this is only possible when the listener is stopped (from another thread) right
-                // after it was started.
-                StopPort(Session.ConnectionInfo.Timeout);
-            }
-            catch (Exception ex)
-            {
-                StopPort(Session.ConnectionInfo.Timeout);
-                RaiseExceptionEvent(ex);
-            }
+            StartAccept(null);
         }
 
         private void StartAccept(SocketAsyncEventArgs e)

+ 2 - 3
src/Renci.SshNet/ForwardedPortLocal.cs

@@ -131,11 +131,10 @@ namespace Renci.SshNet
 
             // signal existing channels that the port is closing
             base.StopPort(timeout);
+            // prevent new requests from getting processed
+            StopListener();
             // wait for open channels to close
             InternalStop(timeout);
-            // prevent new requests from getting processed before we signal existing
-            // channels that the port is closing
-            StopListener();
             // mark port stopped
             _status = ForwardedPortStatus.Stopped;
         }