Changeset 332 for binary-improvements/MapRendering/Web/Handlers
- Timestamp:
- Nov 16, 2018, 10:38:46 PM (6 years ago)
- Location:
- binary-improvements/MapRendering/Web/Handlers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/Handlers/ApiHandler.cs
r326 r332 4 4 using System.Reflection; 5 5 using AllocsFixes.NetConnections.Servers.Web.API; 6 using UnityEngine.Profiling; 6 7 7 8 namespace AllocsFixes.NetConnections.Servers.Web.Handlers { … … 40 41 } 41 42 43 #if ENABLE_PROFILER 44 private static readonly CustomSampler apiHandlerSampler = CustomSampler.Create ("API_Handler"); 45 #endif 46 42 47 public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, 43 48 int permissionLevel) { … … 55 60 if (apis.TryGetValue (apiName, out api)) { 56 61 try { 62 #if ENABLE_PROFILER 63 apiHandlerSampler.Begin (); 64 #endif 57 65 api.HandleRequest (req, resp, user, permissionLevel); 66 #if ENABLE_PROFILER 67 apiHandlerSampler.End (); 68 #endif 58 69 return; 59 70 } catch (Exception e) { -
binary-improvements/MapRendering/Web/Handlers/StaticHandler.cs
r325 r332 13 13 string moduleName = null) : base (moduleName) { 14 14 this.staticPart = staticPart; 15 datapath = filePath ;15 datapath = filePath + (filePath [filePath.Length - 1] == '/' ? "" : "/"); 16 16 this.cache = cache; 17 17 this.logMissingFiles = logMissingFiles; … … 22 22 string fn = req.Url.AbsolutePath.Remove (0, staticPart.Length); 23 23 24 byte[] content = cache.GetFileContent (datapath + "/" +fn);24 byte[] content = cache.GetFileContent (datapath + fn); 25 25 26 26 if (content != null) { … … 31 31 resp.StatusCode = (int) HttpStatusCode.NotFound; 32 32 if (logMissingFiles) { 33 Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + "/" + 34 req.Url.AbsolutePath.Remove (0, staticPart.Length) + "\""); 33 Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + fn + "\""); 35 34 } 36 35 } -
binary-improvements/MapRendering/Web/Handlers/UserStatusHandler.cs
r325 r332 19 19 JSONObject permObj = new JSONObject (); 20 20 permObj.Add ("module", new JSONString (perm.module)); 21 permObj.Add ("allowed", 22 new JSONBoolean (WebPermissions.Instance.ModuleAllowedWithLevel (perm.module, permissionLevel))); 21 permObj.Add ("allowed", new JSONBoolean (perm.permissionLevel >= permissionLevel)); 23 22 perms.Add (permObj); 24 23 }
Note:
See TracChangeset
for help on using the changeset viewer.