mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9de8c08d26 | ||
|
|
bc488bd546 | ||
|
|
8593ebe2b3 | ||
|
|
15f8e79bb9 | ||
|
|
b266dd15a3 | ||
|
|
fcf29c0e2f | ||
|
|
b4c684a209 | ||
|
|
0947ffd89c | ||
|
|
bca9714576 | ||
|
|
242ea36e35 |
No files matched your search
@@ -44,10 +44,10 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyCompany (Consts.MonoCompany)]
|
||||
[assembly: AssemblyProduct (Consts.MonoProduct)]
|
||||
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
|
||||
[assembly: AssemblyVersion (Consts.FxVersion)]
|
||||
[assembly: SatelliteContractVersion (Consts.FxVersion)]
|
||||
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
|
||||
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
|
||||
[assembly: AssemblyVersion ("4.0.0.0")]
|
||||
[assembly: SatelliteContractVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.50524.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.50524.0")]
|
||||
|
||||
[assembly: NeutralResourcesLanguage ("en-US")]
|
||||
[assembly: CLSCompliant (true)]
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace System.Net
|
||||
bool allowBuffering = true;
|
||||
X509CertificateCollection certificates;
|
||||
string connectionGroup;
|
||||
bool haveContentLength;
|
||||
long contentLength = -1;
|
||||
HttpContinueDelegate continueDelegate;
|
||||
CookieContainer cookieContainer;
|
||||
@@ -277,6 +278,7 @@ namespace System.Net
|
||||
throw new ArgumentOutOfRangeException ("value", "Content-Length must be >= 0");
|
||||
|
||||
contentLength = value;
|
||||
haveContentLength = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -593,10 +595,11 @@ namespace System.Net
|
||||
get { return servicePoint; }
|
||||
}
|
||||
#if NET_4_0
|
||||
[MonoTODO ("for portable library support")]
|
||||
public virtual bool SupportsCookieContainer {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
// The managed implementation supports the cookie container
|
||||
// it is only Silverlight that returns false here
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1108,8 +1111,15 @@ namespace System.Net
|
||||
if (continueDelegate != null)
|
||||
continueDelegate (statusCode, headers);
|
||||
}
|
||||
|
||||
void RewriteRedirectToGet ()
|
||||
{
|
||||
method = "GET";
|
||||
webHeaders.RemoveInternal ("Transfer-Encoding");
|
||||
sendChunked = false;
|
||||
}
|
||||
|
||||
bool Redirect (WebAsyncResult result, HttpStatusCode code)
|
||||
bool Redirect (WebAsyncResult result, HttpStatusCode code, WebResponse response)
|
||||
{
|
||||
redirects++;
|
||||
Exception e = null;
|
||||
@@ -1121,12 +1131,12 @@ namespace System.Net
|
||||
case HttpStatusCode.MovedPermanently: // 301
|
||||
case HttpStatusCode.Redirect: // 302
|
||||
if (method == "POST")
|
||||
method = "GET";
|
||||
RewriteRedirectToGet ();
|
||||
break;
|
||||
case HttpStatusCode.TemporaryRedirect: // 307
|
||||
break;
|
||||
case HttpStatusCode.SeeOther: //303
|
||||
method = "GET";
|
||||
RewriteRedirectToGet ();
|
||||
break;
|
||||
case HttpStatusCode.NotModified: // 304
|
||||
return false;
|
||||
@@ -1139,12 +1149,13 @@ namespace System.Net
|
||||
break;
|
||||
}
|
||||
|
||||
if (method != "GET" && !InternalAllowBuffering)
|
||||
e = new WebException ("The request requires buffering data to succeed.", null, WebExceptionStatus.ProtocolError, webResponse);
|
||||
|
||||
if (e != null)
|
||||
throw e;
|
||||
|
||||
contentLength = -1;
|
||||
//bodyBufferLength = 0;
|
||||
//bodyBuffer = null;
|
||||
uriString = webResponse.Headers ["Location"];
|
||||
|
||||
if (uriString == null)
|
||||
@@ -1174,12 +1185,15 @@ namespace System.Net
|
||||
} else if (contentLength != -1) {
|
||||
if (auth_state.NtlmAuthState == NtlmAuthState.Challenge || proxy_auth_state.NtlmAuthState == NtlmAuthState.Challenge) {
|
||||
// We don't send any body with the NTLM Challenge request.
|
||||
webHeaders.SetInternal ("Content-Length", "0");
|
||||
if (haveContentLength || gotRequestStream || contentLength > 0)
|
||||
webHeaders.SetInternal ("Content-Length", "0");
|
||||
else
|
||||
webHeaders.RemoveInternal ("Content-Length");
|
||||
} else {
|
||||
if (contentLength > 0)
|
||||
continue100 = true;
|
||||
|
||||
if (gotRequestStream || contentLength > 0)
|
||||
if (haveContentLength || gotRequestStream || contentLength > 0)
|
||||
webHeaders.SetInternal ("Content-Length", contentLength.ToString ());
|
||||
}
|
||||
webHeaders.RemoveInternal ("Transfer-Encoding");
|
||||
@@ -1517,6 +1531,11 @@ namespace System.Net
|
||||
r.SetCompleted (false, webResponse);
|
||||
r.DoCallback ();
|
||||
} else {
|
||||
if (sendChunked) {
|
||||
sendChunked = false;
|
||||
webHeaders.RemoveInternal ("Transfer-Encoding");
|
||||
}
|
||||
|
||||
if (webResponse != null) {
|
||||
if (HandleNtlmAuth (r))
|
||||
return;
|
||||
@@ -1651,11 +1670,7 @@ namespace System.Net
|
||||
if (!usedPreAuth && CheckAuthorization (webResponse, code)) {
|
||||
// Keep the written body, so it can be rewritten in the retry
|
||||
if (InternalAllowBuffering) {
|
||||
// NTLM: This is to avoid sending data in the 'challenge' request
|
||||
// We save it in the first request (first 401), don't send anything
|
||||
// in the challenge request and send it in the response request along
|
||||
// with the buffers kept form the first request.
|
||||
if (auth_state.NtlmAuthState == NtlmAuthState.Challenge || proxy_auth_state.NtlmAuthState == NtlmAuthState.Challenge) {
|
||||
if (writeStream.WriteBufferLength > 0) {
|
||||
bodyBuffer = writeStream.WriteBuffer;
|
||||
bodyBufferLength = writeStream.WriteBufferLength;
|
||||
}
|
||||
@@ -1702,7 +1717,7 @@ namespace System.Net
|
||||
bool b = false;
|
||||
int c = (int) code;
|
||||
if (allowAutoRedirect && c >= 300) {
|
||||
b = Redirect (result, code);
|
||||
b = Redirect (result, code, webResponse);
|
||||
if (InternalAllowBuffering && writeStream.WriteBufferLength > 0) {
|
||||
bodyBuffer = writeStream.WriteBuffer;
|
||||
bodyBufferLength = writeStream.WriteBufferLength;
|
||||
|
||||
@@ -514,6 +514,13 @@ namespace System.Net
|
||||
Buffer.BlockCopy (buffer, offset, newBuffer, head.Length, size);
|
||||
Buffer.BlockCopy (crlf, 0, newBuffer, head.Length + size, crlf.Length);
|
||||
|
||||
if (allowBuffering) {
|
||||
if (writeBuffer == null)
|
||||
writeBuffer = new MemoryStream ();
|
||||
writeBuffer.Write (buffer, offset, size);
|
||||
totalWritten += size;
|
||||
}
|
||||
|
||||
buffer = newBuffer;
|
||||
offset = 0;
|
||||
size = chunkSize;
|
||||
|
||||
@@ -287,16 +287,26 @@ namespace System.Net
|
||||
return GetCreator (requestUri.Scheme).Create (requestUri);
|
||||
}
|
||||
#if NET_4_0
|
||||
[MonoTODO ("for portable library support")]
|
||||
static HttpWebRequest SharedCreateHttp (Uri uri)
|
||||
{
|
||||
if (uri.Scheme != "http" && uri.Scheme != "https")
|
||||
throw new NotSupportedException ("The uri should start with http or https");
|
||||
|
||||
return new HttpWebRequest (uri);
|
||||
}
|
||||
|
||||
public static HttpWebRequest CreateHttp (string requestUriString)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
if (requestUriString == null)
|
||||
throw new ArgumentNullException ("requestUriString");
|
||||
return SharedCreateHttp (new Uri (requestUriString));
|
||||
}
|
||||
|
||||
[MonoTODO ("for portable library support")]
|
||||
public static HttpWebRequest CreateHttp (Uri requestUri)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
if (requestUri == null)
|
||||
throw new ArgumentNullException ("requestUri");
|
||||
return SharedCreateHttp (requestUri);
|
||||
}
|
||||
#endif
|
||||
public virtual Stream EndGetRequestStream (IAsyncResult asyncResult)
|
||||
|
||||
@@ -86,9 +86,13 @@ namespace System.Net
|
||||
get { throw new NotSupportedException (); }
|
||||
}
|
||||
#if NET_4_0
|
||||
[MonoTODO ("for portable library support")]
|
||||
|
||||
public virtual bool SupportsHeaders {
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
// The managed stack always returns this as true, it is only
|
||||
// the Silverlight stack that does not support this.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// Methods
|
||||
|
||||
@@ -85,7 +85,11 @@ namespace System.Threading {
|
||||
if (ec.FlowSuppressed)
|
||||
return null;
|
||||
|
||||
if (nullOnEmpty && ec._sc == null && (ec._lcc == null || !ec._lcc.HasInfo))
|
||||
if (nullOnEmpty
|
||||
#if !MOBILE
|
||||
&& ec._sc == null
|
||||
#endif
|
||||
&& (ec._lcc == null || !ec._lcc.HasInfo))
|
||||
return null;
|
||||
|
||||
ExecutionContext capture = new ExecutionContext (ec);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <signal.h>
|
||||
#include <sched.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
@@ -36,6 +37,20 @@
|
||||
#include <valgrind/memcheck.h>
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_ANDROID
|
||||
/*
|
||||
* HACK
|
||||
* Android supports clock_*(), but didn't declare them consistently until
|
||||
* recently, e.g. on NDK r8e API-3, API-4, and API-5 declare them in <time.h>,
|
||||
* but higher API levels do not. This isn't corrected until r9c, which
|
||||
* Wrench isn't currently using.
|
||||
*
|
||||
* Manually declare them so that we don't get implicit declaration errors.
|
||||
*/
|
||||
extern int clock_gettime(clockid_t, struct timespec *);
|
||||
extern int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *);
|
||||
#endif /* PLATFORM_ANDROID */
|
||||
|
||||
#if 0
|
||||
#define DEBUG(...) g_message(__VA_ARGS__)
|
||||
#else
|
||||
|
||||
Reference in new issue
Block a user