public bool Commit(Action continuation)
        {
            while (queue.HasEvents)
            {
                var e = queue.Dequeue();

                switch (e.Type)
                {
                case ParserEventType.RequestHeaders:
                    transactionDelegate.OnRequest(new HttpRequestHead()
                    {
                        Method      = e.Request.Method,
                        Uri         = e.Request.Uri,
                        Path        = e.Request.Path,
                        Fragment    = e.Request.Fragment,
                        QueryString = e.Request.QueryString,
                        Version     = e.Request.Version,
                        Headers     = e.Request.Headers
                    }, e.KeepAlive);
                    break;

                case ParserEventType.RequestBody:
                    if (!queue.HasEvents)
                    {
                        return(transactionDelegate.OnRequestData(e.Data, continuation));
                    }

                    transactionDelegate.OnRequestData(e.Data, null);
                    break;

                case ParserEventType.RequestEnded:
                    transactionDelegate.OnRequestEnd();
                    break;
                }
            }
            return(false);
        }
예제 #2
0
 public void OnRequestEnd()
 {
     _realDelegate.OnRequestEnd();
 }
예제 #3
0
 public void OnRequestEnd()
 {
     del.OnRequestEnd(tx);
 }