public async Task ConnectionAvailable(ConnectionHandler handler) { currentConnection = handler; Log.Trace("Creating new http context"); var http = new Http(currentConnection); Log.Trace("Start http processing"); using (new Stopper(x => Log.Trace($"HTTP processing time: {x.ElapsedMilliseconds}ms"))) { await http.Process(); } Log.Trace("End http processing"); }
public async Task HandleRequest(Http httpContext) { Log.Debug($"Resolving routing for {httpContext.Request.URL}"); var routing = RouteHelper.Resolve(httpContext); if (routing == null) { Log.Error($"Routing not found for {httpContext.Request.URL}"); await httpContext.Response.WriteFailHeader(HttpStatusCode.NotFound); return; } Log.Info($"Routing found for {httpContext.Request.URL}: {routing.Routing}"); httpContext.Request.Routing = routing; await routing.Run(httpContext); }
public async Task HandleRequest(Http httpContext) { await httpContext.Response.WriteSuccessHeader(); }