using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
-#if (NET_2_0 || MONOTOUCH) && SECURITY_DEP
+#if SECURITY_DEP
using Mono.Security.Protocol.Tls;
#endif
HttpWebRequest priority_request;
NetworkCredential ntlm_credentials;
bool ntlm_authenticated;
-#if NET_1_1
bool unsafe_sharing;
-#endif
bool ssl;
bool certsAvailable;
#endif
}
- WebConnectionData data = Data;
+ //WebConnectionData data = Data;
foreach (IPAddress address in hostEntry.AddressList) {
socket = new Socket (address.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint remote = new IPEndPoint (address, sPoint.Address.Port);
-#if NET_1_1
socket.SetSocketOption (SocketOptionLevel.Tcp, SocketOptionName.NoDelay, sPoint.UseNagleAlgorithm ? 0 : 1);
-#endif
-#if NET_2_0
socket.NoDelay = !sPoint.UseNagleAlgorithm;
if (!sPoint.CallEndPointDelegate (socket, remote)) {
socket.Close ();
socket = null;
status = WebExceptionStatus.ConnectFailure;
} else {
-#endif
try {
if (request.Aborted)
return;
if (s != null)
s.Close ();
return;
- } catch (ObjectDisposedException exc) {
+ } catch (ObjectDisposedException) {
// socket closed from another thread
return;
} catch (Exception exc) {
status = WebExceptionStatus.ConnectFailure;
connect_exception = exc;
}
-#if NET_2_0
}
-#endif
}
}
}
request.ClientCertificates,
request, buffer};
nstream = (Stream) Activator.CreateInstance (sslStream, args);
-#if (NET_2_0 || MONOTOUCH) && SECURITY_DEP
+#if SECURITY_DEP
SslClientStream scs = (SslClientStream) nstream;
var helper = new ServicePointManager.ChainValidationHelper (request);
scs.ServerCertValidation2 += new CertificateValidationCallback2 (helper.ValidateChain);
set { ntlm_credentials = value; }
}
-#if NET_1_1
internal bool UnsafeAuthenticatedConnectionSharing {
get { return unsafe_sharing; }
set { unsafe_sharing = value; }
}
-#endif
// -
}
}