From 53c9ce46b3cdb9a4bb1cbb5d91641bbacf70866c Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Mon, 16 Jun 2008 22:06:55 +0000 Subject: * Enables binary data in BaseHttpServer with 'image' in content type. * Enables regular jpeg map images to be served directly from the region. * EX: http://192.168.1.127:9000/index.php?method=regionImagecc4583cd269b41bfa525dd198e19a5c5 * This is actually HTTP server address + port + index.php?method=regionImage * The Webmap image location gets printed on the console when the simulator starts up. * JPEG data is cached so we only create the webjpeg once. --- OpenSim/Framework/Servers/BaseHttpServer.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Servers') diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index a69cb63..22698d0 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -641,8 +641,17 @@ namespace OpenSim.Framework.Servers } response.AddHeader("Content-type", contentType); + + byte[] buffer; - byte[] buffer = Encoding.UTF8.GetBytes(responseString); + if (!contentType.Contains("image")) + { + buffer = Encoding.UTF8.GetBytes(responseString); + } + else + { + buffer = Convert.FromBase64String(responseString); + } response.SendChunked = false; response.ContentLength64 = buffer.Length; -- cgit v1.1