replace external httpserver by embedded one (based on same code) - This may still be very bad; clean solution and runprebuild, or clone to clan folder

This commit is contained in:
UbitUmarov
2020-04-02 21:44:34 +01:00
parent 650b051cdf
commit 67cd5efab3
54 changed files with 5669 additions and 1630 deletions

View File

@@ -30,7 +30,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using HttpServer;
using OSHttpServer;
using log4net;
using OpenMetaverse;
@@ -130,8 +130,16 @@ namespace OpenSim.Framework.Servers.HttpServer
return;
}
if (responsedata.ContainsKey("error_status_text"))
response.StatusDescription = (string)responsedata["error_status_text"];
response.StatusCode = responsecode;
if (responsecode == (int)OSHttpStatusCode.RedirectMovedPermanently)
{
response.AddHeader("Location:", (string)responsedata["str_redirect_location"]);
response.KeepAlive = false;
PollServiceArgs.RequestsHandled++;
response.Send();
return;
}
if (responsedata.ContainsKey("http_protocol_version"))
response.ProtocolVersion = (string)responsedata["http_protocol_version"];
@@ -142,17 +150,13 @@ namespace OpenSim.Framework.Servers.HttpServer
if (responsedata.ContainsKey("prio"))
response.Priority = (int)responsedata["prio"];
if (responsedata.ContainsKey("error_status_text"))
response.StatusDescription = (string)responsedata["error_status_text"];
// Cross-Origin Resource Sharing with simple requests
if (responsedata.ContainsKey("access_control_allow_origin"))
response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]);
response.StatusCode = responsecode;
if (responsecode == (int)OSHttpStatusCode.RedirectMovedPermanently)
{
response.RedirectLocation = (string)responsedata["str_redirect_location"];
}
if (string.IsNullOrEmpty(contentType))
response.AddHeader("Content-Type", "text/html");
else