Lower the amount of running tasks

This commit is contained in:
Bond_009
2019-02-24 03:16:19 +01:00
committed by Bond-009
parent 5024c52c60
commit 2696ac5eac
10 changed files with 53 additions and 81 deletions

View File

@@ -86,8 +86,7 @@ namespace Emby.Server.Implementations.SocketSharp
else
{
// We use a substream, as in 2.x we will support large uploads streamed to disk,
var sub = new HttpPostedFile(e.Filename, e.ContentType, input, e.Start, e.Length);
files[e.Name] = sub;
files[e.Name] = new HttpPostedFile(e.Filename, e.ContentType, input, e.Start, e.Length);
}
}
}
@@ -374,7 +373,7 @@ namespace Emby.Server.Implementations.SocketSharp
var elem = new Element();
ReadOnlySpan<char> header;
while ((header = ReadHeaders().AsSpan()) != null)
while ((header = ReadLine().AsSpan()).Length != 0)
{
if (header.StartsWith("Content-Disposition:".AsSpan(), StringComparison.OrdinalIgnoreCase))
{
@@ -513,17 +512,6 @@ namespace Emby.Server.Implementations.SocketSharp
return false;
}
private string ReadHeaders()
{
string s = ReadLine();
if (s.Length == 0)
{
return null;
}
return s;
}
private static bool CompareBytes(byte[] orig, byte[] other)
{
for (int i = orig.Length - 1; i >= 0; i--)