BosMon Webserver first Running Version
This commit is contained in:
parent
bc959288f7
commit
621794f0b3
@ -5,6 +5,7 @@ using System.Net;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
using BlubbFish.Utils;
|
||||||
|
|
||||||
namespace BlubbFish.BosMon.Webserver {
|
namespace BlubbFish.BosMon.Webserver {
|
||||||
internal class XMLWebserver {
|
internal class XMLWebserver {
|
||||||
@ -25,26 +26,25 @@ namespace BlubbFish.BosMon.Webserver {
|
|||||||
try {
|
try {
|
||||||
while (this._listener.IsListening) {
|
while (this._listener.IsListening) {
|
||||||
ThreadPool.QueueUserWorkItem((c) => {
|
ThreadPool.QueueUserWorkItem((c) => {
|
||||||
|
try {
|
||||||
HttpListenerContext ctx = c as HttpListenerContext;
|
HttpListenerContext ctx = c as HttpListenerContext;
|
||||||
if (ctx.Request.RawUrl == "/telegramin/" + this.config["upload_path"] + "/input.xml") {
|
if (ctx.Request.RawUrl == "/telegramin/" + this.config["upload_path"] + "/input.xml") {
|
||||||
try {
|
|
||||||
this.ParseInput(ctx);
|
this.ParseInput(ctx);
|
||||||
} catch { } finally { ctx.Response.OutputStream.Close(); }
|
|
||||||
} else if (ctx.Request.RawUrl == "/telegramio/" + this.config["download_path"] + "/index.xml?loop=true") {
|
} else if (ctx.Request.RawUrl == "/telegramio/" + this.config["download_path"] + "/index.xml?loop=true") {
|
||||||
try {
|
|
||||||
this.SendResponse(ctx);
|
this.SendResponse(ctx);
|
||||||
} catch { } finally {
|
|
||||||
Console.WriteLine("Output Connection Closed!");
|
|
||||||
ctx.Response.OutputStream.Close();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
ctx.Response.StatusCode = 404;
|
ctx.Response.StatusCode = 404;
|
||||||
|
}
|
||||||
ctx.Response.OutputStream.Close();
|
ctx.Response.OutputStream.Close();
|
||||||
ctx.Response.Close();
|
ctx.Response.Close();
|
||||||
|
} catch(Exception e) {
|
||||||
|
Helper.WriteError("Context Exception: " + e.Message +""+e.Source+ "\n\n" + e.StackTrace);
|
||||||
}
|
}
|
||||||
}, this._listener.GetContext());
|
}, 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;
|
request.Response.StatusCode = 200;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
request.Response.StatusCode = 403;
|
request.Response.StatusCode = 403;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -3,7 +3,7 @@ Version: x.x-x
|
|||||||
Section: base
|
Section: base
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: any
|
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>
|
Maintainer: BlubbFish <dev@blubbfish.net>
|
||||||
Description: Bosmon-Webserver
|
Description: Bosmon-Webserver
|
||||||
A Webserver for Bosmon Telegrafs
|
A Webserver for Bosmon Telegrafs
|
||||||
|
Loading…
Reference in New Issue
Block a user