public virtual void PrepareHeader(HttpListenerContext context, PreparedData callData) { var response = context.Response; response.StatusCode = (int)HttpStatusCode.OK; response.ContentLength64 = callData.Length; response.ContentEncoding = Encoding ?? Encoding.UTF8; response.ContentType = MimeType ?? "text/html"; }
public override void GenerateSite(HttpListenerContext context, PreparedData callData) { ContentSite contentData = (ContentSite)callData.Context; // write first part context.Response.OutputStream.Write(contentData.OwnContent, 0, lengthA); // write the inner data contentData.Site.GenerateSite(context, contentData.PreparedData); // write outer part context.Response.OutputStream.Write(contentData.OwnContent, startB, lengthB); }
public sealed override void GenerateSite(HttpListenerContext context, PreparedData callData) { response.Add(context.Response); InvokeEvent(); }
public sealed override void PrepareHeader(HttpListenerContext context, PreparedData callData) { base.PrepareHeader(context, callData); context.Response.KeepAlive = true; }
public ContentSite(byte[] fetchBlock, WebSite site, PreparedData data) { OwnContent = fetchBlock; Site = site; PreparedData = data; }
public virtual void GenerateSite(HttpListenerContext context, PreparedData callData) { byte[] prepData = (byte[])callData.Context; context.Response.OutputStream.Write(prepData, 0, prepData.Length); }