9 writes to ContentLength
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\HttpHeadersReaderTest.cs (2)
133requestContent.Headers.ContentLength = 42; 142responseContent.Headers.ContentLength = 24;
Microsoft.NET.Build.Containers (2)
Registry\DefaultBlobUploadOperations.cs (1)
78httpContent.Headers.ContentLength = content.Length;
Registry\Registry.cs (1)
493content.Headers.ContentLength = bytesRead;
System.Net.Http (2)
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (1)
153Headers.ContentLength = null;
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (1)
655request.Content.Headers.ContentLength = null;
System.Net.Http.WinHttpHandler (3)
System\Net\Http\WinHttpHandler.cs (3)
679requestContent.Headers.ContentLength = null; 754requestMessage.Content.Headers.ContentLength = null; 755requestMessage.Content.Headers.ContentLength = contentLength;
42 references to ContentLength
DevTunnels.ApiService (1)
Program.cs (1)
16var contentLength = response.Content.Headers.ContentLength ?? (await response.Content.ReadAsStringAsync()).Length;
dotnet-svcutil-lib (11)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageProperty.cs (3)
324long? contentLength = content.Headers.ContentLength; 340(!content.Headers.ContentLength.HasValue || 341content.Headers.ContentLength.Value > 0))
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (5)
134_contentLength = content.Headers.ContentLength.HasValue ? content.Headers.ContentLength.Value : -1; 175if (!content.Headers.ContentLength.HasValue) 297_contentLength = content.Headers.ContentLength.HasValue ? content.Headers.ContentLength.Value : -1;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageProperty.cs (3)
348long? contentLength = content.Headers.ContentLength; 364(!content.Headers.ContentLength.HasValue || 365content.Headers.ContentLength.Value > 0))
Microsoft.Build.Tasks.Core (3)
DownloadFile.cs (3)
198Log.LogErrorFromResources("DownloadFile.Downloading", SourceUrl, destinationFile.FullName, response.Content.Headers.ContentLength); 208Log.LogMessageFromResources(MessageImportance.High, "DownloadFile.Downloading", SourceUrl, destinationFile.FullName, response.Content.Headers.ContentLength); 357&& destinationFile.Length == response.Content.Headers.ContentLength
Microsoft.ML.PerformanceTests (1)
ImageClassificationBench.cs (1)
164var totalSizeInBytes = headerResponse.Content.Headers.ContentLength;
Microsoft.NET.Build.Containers (1)
Registry\DefaultBlobUploadOperations.cs (1)
107_logger.LogTrace("Uploading {0} bytes of content at {1}", content.Headers.ContentLength, uploadUri);
NuGet.Protocol (1)
HttpSource\HttpRequestMessageExtensions.cs (1)
77var contentLength = _httpContent.Headers.ContentLength;
System.Net.Http (13)
System\Net\Http\HttpClient.cs (2)
204c.Headers.ContentLength.GetValueOrDefault(), 280c.Headers.ContentLength.GetValueOrDefault(),
System\Net\Http\HttpContent.cs (1)
621long contentLength = Headers.ContentLength.GetValueOrDefault();
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (1)
210using var writeStream = new Http2WriteStream(this, _request.Content.Headers.ContentLength.GetValueOrDefault(-1));
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (3)
260bool useEmptyResponseContent = responseContent.Headers.ContentLength == 0 && sendContentObserved; 482_requestContentLengthRemaining = content.Headers.ContentLength ?? -1; 494long contentLength = content.Headers.ContentLength.GetValueOrDefault();
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (5)
729(request.Content.Headers.ContentLength == null || request.Content.Headers.ContentLength.GetValueOrDefault() > Expect100ErrorSendThreshold) && 815else if (response.Content.Headers.ContentLength != null) 817long contentLength = response.Content.Headers.ContentLength.GetValueOrDefault(); 950new ContentLengthWriteStream(this, request.Content.Headers.ContentLength.GetValueOrDefault());
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (1)
657else if (request.Content != null && request.Content.Headers.ContentLength == null)
System.Net.Http.Json (1)
System\Net\Http\Json\HttpClientJsonExtensions.cs (1)
123if (response.Content.Headers.ContentLength is long contentLength && contentLength > contentLengthLimit)
System.Net.Http.WinHttpHandler (4)
System\Net\Http\WinHttpHandler.cs (3)
671if (requestContent.Headers.ContentLength.HasValue) 751if (requestMessage.Content.Headers.ContentLength.HasValue) 753long contentLength = requestMessage.Content.Headers.ContentLength.Value;
System\Net\Http\WinHttpResponseParser.cs (1)
71state.ExpectedBytesToRead = response.Content.Headers.ContentLength;
System.Net.Requests (1)
System\Net\HttpWebResponse.cs (1)
86return _httpResponseMessage.Content?.Headers.ContentLength ?? -1;
System.ServiceModel.Http (5)
System\ServiceModel\Channels\HttpResponseMessageHelper.cs (5)
137_contentLength = content.Headers.ContentLength.HasValue ? content.Headers.ContentLength.Value : -1; 179if (!content.Headers.ContentLength.HasValue) 315_contentLength = content.Headers.ContentLength.HasValue ? content.Headers.ContentLength.Value : -1;