static HttpWebRequest ()
{
defaultMaxResponseHeadersLength = 64 * 1024;
-#if !NET_2_1
+#if !MOBILE
NetConfig config = ConfigurationSettings.GetConfig ("system.net/settings") as NetConfig;
if (config != null) {
int x = config.MaxResponseHeadersLength;
#endif
}
-#if NET_2_1
+ [Obsolete ("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
+#if !BOOTSTRAP_BASIC
+ [System.ComponentModel.EditorBrowsable (System.ComponentModel.EditorBrowsableState.Never)]
+#endif
+ public HttpWebRequest ()
+ {
+ }
+
+#if MOBILE
public
#else
internal
{
this.requestUri = uri;
this.actualUri = uri;
- this.proxy = GlobalProxySelection.Select;
+ this.proxy = InternalDefaultWebProxy;
this.webHeaders = new WebHeaderCollection (WebHeaderCollectionType.HttpWebRequest);
ThrowOnError = true;
ResetAuthorization ();
internal set { actualUri = value; } // Used by Ftp+proxy
}
- public bool AllowAutoRedirect {
+ public virtual bool AllowAutoRedirect {
get { return allowAutoRedirect; }
set { this.allowAutoRedirect = value; }
}
- public bool AllowWriteStreamBuffering {
+ public virtual bool AllowWriteStreamBuffering {
get { return allowBuffering; }
set { allowBuffering = value; }
}
SetSpecialHeaders(headerName, HttpProtocolUtils.date2string(dateTime));
}
-#if !NET_2_1
+#if !MOBILE
[MonoTODO]
public static new RequestCachePolicy DefaultCachePolicy
{
newWebHeaders.Add(headerName,webHeaders[headerName]);
}
- webHeaders = newWebHeaders;
+ this.webHeaders = newWebHeaders;
}
}
return EndGetRequestStream (asyncResult);
}
+ [MonoTODO]
+ public Stream GetRequestStream (out TransportContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
bool CheckIfForceWrite (SimpleAsyncResult result)
{
if (writeStream == null || writeStream.RequestWritten || !InternalAllowBuffering)
initialMethod = method;
SimpleAsyncResult.RunWithLock (locker, CheckIfForceWrite, inner => {
- var synch = inner.CompletedSynchronously;
+ var synch = inner.CompletedSynchronouslyPeek;
if (inner.GotException) {
aread.SetCompleted (synch, inner.Exception);
}
if (asyncWrite != null) {
- asyncWrite.SetCompleted (inner.CompletedSynchronously, writeStream);
+ asyncWrite.SetCompleted (inner.CompletedSynchronouslyPeek, writeStream);
asyncWrite.DoCallback ();
asyncWrite = null;
}
if (wce != null) {
WebConnection cnc = wce.Connection;
cnc.PriorityRequest = this;
- ICredentials creds = !isProxy ? credentials : proxy.Credentials;
+ ICredentials creds = (!isProxy || proxy == null) ? credentials : proxy.Credentials;
if (creds != null) {
cnc.NtlmCredential = creds.GetCredential (requestUri, "NTLM");
cnc.UnsafeAuthenticatedConnectionSharing = unsafe_auth_blah;
return;
}
- bool isProxy = ProxyQuery && !proxy.IsBypassed (actualUri);
+ bool isProxy = ProxyQuery && proxy != null && !proxy.IsBypassed (actualUri);
bool redirected;
try {
}
internal WebConnection StoredConnection;
+
+#region referencesource
+ internal static StringBuilder GenerateConnectionGroup(string connectionGroupName, bool unsafeConnectionGroup, bool isInternalGroup)
+ {
+ StringBuilder connectionLine = new StringBuilder(connectionGroupName);
+
+ connectionLine.Append(unsafeConnectionGroup ? "U>" : "S>");
+
+ if (isInternalGroup)
+ {
+ connectionLine.Append("I>");
+ }
+
+ return connectionLine;
+ }
+#endregion
}
}