Deleted dead code from System.Net.Requests. (dotnet/corefx#24815)
authorStano Peťko <stano@stanopetko.eu>
Mon, 23 Oct 2017 21:42:22 +0000 (23:42 +0200)
committerStephen Toub <stoub@microsoft.com>
Mon, 23 Oct 2017 21:42:22 +0000 (17:42 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/d33e40e27e40d313977d324ae89c33f2842ee5b7

src/libraries/System.Net.Requests/src/System/Net/FtpControlStream.cs
src/libraries/System.Net.Requests/src/System/Net/FtpWebRequest.cs
src/libraries/System.Net.Requests/src/System/Net/FtpWebResponse.cs
src/libraries/System.Net.Requests/src/System/Net/TimerThread.cs

index ee5cd00..d5b88e3 100644 (file)
@@ -11,13 +11,6 @@ using System.Text;
 
 namespace System.Net
 {
-    internal enum FtpPrimitive
-    {
-        Upload = 0,
-        Download = 1,
-        CommandOnly = 2
-    };
-
     internal enum FtpLoginState : byte
     {
         NotLoggedIn,
@@ -381,7 +374,7 @@ namespace System.Net
             // OR set us up for SSL/TLS, after this we'll be writing securely
             else if (status == FtpStatusCode.ServerWantsSecureSession)
             {
-                // If NetworkStream is a TlsStream, then this must be in the async callback 
+                // If NetworkStream is a TlsStream, then this must be in the async callback
                 // from completing the SSL handshake.
                 // So just let the pipeline continue.
                 if (!(NetworkStream is TlsStream))
@@ -743,14 +736,6 @@ namespace System.Net
             return result;
         }
 
-        //
-        // A door into protected CloseSocket() method
-        //
-        internal void Quit()
-        {
-            CloseSocket();
-        }
-
         private enum GetPathOption
         {
             Normal,
index d1526d7..0bdbdf7 100644 (file)
@@ -87,11 +87,6 @@ namespace System.Net
             get { return (Flags & FtpMethodFlags.IsDownload) != 0; }
         }
 
-        internal bool HasHttpCommand
-        {
-            get { return (Flags & FtpMethodFlags.HasHttpCommand) != 0; }
-        }
-
         /// <summary>
         ///    <para>True if we should attempt to get a response uri
         ///    out of a server response</para>
@@ -241,15 +236,6 @@ namespace System.Net
             }
         }
 
-        // Used by FtpControlStream
-        internal static NetworkCredential DefaultNetworkCredential
-        {
-            get
-            {
-                return s_defaultFtpNetworkCredential;
-            }
-        }
-
         public static new RequestCachePolicy DefaultCachePolicy
         {
             get
@@ -1503,9 +1489,9 @@ namespace System.Net
                     if (stage >= RequestStage.WriteReady)
                     {
                         // If writeResult == null and this is an upload request, it means
-                        // that the user has called GetResponse() without calling 
-                        // GetRequestStream() first. So they are not interested in a 
-                        // stream. Therefore we close the stream so that the 
+                        // that the user has called GetResponse() without calling
+                        // GetRequestStream() first. So they are not interested in a
+                        // stream. Therefore we close the stream so that the
                         // request/pipeline can continue
                         if (_methodInfo.IsUpload && !_getRequestStreamStarted)
                         {
@@ -1807,28 +1793,6 @@ namespace System.Net
             return;
         }
 
-        /// <summary>
-        ///    <para>Returns username string</para>
-        /// </summary>
-        internal string GetUserString()
-        {
-            string name = null;
-            if (this.Credentials != null)
-            {
-                NetworkCredential networkCreds = this.Credentials.GetCredential(_uri, "basic");
-                if (networkCreds != null)
-                {
-                    name = networkCreds.UserName;
-                    string domain = networkCreds.Domain;
-                    if (!string.IsNullOrEmpty(domain))
-                    {
-                        name = domain + "\\" + name;
-                    }
-                }
-            }
-            return name == null ? null : (String.Compare(name, "anonymous", StringComparison.InvariantCultureIgnoreCase) == 0 ? null : name);
-        }
-
         internal void DataStreamClosed(CloseExState closeState)
         {
             if ((closeState & CloseExState.Abort) == 0)
index 53bd353..c24183a 100644 (file)
@@ -98,11 +98,6 @@ namespace System.Net
             }
         }
 
-        internal void SetContentLength(long value)
-        {
-            _contentLength = value;
-        }
-
         public override WebHeaderCollection Headers
         {
             get
index 91f6532..3ae6dc3 100644 (file)
@@ -32,11 +32,6 @@ namespace System.Net
             internal int Duration => _durationMilliseconds;
 
             /// <summary>
-            /// <para>Creates and returns a handle to a new polled timer.</para>
-            /// </summary>
-            internal Timer CreateTimer() => CreateTimer(null, null);
-
-            /// <summary>
             /// <para>Creates and returns a handle to a new timer with attached context.</para>
             /// </summary>
             internal abstract Timer CreateTimer(Callback callback, object context);
@@ -57,11 +52,6 @@ namespace System.Net
             }
 
             /// <summary>
-            /// <para>The duration in milliseconds of timer.</para>
-            /// </summary>
-            internal int Duration => _durationMilliseconds;
-
-            /// <summary>
             /// <para>The time (relative to Environment.TickCount) when the timer started.</para>
             /// </summary>
             internal int StartTime => _startTimeMilliseconds;
@@ -72,31 +62,6 @@ namespace System.Net
             internal int Expiration => unchecked(_startTimeMilliseconds + _durationMilliseconds);
 
             /// <summary>
-            /// <para>The amount of time left on the timer.  0 means it has fired.  1 means it has expired but
-            /// not yet fired.  -1 means infinite.  Int32.MaxValue is the ceiling - the actual value could be longer.</para>
-            /// </summary>
-            internal int TimeRemaining
-            {
-                get
-                {
-                    if (HasExpired)
-                    {
-                        return 0;
-                    }
-
-                    if (Duration == Timeout.Infinite)
-                    {
-                        return Timeout.Infinite;
-                    }
-
-                    int now = Environment.TickCount;
-                    int remaining = IsTickBetween(StartTime, Expiration, now) ?
-                        (int)(Math.Min((uint)unchecked(Expiration - now), (uint)Int32.MaxValue)) : 0;
-                    return remaining < 2 ? remaining + 1 : remaining;
-                }
-            }
-
-            /// <summary>
             /// <para>Cancels the timer.  Returns true if the timer hasn't and won't fire; false if it has or will.</para>
             /// </summary>
             internal abstract bool Cancel();
@@ -610,7 +575,7 @@ namespace System.Net
 
                                 if (NetEventSource.IsEnabled) NetEventSource.Info(null, $"Awoke, cause {(waitResult == WaitHandle.WaitTimeout ? "Timeout" : "Prod")}");
 
-                                // If we timed out with nothing to do, shut down. 
+                                // If we timed out with nothing to do, shut down.
                                 if (waitResult == WaitHandle.WaitTimeout && !haveNextTick)
                                 {
                                     Interlocked.CompareExchange(ref s_threadState, (int)TimerThreadState.Idle, (int)TimerThreadState.Running);