BosMon Webserver first Running Version

This commit is contained in:
BlubbFish 2018-11-27 15:14:36 +00:00
parent bc959288f7
commit 621794f0b3
4 changed files with 14 additions and 13 deletions

View File

@ -5,6 +5,7 @@ using System.Net;
using System.Text;
using System.Threading;
using System.Web;
using BlubbFish.Utils;
namespace BlubbFish.BosMon.Webserver {
internal class XMLWebserver {
@ -25,26 +26,25 @@ namespace BlubbFish.BosMon.Webserver {
try {
while (this._listener.IsListening) {
ThreadPool.QueueUserWorkItem((c) => {
try {
HttpListenerContext ctx = c as HttpListenerContext;
if (ctx.Request.RawUrl == "/telegramin/" + this.config["upload_path"] + "/input.xml") {
try {
this.ParseInput(ctx);
} catch { } finally { ctx.Response.OutputStream.Close(); }
} else if(ctx.Request.RawUrl == "/telegramio/" + this.config["download_path"] + "/index.xml?loop=true") {
try {
} else if (ctx.Request.RawUrl == "/telegramio/" + this.config["download_path"] + "/index.xml?loop=true") {
this.SendResponse(ctx);
} catch { } finally {
Console.WriteLine("Output Connection Closed!");
ctx.Response.OutputStream.Close();
}
} else {
ctx.Response.StatusCode = 404;
}
ctx.Response.OutputStream.Close();
ctx.Response.Close();
} catch(Exception e) {
Helper.WriteError("Context Exception: " + e.Message +""+e.Source+ "\n\n" + e.StackTrace);
}
}, this._listener.GetContext());
}
} catch { };
} catch(Exception e) {
Helper.WriteError("Webserver Exception: " + e.Message);
};
});
}
@ -106,6 +106,7 @@ namespace BlubbFish.BosMon.Webserver {
}
}
request.Response.StatusCode = 200;
return;
}
request.Response.StatusCode = 403;
}

View File

@ -3,7 +3,7 @@ Version: x.x-x
Section: base
Priority: optional
Architecture: any
Depends: mono-runtime (>= 5.16.0)
Depends: mono-runtime (>= 5.16.0), libmono-system-web4.0-cil (>= 5.16.0)
Maintainer: BlubbFish <dev@blubbfish.net>
Description: Bosmon-Webserver
A Webserver for Bosmon Telegrafs