Esempio n. 1
0
        void reqReader_HTTPRequestCaptured(object sender, HTTPReaderEventArgs e)
        {
            TCPStreamMonitorStack tsStack = GetStackForMonitor((NetworkStreamMonitor)sender);

            if (tsStack == null)
            {
                InvokeExceptionThrown(new InvalidOperationException("HTTP monitor captured a HTTP response from a stack which was already destroyed."));
                return;
            }

            HTTPConversation hcConversation = dictConversations[tsStack];

            hcConversation.AddRequest((HTTPRequest)e.HTTPMessage);

            if (dictResponses[tsStack].Count > 0)
            {
                HTTPRequest htqr = GetNextRequest(hcConversation);

                if (htqr != null)
                {
                    htqr.Response = dictResponses[tsStack].Dequeue();
                }
            }

            InvokeExternalAsync(HTTPSessionInformationChanged, new HTTPMonitorEventArgs(hcConversation));
        }
Esempio n. 2
0
        void respReader_HTTPResponseCaptured(object sender, HTTPReaderEventArgs e)
        {
            TCPStreamMonitorStack tsStack = GetStackForMonitor((NetworkStreamMonitor)sender);

            if (tsStack == null)
            {
                InvokeExceptionThrown(new InvalidOperationException(this.Name + "captured a HTTP response from a stack which was already destroyed."));
                return;
            }
            HTTPConversation hcConversation = dictConversations[tsStack];

            HTTPRequest htqr = GetNextRequest(hcConversation);

            if (htqr == null)
            {
                //Request missing for response
                dictResponses[tsStack].Enqueue((HTTPResponse)e.HTTPMessage);
            }
            else
            {
                htqr.Response = (HTTPResponse)e.HTTPMessage;
            }

            InvokeExternalAsync(HTTPSessionInformationChanged, new HTTPMonitorEventArgs(hcConversation));
        }