-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Buffer writes from sources of synchronous writes (#9015)
* Buffer writes from sources of synchronous writes Fixes #6397
- Loading branch information
Showing
37 changed files
with
1,364 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.IO; | ||
|
||
namespace Microsoft.AspNetCore.Internal | ||
{ | ||
internal static class AspNetCoreTempDirectory | ||
{ | ||
private static string _tempDirectory; | ||
|
||
public static string TempDirectory | ||
{ | ||
get | ||
{ | ||
if (_tempDirectory == null) | ||
{ | ||
// Look for folders in the following order. | ||
var temp = Environment.GetEnvironmentVariable("ASPNETCORE_TEMP") ?? // ASPNETCORE_TEMP - User set temporary location. | ||
Path.GetTempPath(); // Fall back. | ||
|
||
if (!Directory.Exists(temp)) | ||
{ | ||
throw new DirectoryNotFoundException(temp); | ||
} | ||
|
||
_tempDirectory = temp; | ||
} | ||
|
||
return _tempDirectory; | ||
} | ||
} | ||
|
||
public static Func<string> TempDirectoryFactory => () => TempDirectory; | ||
} | ||
} |
Oops, something went wrong.