Skip to content

PreSendRequestHeaders and PreSendRequestContent should be fired when content is being sent #514

@twsouthwick

Description

@twsouthwick

If buffering is disabled and something is written. The framework HttpApplication will short circuit the request pipeline and jump to RequestNotification.SendReponse and raise PreSendRequestHeaders and PreSendRequestContent events.
In comparison systemweb-adapter will skip all the next stages and send the response.

HttpReponse.Flush() will expliexplicitly set RequestNotification = SendReponse. The StepManager will execute it. Following is the callstack.

>	System.Web.dll!System.Web.HttpContext.CurrentNotification.set(System.Web.RequestNotification **value = SendResponse**) Line 993	C#
 	System.Web.dll!System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest wr, System.Web.HttpContext context) Line 1374	C#
 	System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) Line 461	C#
 	System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) Line 386	C#
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	System.Web.dll!System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush() Line 1729	C#
 	System.Web.dll!System.Web.HttpResponse.Flush(bool finalFlush, bool async) Line 1238	C#
 	System.Web.dll!System.Web.HttpWriter.WriteFromStream(byte[] data, int offset, int size) Line 341	C#

Originally posted by @TaoziZ03 in #509 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍Label added to new issues which need Triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions