Click or drag to resize

EngineAsyncTHierarchyItemAsyncCalculateContentLength Property

IT Hit WebDAV Classes Reference
Indicates if response content length is calculated. Default is true.

Namespace:  ITHit.Server
Assembly:  ITHit.Server (in ITHit.Server.dll) Version: 13.3.13068
Syntax
public bool CalculateContentLength { get; set; }

Property Value

Type: Boolean
Boolean value indicating if content length will be calculated in RunAsync(ContextAsyncTHierarchyItemAsync) method. Default is true.
Remarks

If this property is set to true engine will calculate output content length and set ContentLength property before returning from RunAsync(ContextAsyncTHierarchyItemAsync) method. If you would like to send chunked responses you must set this property to false.

ASP.NET will send chunked responses only to GET verb if HttpContext.Current.Response.BufferOutput = false and request is HTTP 1.1. Responses to all other verbs will not be chunked.

To send chunked responses from HttpListener you must set this property to false and set HttpListenerContext.Response.SendChunked = true. If SendChunked=false and CalculateContentLength=false than HttpListener will not send any response because the content length will be unknown.

Responses must not include both Content-Length header and Transfer-Encoding: chunked header. If server is sending chunked response client application will not be able to detect content length. Downloading a large file using download manager client will not be able to see the entire content length and evaluate time required for download.

See Also