@@ -14,7 +14,6 @@ REQUEST_NOTIFICATION_STATUS CNodeHttpModule::OnSendResponse(IN IHttpContext* pHt
14
14
if (NULL != ctx && ctx->GetIsUpgrade () && !ctx->GetOpaqueFlagSet ())
15
15
{
16
16
// Set opaque mode in HTTP.SYS to enable exchanging raw bytes.
17
-
18
17
19
18
pProvider->SetFlags (flags | HTTP_SEND_RESPONSE_FLAG_OPAQUE);
20
19
ctx->SetOpaqueFlag ();
@@ -37,25 +36,64 @@ REQUEST_NOTIFICATION_STATUS CNodeHttpModule::OnExecuteRequestHandler(
37
36
this ->applicationManager ->GetEventProvider ()->Log (L" iisnode received a new http request" , WINEVENT_LEVEL_INFO);
38
37
39
38
CheckError (this ->applicationManager ->Dispatch (pHttpContext, pProvider, &ctx));
39
+ this ->applicationManager ->GetEventProvider ()->Log (L" iisnode dispatched new http request" , WINEVENT_LEVEL_INFO, ctx->GetActivityId ());
40
40
ASYNC_CONTEXT* async = ctx->GetAsyncContext ();
41
41
async->RunSynchronousContinuations ();
42
42
43
+ REQUEST_NOTIFICATION_STATUS result;
43
44
if (0 == ctx->DecreasePendingAsyncOperationCount ()) // decreases ref count set to 1 in the ctor of CNodeHttpStoredContext
44
45
{
45
- return ctx->GetRequestNotificationStatus ();
46
+ result = ctx->GetRequestNotificationStatus ();
46
47
}
47
48
else
48
49
{
49
- return RQ_NOTIFICATION_PENDING;
50
+ result = RQ_NOTIFICATION_PENDING;
50
51
}
51
52
53
+ switch (result)
54
+ {
55
+ default :
56
+ this ->applicationManager ->GetEventProvider ()->Log (
57
+ L" iisnode leaves CNodeHttpModule::OnExecuteRequestHandler" ,
58
+ WINEVENT_LEVEL_VERBOSE,
59
+ ctx->GetActivityId ());
60
+ break ;
61
+ case RQ_NOTIFICATION_CONTINUE:
62
+ this ->applicationManager ->GetEventProvider ()->Log (
63
+ L" iisnode leaves CNodeHttpModule::OnExecuteRequestHandler with RQ_NOTIFICATION_CONTINUE" ,
64
+ WINEVENT_LEVEL_VERBOSE,
65
+ ctx->GetActivityId ());
66
+ break ;
67
+ case RQ_NOTIFICATION_FINISH_REQUEST:
68
+ this ->applicationManager ->GetEventProvider ()->Log (
69
+ L" iisnode leaves CNodeHttpModule::OnExecuteRequestHandler with RQ_NOTIFICATION_FINISH_REQUEST" ,
70
+ WINEVENT_LEVEL_VERBOSE,
71
+ ctx->GetActivityId ());
72
+ break ;
73
+ case RQ_NOTIFICATION_PENDING:
74
+ this ->applicationManager ->GetEventProvider ()->Log (
75
+ L" iisnode leaves CNodeHttpModule::OnExecuteRequestHandler with RQ_NOTIFICATION_PENDING" ,
76
+ WINEVENT_LEVEL_VERBOSE,
77
+ ctx->GetActivityId ());
78
+ break ;
79
+ };
80
+
81
+ return result;
82
+
52
83
Error:
53
84
54
85
CNodeEventProvider* log = this ->applicationManager ->GetEventProvider ();
55
86
56
87
if (log )
57
88
{
58
- log ->Log (L" iisnode failed to process a new http request" , WINEVENT_LEVEL_INFO);
89
+ if (ctx)
90
+ {
91
+ log ->Log (L" iisnode failed to process a new http request" , WINEVENT_LEVEL_INFO, ctx->GetActivityId ());
92
+ }
93
+ else
94
+ {
95
+ log ->Log (L" iisnode failed to process a new http request" , WINEVENT_LEVEL_INFO);
96
+ }
59
97
}
60
98
61
99
if (ERROR_NOT_ENOUGH_QUOTA == hr)
@@ -181,22 +219,39 @@ REQUEST_NOTIFICATION_STATUS CNodeHttpModule::OnAsyncCompletion(
181
219
async->RunSynchronousContinuations ();
182
220
}
183
221
184
- if (0 == ctx->DecreasePendingAsyncOperationCount ()) // decreases ref count increased on entering OnAsyncCompletion
222
+ ctx->DecreasePendingAsyncOperationCount ();
223
+
224
+ REQUEST_NOTIFICATION_STATUS result = ctx->GetRequestNotificationStatus ();
225
+
226
+ switch (result)
185
227
{
228
+ default :
186
229
this ->applicationManager ->GetEventProvider ()->Log (
187
- L" iisnode leaves CNodeHttpModule::OnAsyncCompletion and completes the request " ,
230
+ L" iisnode leaves CNodeHttpModule::OnAsyncCompletion" ,
188
231
WINEVENT_LEVEL_VERBOSE,
189
232
ctx->GetActivityId ());
190
- return ctx->GetRequestNotificationStatus ();
191
- }
192
- else
193
- {
233
+ break ;
234
+ case RQ_NOTIFICATION_CONTINUE:
194
235
this ->applicationManager ->GetEventProvider ()->Log (
195
- L" iisnode leaves CNodeHttpModule::OnAsyncCompletion and continues the request " ,
236
+ L" iisnode leaves CNodeHttpModule::OnAsyncCompletion with RQ_NOTIFICATION_CONTINUE " ,
196
237
WINEVENT_LEVEL_VERBOSE,
197
238
ctx->GetActivityId ());
198
- return RQ_NOTIFICATION_PENDING;
199
- }
239
+ break ;
240
+ case RQ_NOTIFICATION_FINISH_REQUEST:
241
+ this ->applicationManager ->GetEventProvider ()->Log (
242
+ L" iisnode leaves CNodeHttpModule::OnAsyncCompletion with RQ_NOTIFICATION_FINISH_REQUEST" ,
243
+ WINEVENT_LEVEL_VERBOSE,
244
+ ctx->GetActivityId ());
245
+ break ;
246
+ case RQ_NOTIFICATION_PENDING:
247
+ this ->applicationManager ->GetEventProvider ()->Log (
248
+ L" iisnode leaves CNodeHttpModule::OnAsyncCompletion with RQ_NOTIFICATION_PENDING" ,
249
+ WINEVENT_LEVEL_VERBOSE,
250
+ ctx->GetActivityId ());
251
+ break ;
252
+ };
253
+
254
+ return result;
200
255
}
201
256
202
257
return RQ_NOTIFICATION_CONTINUE;
0 commit comments