Imported Upstream version 4.3.2.467

Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
Xamarin Public Jenkins
2016-02-22 11:00:01 -05:00
parent f302175246
commit f3e3aab35a
4097 changed files with 122406 additions and 82300 deletions

View File

@ -45,8 +45,8 @@ namespace System.Net
int readBufferOffset;
int readBufferSize;
int stream_length; // -1 when CL not present
int contentLength;
int totalRead;
long contentLength;
long totalRead;
internal long totalWritten;
bool nextReadCalled;
int pendingReads;
@ -93,10 +93,10 @@ namespace System.Net
ReadAll ();
}
} catch {
contentLength = Int32.MaxValue;
contentLength = Int64.MaxValue;
}
} else {
contentLength = Int32.MaxValue;
contentLength = Int64.MaxValue;
}
// Negative numbers?
@ -208,7 +208,7 @@ namespace System.Net
internal void ForceCompletion ()
{
if (!nextReadCalled) {
if (contentLength == Int32.MaxValue)
if (contentLength == Int64.MaxValue)
contentLength = 0;
nextReadCalled = true;
cnc.NextRead ();
@ -244,7 +244,7 @@ namespace System.Net
int diff = readBufferSize - readBufferOffset;
int new_size;
if (contentLength == Int32.MaxValue) {
if (contentLength == Int64.MaxValue) {
MemoryStream ms = new MemoryStream ();
byte [] buffer = null;
if (readBuffer != null && diff > 0) {
@ -264,7 +264,7 @@ namespace System.Net
new_size = (int) ms.Length;
contentLength = new_size;
} else {
new_size = contentLength - totalRead;
new_size = (int) (contentLength - totalRead);
b = new byte [new_size];
if (readBuffer != null && diff > 0) {
if (diff > new_size)
@ -384,8 +384,8 @@ namespace System.Net
if (cb != null)
cb = cb_wrapper;
if (contentLength != Int32.MaxValue && contentLength - totalRead < size)
size = contentLength - totalRead;
if (contentLength != Int64.MaxValue && contentLength - totalRead < size)
size = (int)(contentLength - totalRead);
if (!read_eof) {
result.InnerAsyncResult = cnc.BeginRead (request, buffer, offset, size, cb, result);