在重写的HttpApplication.Init()
方法中,我订阅了2个事件,如下所示:
public override void Init()
{
base.Init();
BeginRequest += AnUsefulClass.OnBeginRequest;
PreSendRequestHeaders += AnUsefulClass.OnPreSendRequestHeaders;
}
所以我想要添加一些ad-hoc标头。问题是,例如,30个传入请求中的 one 响应甚至成功处理(根据IIS日志和日志)
这些事件处理程序内部没有任何令人兴奋的逻辑(当然,之前有过):
public static void OnBeginRequest(object sender, EventArgs e)
{
//lock (Lock)
{
try
{
var app = sender as HttpApplication;
if (app == null) return;
// the logic was here
}
catch { }
}
}
public static void OnPreSendRequestHeaders(object sender, EventArgs e)
{
//lock (Lock)
{
try
{
var app = sender as HttpApplication;
if (app == null) return;
var context = app.Context;
var response = context.Response;
// the logic was here
}
catch { }
}
}
我一直在努力应用IHttpModule
的自定义实现,但结果相同。
IIS失败请求跟踪生成具有以下尾部的报告:
=====================================================================================================================
167. GENERAL_FLUSH_RESPONSE_END BytesSent="782", ErrorCode="The operation completed successfully. (0x0)" 08:30:26.936
=====================================================================================================================
168. AspNetHttpHandlerLeave 08:30:26.936
=====================================================================================================================
然而仅此而已。此外,我确实没有看到可疑的话。对我来说,等待响应需要永远。昨天的人还在回家的路上:)
任何帮助表示感谢。