/// <summary> /// Sets up the environment. This is only run when the server starts up, not /// for each request, so as much as possible should be done here. Returns a /// HttpHandler capable of serving Rack requests. /// </summary> public IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated) { if (_Handler == null) { var rack = new RackDispatcher(context); if (rack._failed) return null; _Handler = new AspNetHandler(rack); } return _Handler; }
/// <summary> /// Sets up the environment. This is only run when the server starts up, not /// for each request, so as much as possible should be done here. Returns a /// HttpHandler capable of serving Rack requests. /// </summary> public IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated) { if (_Handler == null) { var rack = new RackDispatcher(context); if (rack._failed) { return(null); } _Handler = new AspNetHandler(rack); } return(_Handler); }
public void Init(HttpApplication app) { app.BeginRequest += (sender, args) => { var httpApp = (sender as HttpApplication); if (_rack == null) { lock (this) { if (_rack == null) { _rack = new RackDispatcher(httpApp.Context); } } } _rack.ProcessRequest(httpApp.Context); httpApp.CompleteRequest(); }; }
public void Dispose() { _rack = null; }
public AspNetHandler(RackDispatcher rack) { _rack = rack; }