internal void OnResponseError(EventResponseErrorArgs e) { if (HttpServer.EnableLog(BeetleX.EventArgs.LogType.Warring)) { HttpServer.Log(BeetleX.EventArgs.LogType.Warring, $"Gateway {e.Request.ID} {e.Request.RemoteIPAddress} {e.Request.Method} {e.Request.Url} error {e.Message}"); } if (Pluginer.RequestedEnabled) { EventRequestCompletedArgs se = new EventRequestCompletedArgs( null, e.Request, e.Response, this, e.ErrorCode, null, 1, e.Request.ID, e.Message ); Pluginer.Requested(se); } IncrementRequestCompleted(e.Request, e.ErrorCode, 1, null); this.Pluginer.ResponseError(e); if (e.Result != null) { e.Response.Result(e.Result); } }
internal void OnRequestCompleted(Servers.RequestAgent success) { IncrementRequestCompleted(success.Request, success.Code, success.Time, success.Server); if (Pluginer.RequestedEnabled) { Pluginer.Requested(success.GetEventRequestCompletedArgs()); } }
internal void OnRequestCompleted(Servers.RequestAgent success) { HttpServer.RequestExecuted(); if ((success.Code >= 200 && success.Code < 300) || (success.Code >= 500 && success.Code < 600)) { var stats = Routes.GetUrlStatistics(success.Request.BaseUrl); stats.Add(success.Code, success.Time, success.Server); } else { if (Routes.UrlStatisticsCount < this.MaxStatsUrls) { var stats = Routes.GetUrlStatistics(success.Request.BaseUrl); stats.Add(success.Code, success.Time, success.Server); } } Statistics.Add(success.Code, success.Time); Pluginer.Requested(success); }
internal void OnRequestCompleted(Servers.RequestAgent success) { try { ServerHttpRequested.Invoke(this, success); } catch (Exception e_) { if (HttpServer.EnableLog(BeetleX.EventArgs.LogType.Warring)) { HttpServer.Log(BeetleX.EventArgs.LogType.Warring, $"Gateway {success.Request.ID} {success.Request.RemoteIPAddress} {success.Request.Method} {success.Request.Url} error {e_.Message}@{e_.StackTrace}"); } } RequestIncrementCompleted(success.Request, success.Code, success.Time, success.Server); if (Pluginer.RequestedEnabled) { Pluginer.Requested(success.GetEventRequestCompletedArgs()); } }
internal void OnRequestCompleted(Servers.RequestAgent success) { HttpServer.RequestExecuted(); Pluginer.Requested(success); }