private static void HttpLogs(ref Socket remoteSocket) { string response = ""; byte[] logs = Logger.ReadMassiveLogs(); string start = "<HTML><BODY>Logs massive information:<br><hr>"; string end = "</BODY></HTML>"; response += "HTTP/1.1 200 OK\r\n"; response += "Version: HTTP/1.1\r\n"; response += "Content-Type: text/html; charset=utf-8\r\n"; response += "Content-Length: " + (start.Length + end.Length + logs.Length); response += "\r\n\r\n"; response += start; byte[] answerstart = Encoding.ASCII.GetBytes(response); byte[] answerend = Encoding.ASCII.GetBytes(end); byte[] requestbyte = new byte[logs.Length + answerstart.Length + answerend.Length]; answerstart.CopyTo(requestbyte, 0); logs.CopyTo(requestbyte, answerstart.Length); answerend.CopyTo(requestbyte, answerstart.Length + logs.Length); remoteSocket.Send(requestbyte); GC.Collect(); Logger.WriteLog("HTTP Response 127.0.0.1:8000/LogInfo/", LogLevel.Usual); }
public void ReadMassiveLogs() { Database.Initialization(true); byte[] logs = Logger.ReadMassiveLogs(); Assert.AreNotEqual(logs, null); }