Merge branch 'upstream'

Former-commit-id: ab7b15575604b968d7408f3414af9d72a61b1739
This commit is contained in:
Xamarin Public Jenkins 2015-08-25 18:50:16 -04:00
commit 9f42846e32
34 changed files with 115 additions and 39 deletions

View File

@ -85,7 +85,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/config.h.in mkinstalldirs \
$(srcdir)/mono-core.spec.in $(srcdir)/mono-uninstalled.pc.in \
AUTHORS COPYING.LIB ChangeLog NEWS compile config.guess \
config.rpath config.sub depcomp install-sh missing ltmain.sh
config.rpath config.sub install-sh missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \

View File

@ -1 +1 @@
d8620aa82da0a0b38b32fce2756391f51b4f0e09
0153a4d763e8fdec1bfc6ad8a10db68ae9a8b3ad

View File

@ -1 +1 @@
eb6b931cec597bff05367555adbfdfd531547514
4d5ca3baf19b55971eba3a1e4c430304031594ed

View File

@ -34,7 +34,7 @@ static class Consts
// Use these assembly version constants to make code more maintainable.
//
public const string MonoVersion = "4.0.3.0";
public const string MonoVersion = "4.0.4.0";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";

View File

@ -340,6 +340,8 @@ namespace System.Net.Http
wrequest.ContentLength = content.Headers.ContentLength.Value;
}
wrequest.ResendContentFactory = content.CopyTo;
var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false);
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
} else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) {

View File

@ -81,6 +81,12 @@ namespace System.Net.Http
}
}
// Only used by HttpWebRequest internals which is not async friendly
internal void CopyTo (Stream stream)
{
CopyToAsync (stream).Wait ();
}
public Task CopyToAsync (Stream stream)
{
return CopyToAsync (stream, null);

View File

@ -110,6 +110,9 @@ namespace System.Net
AuthorizationState auth_state, proxy_auth_state;
string host;
[NonSerialized]
internal Action<Stream> ResendContentFactory;
// Constructors
static HttpWebRequest ()
{
@ -226,9 +229,15 @@ namespace System.Net
internal bool InternalAllowBuffering {
get {
return (allowBuffering && (method != "HEAD" && method != "GET" &&
method != "MKCOL" && method != "CONNECT" &&
method != "TRACE"));
return allowBuffering && MethodWithBuffer;
}
}
bool MethodWithBuffer {
get {
return method != "HEAD" && method != "GET" &&
method != "MKCOL" && method != "CONNECT" &&
method != "TRACE";
}
}
@ -1306,8 +1315,7 @@ namespace System.Net
bodyBuffer = null;
writeStream.Close ();
}
} else if (method != "HEAD" && method != "GET" && method != "MKCOL" && method != "CONNECT" &&
method != "TRACE") {
} else if (MethodWithBuffer) {
if (getResponseCalled && !writeStream.RequestWritten)
return writeStream.WriteRequestAsync (result);
}
@ -1606,12 +1614,28 @@ namespace System.Net
(ProxyQuery && !proxy_auth_state.IsCompleted && code == HttpStatusCode.ProxyAuthenticationRequired)) {
if (!usedPreAuth && CheckAuthorization (webResponse, code)) {
// Keep the written body, so it can be rewritten in the retry
if (InternalAllowBuffering) {
if (writeStream.WriteBufferLength > 0) {
bodyBuffer = writeStream.WriteBuffer;
bodyBufferLength = writeStream.WriteBufferLength;
if (MethodWithBuffer) {
if (AllowWriteStreamBuffering) {
if (writeStream.WriteBufferLength > 0) {
bodyBuffer = writeStream.WriteBuffer;
bodyBufferLength = writeStream.WriteBufferLength;
}
return true;
}
//
// Buffering is not allowed but we have alternative way to get same content (we
// need to resent it due to NTLM Authentication).
//
if (ResendContentFactory != null) {
using (var ms = new MemoryStream ()) {
ResendContentFactory (ms);
bodyBuffer = ms.ToArray ();
bodyBufferLength = bodyBuffer.Length;
}
return true;
}
return true;
} else if (method != "PUT" && method != "POST") {
bodyBuffer = null;
return true;

View File

@ -362,6 +362,41 @@ namespace MonoTests.System.IO.Compression
backing.Close();
}
#endif
[Test]
[ExpectedException (typeof (ArgumentException))]
public void CheckBufferOverrun ()
{
byte[] data = new byte [20];
MemoryStream backing = new MemoryStream ();
DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
compressing.Write (data, 0, data.Length + 1);
compressing.Close ();
backing.Close ();
}
[Test]
public void Bug28777_EmptyFlush ()
{
MemoryStream backing = new MemoryStream ();
DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
compressing.Flush ();
compressing.Close ();
backing.Close ();
}
[Test]
public void Bug28777_DoubleFlush ()
{
byte[] buffer = new byte [4096];
MemoryStream backing = new MemoryStream ();
DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
compressing.Write (buffer, 0, buffer.Length);
compressing.Flush ();
compressing.Flush ();
compressing.Close ();
backing.Close ();
}
}
}

View File

@ -1 +1 @@
635d63e502807da4ea4ad941b6e58bfab43bd37a
68b84e24a06bbb6bb78ef224608dc4eba15d5030

View File

@ -1 +1 @@
2b5f667533551ac33fc9de43b43a62b448b55a90
17f4de6638d19cbc68f60a4d532798d87ab7302b

View File

@ -1 +1 @@
5e889cf1e66abc75e57bafd92c7139ab2c808069
e29dbe6efa356793ba4738a7a2d9858233c5d502

View File

@ -1 +1 @@
4218f3c3bb5d10cef11ff7c790e5ade5d1b86898
2a993e8625896ec805afccd0668cb8f016e84399

View File

@ -1 +1 @@
2bcd9a0ee7ae4393575a446e424e0cd5017ba4c1
0bf4ff5424f83891362cc450b801e8168bf5b777

View File

@ -1 +1 @@
ff31c170be712465ad92e7a9205369a179b7fd06
58b35960f78d990b0abdf6138caee16ddcde82c8

View File

@ -1 +1 @@
02b350ac4078a8f6791373d728b2866b52268350
32112b9a947cfe490e82c9e32a4201dc758359d9

View File

@ -1 +1 @@
ab62521ff428443441e7b5469865bfa7555b53a7
bf09282b13961dddc7fd50d446f6246c14bff292

View File

@ -15,7 +15,7 @@ License: LGPL v2.1 only
Group: Development/Languages/Mono
Summary: A .NET Runtime Environment
Url: http://www.mono-project.com
Version: 4.0.3
Version: 4.0.4
Release: 0
Source0: mono-%{version}.tar.bz2
BuildRequires: bison

View File

@ -2007,6 +2007,7 @@ mono_image_load_file_for_image (MonoImage *image, int fileidx)
mono_image_unlock (image);
return image->files [fileidx - 1];
}
mono_image_unlock (image);
fname_id = mono_metadata_decode_row_col (t, fileidx - 1, MONO_FILE_NAME);
fname = mono_metadata_string_heap (image, fname_id);
@ -2020,7 +2021,7 @@ mono_image_load_file_for_image (MonoImage *image, int fileidx)
if (image->files && image->files [fileidx - 1]) {
MonoImage *old = res;
res = image->files [fileidx - 1];
mono_loader_unlock ();
mono_image_unlock (image);
mono_image_close (old);
} else {
int i;
@ -2034,7 +2035,7 @@ mono_image_load_file_for_image (MonoImage *image, int fileidx)
if (!image->files)
image->files = g_new0 (MonoImage*, t->rows);
image->files [fileidx - 1] = res;
mono_loader_unlock ();
mono_image_unlock (image);
/* vtable fixup can't happen with the image lock held */
#ifdef HOST_WIN32
if (res->is_module_handle)

View File

@ -759,7 +759,7 @@ EXTRA_DIST = TestDriver.cs ldscript ldscript.mono \
Makefile.am.in
version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.0.3.20/d6946b4\"" > version.h
echo "#define FULL_VERSION \"Stable 4.0.4.1/5ab4c0d\"" > version.h
# Utility target for patching libtool to speed up linking
patch-libtool:

View File

@ -759,7 +759,7 @@ EXTRA_DIST = TestDriver.cs ldscript ldscript.mono \
Makefile.am.in
version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.0.3.20/d6946b4\"" > version.h
echo "#define FULL_VERSION \"Stable 4.0.4.1/5ab4c0d\"" > version.h
# Utility target for patching libtool to speed up linking
patch-libtool:

Some files were not shown because too many files have changed in this diff Show More