Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Commit 4310fa1

Browse files
committed
Switching to generations TFMs
1 parent 50222a8 commit 4310fa1

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,14 @@ public async Task SendFileAsync(string fileName, long offset, long? length, Canc
9292
throw new ArgumentOutOfRangeException(nameof(length), length, string.Empty);
9393
}
9494

95-
#if DNX451
96-
Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64,
97-
FileOptions.Asynchronous | FileOptions.SequentialScan);
98-
#else
99-
// TODO: Bring back async when the contract gets it
100-
Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64);
101-
#endif
95+
var fileStream = new FileStream(
96+
fileName,
97+
FileMode.Open,
98+
FileAccess.Read,
99+
FileShare.ReadWrite,
100+
bufferSize: 1024 * 64,
101+
options: FileOptions.Asynchronous | FileOptions.SequentialScan);
102+
102103
try
103104
{
104105
fileStream.Seek(offset, SeekOrigin.Begin);
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"version": "1.0.0-*",
3-
"description": "ASP.NET 5 static files middleware.",
4-
"repository": {
5-
"type": "git",
6-
"url": "git://github.com/aspnet/staticfiles"
7-
},
8-
"dependencies": {
9-
"Microsoft.AspNet.Http.Extensions": "1.0.0-*",
10-
"Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*",
11-
"Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*",
12-
"Microsoft.Extensions.Logging.Abstractions": "1.0.0-*",
13-
"Microsoft.Extensions.WebEncoders": "1.0.0-*"
14-
},
15-
"frameworks": {
16-
"dnx451": { },
17-
"dnxcore50": { }
18-
}
19-
}
2+
"version": "1.0.0-*",
3+
"description": "ASP.NET 5 static files middleware.",
4+
"repository": {
5+
"type": "git",
6+
"url": "git://github.com/aspnet/staticfiles"
7+
},
8+
"dependencies": {
9+
"Microsoft.AspNet.Http.Extensions": "1.0.0-*",
10+
"Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*",
11+
"Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*",
12+
"Microsoft.Extensions.Logging.Abstractions": "1.0.0-*",
13+
"Microsoft.Extensions.WebEncoders": "1.0.0-*"
14+
},
15+
"frameworks": {
16+
"net451": {},
17+
"dotnet5.4": {}
18+
}
19+
}

0 commit comments

Comments
 (0)