Ignore:
Timestamp:
Aug 8, 2022, 8:07:44 PM (2 years ago)
Author:
alloc
Message:

SessionHandler cleanup + redirect to /app/error/:code
Some profiler usage cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements2/WebServer/src/WebUtils.cs

    r391 r394  
    1212                public const string MimeJson = "application/json";
    1313               
    14 #if ENABLE_PROFILER
    1514                private static readonly UnityEngine.Profiling.CustomSampler jsonSerializeSampler = UnityEngine.Profiling.CustomSampler.Create ("JSON_Serialize");
    1615                private static readonly UnityEngine.Profiling.CustomSampler netWriteSampler = UnityEngine.Profiling.CustomSampler.Create ("JSON_Write");
    17 #endif
    1816
    1917                public static void WriteJson (HttpListenerResponse _resp, JsonNode _root, HttpStatusCode _statusCode = HttpStatusCode.OK) {
    20 #if ENABLE_PROFILER
    2118                        jsonSerializeSampler.Begin ();
    22 #endif
    2319                        StringBuilder sb = new StringBuilder ();
    2420                        _root.ToString (sb);
    25 #if ENABLE_PROFILER
    2621                        jsonSerializeSampler.End ();
    2722                        netWriteSampler.Begin ();
    28 #endif
    2923                        WriteText (_resp, sb.ToString(), _statusCode, MimeJson);
    30 #if ENABLE_PROFILER
    3124                        netWriteSampler.End ();
    32 #endif
    3325                }
    3426
Note: See TracChangeset for help on using the changeset viewer.