int maxResponseHeadersLength;
static int defaultMaxResponseHeadersLength;
int readWriteTimeout = 300000; // ms
- IMonoTlsProvider tlsProvider;
#if SECURITY_DEP
+ MonoTlsProvider tlsProvider;
MonoTlsSettings tlsSettings;
#endif
ServerCertValidationCallback certValidationCallback;
static HttpWebRequest ()
{
defaultMaxResponseHeadersLength = 64 * 1024;
-#if !NET_2_1
+#if !MOBILE
+#pragma warning disable 618
NetConfig config = ConfigurationSettings.GetConfig ("system.net/settings") as NetConfig;
+#pragma warning restore 618
if (config != null) {
int x = config.MaxResponseHeadersLength;
if (x != -1)
#endif
}
-#if NET_2_1
+#if MOBILE
public
#else
internal
}
#if SECURITY_DEP
- internal HttpWebRequest (Uri uri, IMonoTlsProvider tlsProvider, MonoTlsSettings settings = null)
+ internal HttpWebRequest (Uri uri, MonoTlsProvider tlsProvider, MonoTlsSettings settings = null)
: this (uri)
{
this.tlsProvider = tlsProvider;
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; }
}
}
}
- internal IMonoTlsProvider TlsProvider {
+#if SECURITY_DEP
+ internal MonoTlsProvider TlsProvider {
get { return tlsProvider; }
}
-#if SECURITY_DEP
internal MonoTlsSettings TlsSettings {
get { return tlsSettings; }
}
#endif
-
+
public X509CertificateCollection ClientCertificates {
get {
if (certificates == null)
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);
return result.Response;
}
- public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext transportContext)
+ public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext context)
{
- transportContext = null;
+ context = null;
return EndGetRequestStream (asyncResult);
}
msg = "Error: " + status;
wex = new WebException (msg, status);
} else {
- msg = String.Format ("Error: {0} ({1})", status, exc.Message);
- wex = new WebException (msg, status, WebExceptionInternalStatus.RequestFatal, exc);
+ wex = exc as WebException;
+ if (wex == null) {
+ msg = String.Format ("Error: {0} ({1})", status, exc.Message);
+ wex = new WebException (msg, status, WebExceptionInternalStatus.RequestFatal, exc);
+ }
}
r.SetCompleted (false, wex);
r.DoCallback ();
}
if (asyncWrite != null) {
- asyncWrite.SetCompleted (inner.CompletedSynchronously, writeStream);
+ asyncWrite.SetCompleted (inner.CompletedSynchronouslyPeek, writeStream);
asyncWrite.DoCallback ();
asyncWrite = null;
}