[WCF] bonus, NET_2_1 is blocking set_Timeout. It didn't exist in Moonlight.
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 21 May 2015 17:23:27 +0000 (01:23 +0800)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 21 May 2015 17:23:27 +0000 (01:23 +0800)
mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs

index 1eed451b7c2208163c5c8e9f5947b2d039a6c98f..19faf78c143de4c491c1896c040b61ef2aca1f40 100644 (file)
@@ -125,9 +125,7 @@ namespace System.ServiceModel.Channels
                                //web_request.UseDefaultCredentials = false;
                        }
 
-#if !NET_2_1 // FIXME: implement this to not depend on Timeout property
                        web_request.Timeout = (int) timeout.TotalMilliseconds;
-#endif
 
                        // There is no SOAP Action/To header when AddressingVersion is None.
                        if (message.Version.Envelope.Equals (EnvelopeVersion.Soap11) ||
@@ -190,6 +188,7 @@ namespace System.ServiceModel.Channels
                                if (hp.SuppressEntityBody)
                                        suppressEntityBody = true;
                        }
+
 #if !NET_2_1
                        if (source.ClientCredentials != null) {
                                var cred = source.ClientCredentials;
@@ -205,9 +204,7 @@ namespace System.ServiceModel.Channels
                                if (buffer.Length > int.MaxValue)
                                        throw new InvalidOperationException ("The argument message is too large.");
 
-#if !NET_2_1
                                web_request.ContentLength = (int) buffer.Length;
-#endif
 
                                web_request.BeginGetRequestStream (delegate (IAsyncResult r) {
                                        try {
@@ -217,9 +214,7 @@ namespace System.ServiceModel.Channels
                                                web_request.BeginGetResponse (GotResponse, result);
                                        } catch (WebException ex) {
                                                switch (ex.Status) {
-#if !NET_2_1
                                                case WebExceptionStatus.NameResolutionFailure:
-#endif
                                                case WebExceptionStatus.ConnectFailure:
                                                        result.Complete (new EndpointNotFoundException (new EndpointNotFoundException ().Message, ex));
                                                        break;