Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FillAsync()

async ValueTask System.Net.Http.HttpConnection.FillAsync ( bool async)
inlineprivate

Definition at line 2290 of file HttpConnection.cs.

2291 {
2292 int num = _readLength - _readOffset;
2293 if (num == 0)
2294 {
2295 _readOffset = (_readLength = 0);
2296 }
2297 else if (_readOffset > 0)
2298 {
2299 Buffer.BlockCopy(_readBuffer, _readOffset, _readBuffer, 0, num);
2300 _readOffset = 0;
2301 _readLength = num;
2302 }
2303 else if (num == _readBuffer.Length)
2304 {
2305 byte[] array = new byte[_readBuffer.Length * 2];
2306 Buffer.BlockCopy(_readBuffer, 0, array, 0, num);
2308 _readOffset = 0;
2309 _readLength = num;
2310 }
2312 int num3 = num2;
2313 if (System.Net.NetEventSource.Log.IsEnabled())
2314 {
2315 Trace($"Received {num3} bytes.", "FillAsync");
2316 }
2317 if (num3 == 0)
2318 {
2320 }
2321 _readLength += num3;
2322 }
int Read(byte[] buffer, int offset, int count)
Task< int > ReadAsync(byte[] buffer, int offset, int count)
Definition Stream.cs:762
override void Trace(string message, [CallerMemberName] string memberName=null)
static readonly System.Net.NetEventSource Log
static string net_http_invalid_response_premature_eof
Definition SR.cs:94
Definition SR.cs:7

References System.Net.Http.HttpConnection._readBuffer, System.Net.Http.HttpConnection._readLength, System.Net.Http.HttpConnection._readOffset, System.Net.Http.HttpConnection._stream, System.array, System.Buffer.BlockCopy(), System.Net.NetEventSource.Log, System.SR.net_http_invalid_response_premature_eof, System.IO.Stream.Read(), System.IO.Stream.ReadAsync(), and System.Net.Http.HttpConnection.Trace().

Referenced by System.Net.Http.HttpConnection.ChunkedEncodingReadStream.CopyToAsyncCore(), System.Net.Http.HttpConnection.CopyToContentLengthAsync(), System.Net.Http.HttpConnection.ChunkedEncodingReadStream.DrainAsync(), System.Net.Http.HttpConnection.ContentLengthReadStream.DrainAsync(), System.Net.Http.HttpConnection.Fill(), System.Net.Http.HttpConnection.ChunkedEncodingReadStream.ReadAsyncCore(), and System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync().