Changeset 351 for binary-improvements/MapRendering/Web/Web.cs
- Timestamp:
- Jan 19, 2019, 6:12:21 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/Web.cs
r332 r351 27 27 public Web () { 28 28 try { 29 int webPort = GamePrefs.GetInt (Enum GamePrefs.ControlPanelPort);29 int webPort = GamePrefs.GetInt (EnumUtils.Parse<EnumGamePrefs> ("ControlPanelPort")); 30 30 if (webPort < 1 || webPort > 65533) { 31 31 Log.Out ("Webserver not started (ControlPanelPort not within 1-65533)"); … … 132 132 } 133 133 134 public void SendLine (string line) {135 connectionHandler.SendLine ( line);136 } 137 138 public void SendLog (string text, string trace, LogTypetype) {134 public void SendLine (string _line) { 135 connectionHandler.SendLine (_line); 136 } 137 138 public void SendLog (string _text, string _trace, LogType _type) { 139 139 // Do nothing, handled by LogBuffer internally 140 140 } 141 141 142 public static bool isSslRedirected (HttpListenerRequest req) {143 string proto = req.Headers ["X-Forwarded-Proto"];142 public static bool isSslRedirected (HttpListenerRequest _req) { 143 string proto = _req.Headers ["X-Forwarded-Proto"]; 144 144 if (!string.IsNullOrEmpty (proto)) { 145 145 return proto.Equals ("https", StringComparison.OrdinalIgnoreCase); … … 156 156 #endif 157 157 158 private void HandleRequest (IAsyncResult result) {158 private void HandleRequest (IAsyncResult _result) { 159 159 if (!_listener.IsListening) { 160 160 return; … … 167 167 #if ENABLE_PROFILER 168 168 Profiler.BeginThreadProfiling ("AllocsMods", "WebRequest"); 169 HttpListenerContext ctx = _listener.EndGetContext ( result);169 HttpListenerContext ctx = _listener.EndGetContext (_result); 170 170 try { 171 171 #else … … 314 314 } 315 315 316 public static void SetResponseTextContent (HttpListenerResponse resp, stringtext) {317 byte[] buf = Encoding.UTF8.GetBytes ( text);318 resp.ContentLength64 = buf.Length;319 resp.ContentType = "text/html";320 resp.ContentEncoding = Encoding.UTF8;321 resp.OutputStream.Write (buf, 0, buf.Length);316 public static void SetResponseTextContent (HttpListenerResponse _resp, string _text) { 317 byte[] buf = Encoding.UTF8.GetBytes (_text); 318 _resp.ContentLength64 = buf.Length; 319 _resp.ContentType = "text/html"; 320 _resp.ContentEncoding = Encoding.UTF8; 321 _resp.OutputStream.Write (buf, 0, buf.Length); 322 322 } 323 323 }
Note:
See TracChangeset
for help on using the changeset viewer.