diff --git a/Directory.Build.props b/Directory.Build.props index eb9b8dfd3c9..3f855aae763 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -36,7 +36,7 @@ * Bump first digit of the patch version for feature releases (and reset the first two digits to 0) --> 34.99.0 - preview.2 + preview.3 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ace9f2b5381..566089db986 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,20 +1,20 @@ - + https://github.com/dotnet/installer - 0a73f814e19c9a239371cb732c9d1257e10fb8a2 + d070660282eb5f78497310f77093638744112e03 - + https://github.com/dotnet/runtime - dcc66a7ca25696a2326f296c3d8d3ac5a13f0524 + 99b76018b6e4edc4ce185dd5f3c5697c6941d88e - + https://github.com/dotnet/runtime - dcc66a7ca25696a2326f296c3d8d3ac5a13f0524 + 99b76018b6e4edc4ce185dd5f3c5697c6941d88e - + https://github.com/dotnet/emsdk - 258b51a8e5f5bea07766ab99d2aaa75582d1ceb9 + 2d3f1fe4807a21879cedba9d3fde8cd329fb17f2 https://github.com/dotnet/cecil diff --git a/eng/Versions.props b/eng/Versions.props index c096a719b25..6bf62dc7325 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,12 +1,12 @@ - 9.0.100-preview.2.24122.3 - 9.0.0-preview.2.24122.2 - 9.0.0-preview.2.24122.2 + 9.0.100-preview.3.24126.2 + 9.0.0-preview.2.24123.1 + 9.0.0-preview.2.24123.1 7.0.0-beta.22103.1 7.0.0-beta.22103.1 - 9.0.0-preview.2.24120.1 + 9.0.0-preview.2.24121.1 $(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion) 7.0.100-rc.1.22410.7 0.11.4-alpha.24119.1 diff --git a/external/Java.Interop b/external/Java.Interop index c825dcad8e7..14a9470176b 160000 --- a/external/Java.Interop +++ b/external/Java.Interop @@ -1 +1 @@ -Subproject commit c825dcad8e7fe2e1ba5846a592a02f6a578db991 +Subproject commit 14a9470176b314fe521479fc75f6d9dd919abb56 diff --git a/external/xamarin-android-tools b/external/xamarin-android-tools index a698a33aa4f..37d79c9dcdf 160000 --- a/external/xamarin-android-tools +++ b/external/xamarin-android-tools @@ -1 +1 @@ -Subproject commit a698a33aa4ffcaac90b54caf5e77236d57b0cf9e +Subproject commit 37d79c9dcdf738a181084b0b5890877128d75f1e diff --git a/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs b/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs index 44883640487..26645e6fdcb 100644 --- a/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs +++ b/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs @@ -536,30 +536,29 @@ protected virtual async Task WriteRequestContentToOutput (HttpRequestMessage req if (request.Content is null) return; - using (var stream = await request.Content.ReadAsStreamAsync ().ConfigureAwait (false)) { - await stream.CopyToAsync(httpConnection.OutputStream!, 4096, cancellationToken).ConfigureAwait(false); - - // - // Rewind the stream to beginning in case the HttpContent implementation - // will be accessed again (e.g. after redirect) and it keeps its stream - // open behind the scenes instead of recreating it on the next call to - // ReadAsStreamAsync. If we don't rewind it, the ReadAsStreamAsync - // call above will throw an exception as we'd be attempting to read an - // already "closed" stream (that is one whose Position is set to its - // end). - // - // This is not a perfect solution since the HttpContent may do weird - // things in its implementation, but it's better than copying the - // content into a buffer since we have no way of knowing how the data is - // read or generated and also we don't want to keep potentially large - // amounts of data in memory (which would happen if we read the content - // into a byte[] buffer and kept it cached for re-use on redirect). - // - // See https://bugzilla.xamarin.com/show_bug.cgi?id=55477 - // - if (stream.CanSeek) - stream.Seek (0, SeekOrigin.Begin); - } + var stream = await request.Content.ReadAsStreamAsync ().ConfigureAwait (false); + await stream.CopyToAsync(httpConnection.OutputStream!, 4096, cancellationToken).ConfigureAwait(false); + + // + // Rewind the stream to beginning in case the HttpContent implementation + // will be accessed again (e.g. after redirect) and it keeps its stream + // open behind the scenes instead of recreating it on the next call to + // ReadAsStreamAsync. If we don't rewind it, the ReadAsStreamAsync + // call above will throw an exception as we'd be attempting to read an + // already "closed" stream (that is one whose Position is set to its + // end). + // + // This is not a perfect solution since the HttpContent may do weird + // things in its implementation, but it's better than copying the + // content into a buffer since we have no way of knowing how the data is + // read or generated and also we don't want to keep potentially large + // amounts of data in memory (which would happen if we read the content + // into a byte[] buffer and kept it cached for re-use on redirect). + // + // See https://bugzilla.xamarin.com/show_bug.cgi?id=55477 + // + if (stream.CanSeek) + stream.Seek (0, SeekOrigin.Begin); } internal Task WriteRequestContentToOutputInternal (HttpRequestMessage request, HttpURLConnection httpConnection, CancellationToken cancellationToken) diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs index f25d948b44c..f1021c2d15d 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs @@ -495,6 +495,7 @@ public void LocalizedAssemblies_ShouldBeFastDeployed () [Test] public void IncrementalFastDeployment () { + Assert.Ignore ("https://github.com/NuGet/Home/issues/13269"); AssertCommercialBuild (); var class1src = new BuildItem.Source ("Class1.cs") { diff --git a/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs b/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs index 96f66778ef3..b71ee2893da 100644 --- a/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs +++ b/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs @@ -98,6 +98,31 @@ async Task DoDecompression (string urlPath, string encoding, string jsonFi return true; } + [Test] + public async Task DoesNotDisposeContentStream() + { + using var listener = new HttpListener (); + listener.Prefixes.Add ("http://+:47663/"); + listener.Start (); + listener.BeginGetContext (ar => { + var ctx = listener.EndGetContext (ar); + ctx.Response.StatusCode = 204; + ctx.Response.ContentLength64 = 0; + ctx.Response.Close (); + }, null); + + var jsonContent = new StringContent ("hello"); + var request = new HttpRequestMessage (HttpMethod.Post, "http://localhost:47663/") { Content = jsonContent }; + + var response = await new HttpClient (new AndroidMessageHandler ()).SendAsync (request); + Assert.True (response.IsSuccessStatusCode); + + var contentValue = await jsonContent.ReadAsStringAsync (); + Assert.AreEqual ("hello", contentValue); + + listener.Close (); + } + [Test] public async Task ServerCertificateCustomValidationCallback_ApproveRequest () {