From cacc02883526d6913be13d745215d7367708412e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 17 Nov 2011 21:03:08 +0000 Subject: If the entire simulator is shutting down then don't bother to unload the scripts from the appdomain in XEngine. All the other actions (script state save, etc.) still occur. This makes shutdown where there are many scripts vastly quicker. --- OpenSim/Region/Framework/Scenes/EventManager.cs | 26 +++++++++++++++---------- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 26 ++++++++++++++++++------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 4906665..4a4d98f 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -98,9 +98,10 @@ namespace OpenSim.Region.Framework.Scenes public event OnPluginConsoleDelegate OnPluginConsole; - public delegate void OnShutdownDelegate(); - - public event OnShutdownDelegate OnShutdown; + /// + /// Triggered when the entire simulator is shutdown. + /// + public event Action OnShutdown; public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); public delegate void ScriptResetDelegate(uint localID, UUID itemID); @@ -113,9 +114,14 @@ namespace OpenSim.Region.Framework.Scenes public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; - public delegate void SceneShuttingDownDelegate(Scene scene); - - public event SceneShuttingDownDelegate OnSceneShuttingDown; + /// + /// Triggered when an individual scene is shutdown. + /// + /// + /// This does not automatically mean that the entire simulator is shutting down. Listen to OnShutdown for that + /// notification. + /// + public event Action OnSceneShuttingDown; /// /// Fired when an object is touched/grabbed. @@ -869,10 +875,10 @@ namespace OpenSim.Region.Framework.Scenes public void TriggerShutdown() { - OnShutdownDelegate handlerShutdown = OnShutdown; + Action handlerShutdown = OnShutdown; if (handlerShutdown != null) { - foreach (OnShutdownDelegate d in handlerShutdown.GetInvocationList()) + foreach (Action d in handlerShutdown.GetInvocationList()) { try { @@ -2212,10 +2218,10 @@ namespace OpenSim.Region.Framework.Scenes public void TriggerSceneShuttingDown(Scene s) { - SceneShuttingDownDelegate handler = OnSceneShuttingDown; + Action handler = OnSceneShuttingDown; if (handler != null) { - foreach (SceneShuttingDownDelegate d in handler.GetInvocationList()) + foreach (Action d in handler.GetInvocationList()) { try { diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 1c16c87..12e1a78 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -90,6 +90,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine private bool m_KillTimedOutScripts; private string m_ScriptEnginesPath = null; + /// + /// Is the entire simulator in the process of shutting down? + /// + private bool m_SimulatorShuttingDown; + private static List m_ScriptEngines = new List(); @@ -470,17 +475,22 @@ namespace OpenSim.Region.ScriptEngine.XEngine // instance.DestroyScriptInstance(); - // Unload scripts and app domains + // Unload scripts and app domains. // Must be done explicitly because they have infinite - // lifetime - // - m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); - if (m_DomainScripts[instance.AppDomain].Count == 0) + // lifetime. + // However, don't bother to do this if the simulator is shutting + // down since it takes a long time with many scripts. + if (!m_SimulatorShuttingDown) { - m_DomainScripts.Remove(instance.AppDomain); - UnloadAppDomain(instance.AppDomain); + m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); + if (m_DomainScripts[instance.AppDomain].Count == 0) + { + m_DomainScripts.Remove(instance.AppDomain); + UnloadAppDomain(instance.AppDomain); + } } } + m_Scripts.Clear(); m_PrimObjects.Clear(); m_Assemblies.Clear(); @@ -1428,6 +1438,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine public void OnShutdown() { + m_SimulatorShuttingDown = true; + List instances = new List(); lock (m_Scripts) -- cgit v1.1 From 352672eaf2d07a210d2d0de97944dac48250828d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 17 Nov 2011 22:13:32 +0000 Subject: Make "terrain save" more friendly by telling the user if we have saved and putting out a useful complaint message if we haven't for some reason --- .../CoreModules/World/Terrain/TerrainModule.cs | 50 ++++++++++++++-------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index c832520..428440e 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -86,6 +86,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain private volatile bool m_tainted; private readonly Stack m_undo = new Stack(5); + /// + /// Human readable list of terrain file extensions that are supported. + /// + private string m_supportedFileExtensions = ""; + #region ICommandableModule Members public ICommander CommandInterface @@ -135,6 +140,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain InstallDefaultEffects(); LoadPlugins(); + + // Generate user-readable extensions list + string supportedFilesSeparator = ""; + + foreach (KeyValuePair loader in m_loaders) + { + m_supportedFileExtensions += supportedFilesSeparator + loader.Key + " (" + loader.Value + ")"; + supportedFilesSeparator = ", "; + } } public void RegionLoaded(Scene scene) @@ -251,20 +265,20 @@ namespace OpenSim.Region.CoreModules.World.Terrain if (filename.EndsWith(loader.Key)) { loader.Value.SaveFile(filename, m_channel); + m_log.InfoFormat("[TERRAIN]: Saved terrain from {0} to {1}", m_scene.RegionInfo.RegionName, filename); return; } } } - catch (NotImplementedException) - { - m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); - throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); - } catch (IOException ioe) { m_log.Error(String.Format("[TERRAIN]: Unable to save to {0}, {1}", filename, ioe.Message)); throw new TerrainException(String.Format("Unable to save heightmap: {0}", ioe.Message)); } + + m_log.ErrorFormat( + "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}", + m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions); } /// @@ -345,6 +359,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain float duration = 0.25f; if (action == 0) duration = 4.0f; + client_OnModifyTerrain(user, (float)pos.Z, duration, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId); } @@ -534,6 +549,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain m_channel = channel; UpdateRevertMap(); } + return; } } @@ -566,10 +582,17 @@ namespace OpenSim.Region.CoreModules.World.Terrain fileWidth, fileHeight, (int)Constants.RegionSize, (int)Constants.RegionSize); + + m_log.InfoFormat("[TERRAIN]: Saved terrain from {0} to {1}", m_scene.RegionInfo.RegionName, filename); } + return; } } + + m_log.ErrorFormat( + "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}", + m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions); } } @@ -1124,32 +1147,23 @@ namespace OpenSim.Region.CoreModules.World.Terrain private void InstallInterfaces() { - // Load / Save - string supportedFileExtensions = ""; - string supportedFilesSeparator = ""; - foreach (KeyValuePair loader in m_loaders) - { - supportedFileExtensions += supportedFilesSeparator + loader.Key + " (" + loader.Value + ")"; - supportedFilesSeparator = ", "; - } - Command loadFromFileCommand = new Command("load", CommandIntentions.COMMAND_HAZARDOUS, InterfaceLoadFile, "Loads a terrain from a specified file."); loadFromFileCommand.AddArgument("filename", "The file you wish to load from, the file extension determines the loader to be used. Supported extensions include: " + - supportedFileExtensions, "String"); + m_supportedFileExtensions, "String"); Command saveToFileCommand = new Command("save", CommandIntentions.COMMAND_NON_HAZARDOUS, InterfaceSaveFile, "Saves the current heightmap to a specified file."); saveToFileCommand.AddArgument("filename", "The destination filename for your heightmap, the file extension determines the format to save in. Supported extensions include: " + - supportedFileExtensions, "String"); + m_supportedFileExtensions, "String"); Command loadFromTileCommand = new Command("load-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceLoadTileFile, "Loads a terrain from a section of a larger file."); loadFromTileCommand.AddArgument("filename", "The file you wish to load from, the file extension determines the loader to be used. Supported extensions include: " + - supportedFileExtensions, "String"); + m_supportedFileExtensions, "String"); loadFromTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer"); loadFromTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); loadFromTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", @@ -1161,7 +1175,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain new Command("save-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceSaveTileFile, "Saves the current heightmap to the larger file."); saveToTileCommand.AddArgument("filename", "The file you wish to save to, the file extension determines the loader to be used. Supported extensions include: " + - supportedFileExtensions, "String"); + m_supportedFileExtensions, "String"); saveToTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer"); saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", -- cgit v1.1 From 9c928e9dc63a03e652aa5614fc1053351aad0ed1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 17 Nov 2011 22:15:46 +0000 Subject: For TerrainModule.SaveToFile(), don't bother throwing the exception onwards after printing out the error, since this method is invoked by users. Still throwing the exception on the stream method since this invoked programatically --- OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 428440e..cf000a4 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -273,7 +273,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain catch (IOException ioe) { m_log.Error(String.Format("[TERRAIN]: Unable to save to {0}, {1}", filename, ioe.Message)); - throw new TerrainException(String.Format("Unable to save heightmap: {0}", ioe.Message)); } m_log.ErrorFormat( -- cgit v1.1 From 6dbe793112704c34f0595c39d443eb764ce19ba7 Mon Sep 17 00:00:00 2001 From: justincc Date: Thu, 17 Nov 2011 23:10:58 +0000 Subject: Fix Windows build break --- prebuild.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prebuild.xml b/prebuild.xml index 3b7198d..a7e3bde 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1770,6 +1770,7 @@ ../../../bin/ + @@ -2035,6 +2036,7 @@ ../../../bin/ + @@ -2393,6 +2395,7 @@ ../../../../bin/ + -- cgit v1.1 From 169387b390649aa250481445dd95b9079bf2e75b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 17 Nov 2011 23:53:25 +0000 Subject: Turn SellEnabled in the [EconomyModule] on by default. This only provides enough functionality to allow operations for no money (e.g. sell for $0). --- bin/OpenSim.ini.example | 16 +++++++--------- bin/OpenSimDefaults.ini | 15 +++++++++------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 253b24d..e31d0f4 100755 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -532,19 +532,17 @@ [Economy] - ;; The economy module is not enabled by default and there is no easy, - ;; menu controlled way to do this. To enabled this module, insert - ;; economymodule = BetaGridLikeMoneyModule - ;; into the startup section (at the top of this file). - ;; Then configure the options below as needed. + ; The default economy module only implements just enough to allow free actions (transfer of objects, etc). + ; There is no intention to implement anything further in core OpenSimulator. + ; This functionality has to be provided by third party modules. - ;; Enables selling things for $0 - ; SellEnabled = "false" + ;; Enables selling things for $0. Default is true. + ; SellEnabled = true - ;; Money Unit fee to upload textures, animations etc + ;; Money Unit fee to upload textures, animations etc. Default is 0. ; PriceUpload = 0 - ;; Money Unit fee to create groups + ;; Money Unit fee to create groups. Default is 0. ; PriceGroupCreate = 0 diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 2c5fbf5..e723330 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -1098,15 +1098,18 @@ [Economy] ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only - + ; The default economy module only implements just enough to allow free actions (transfer of objects, etc). + ; There is no intention to implement anything further in core OpenSimulator. + ; This functionality has to be provided by third party modules. - ; Enables selling things for $0 - SellEnabled = "false" + ;; Enables selling things for $0. Default is true. + SellEnabled = true - ; Money Unit fee to upload textures, animations etc - PriceUpload = 0 + ;; Money Unit fee to upload textures, animations etc. Default is 0. + PriceUpload = 0 - ; Money Unit fee to create groups - PriceGroupCreate = 0 + ;; Money Unit fee to create groups. Default is 0. + PriceGroupCreate = 0 ; We don't really know what the rest of these values do. These get sent to the client ; These taken from Agni at a Public Telehub. Change at your own risk. -- cgit v1.1 From 9d458fdd7fe98bded857baa65fb73f113e4f2919 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 18 Nov 2011 21:31:23 +0000 Subject: Turn the [RegionReady] module on by default and login_disable = true while scripts are loading. From field experience, we know that simulators can be unstable if a user logs in before the scripts have finished loading. This commit turns login_disable = true in [RegionReady] on by default which prevents this from happening. If you want the old behaviour, please copy these section from OpenSimDefaults.ini into OpenSim.ini and set login_disable = false --- bin/OpenSimDefaults.ini | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index e723330..5fe1352 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -332,6 +332,26 @@ DelayBeforeAppearanceSend = 2 +[RegionReady] + ; Enable this module to get notified once all items and scripts in the region have been completely loaded and compiled + enabled = true + + ; Channel on which to signal region readiness through a message + ; formatted as follows: "{server_startup|oar_file_load},{0|1},n,[oar error]" + ; - the first field indicating whether this is an initial server startup + ; - the second field is a number indicating whether the OAR file loaded ok (1 == ok, 0 == error) + ; - the third field is a number indicating how many scripts failed to compile + ; - "oar error" if supplied, provides the error message from the OAR load + channel_notify = -800 + + ; - disallow logins while scripts are loading + ; Instability can occur on regions with 100+ scripts if users enter before they have finished loading + login_disable = true + + ; - send an alert as json to a service + ; alert_uri = "http://myappserver.net/my_handler/" + + [SMTP] enabled = false @@ -489,6 +509,7 @@ ; ;DisableFacelights = "false" + [ClientStack.LindenCaps] ;; Long list of capabilities taken from ;; http://wiki.secondlife.com/wiki/Current_Sim_Capabilities @@ -1304,24 +1325,6 @@ broker = "http://broker.place.com/{1}" -[RegionReady] - ; Enable this module to get notified once all items and scripts in the region have been completely loaded and compiled - ; default is false - enabled = false - - ; Channel on which to signal region readiness through a message - ; formatted as follows: "{server_startup|oar_file_load},{0|1},n,[oar error]" - ; - the first field indicating whether this is an initial server startup - ; - the second field is a number indicating whether the OAR file loaded ok (1 == ok, 0 == error) - ; - the third field is a number indicating how many scripts failed to compile - ; - "oar error" if supplied, provides the error message from the OAR load - channel_notify = -800 - ; - disallow logins while scripts are loading - login_disable = false - ; - send an alert as json to a service - ; alert_uri = "http://myappserver.net/my_handler/" - - [MRM] ; Enables the Mini Region Modules Script Engine. ; default is false -- cgit v1.1 From f72c4bdba5bbf0958fad10e30ea8ea1f00f5a858 Mon Sep 17 00:00:00 2001 From: justincc Date: Fri, 18 Nov 2011 22:52:59 +0000 Subject: Replace HttpServer_OpenSim.dll with Oren Hurvitz's patch applied. This will hopefully address mantis 5471, 5694 and 5718. This code is now in opensim-libs, along with Diva's slightly older patches (which were already applied to the DLLs in the opensim tree). Thanks Oren! --- bin/HttpServer_OpenSim.dll | Bin 115712 -> 115712 bytes bin/HttpServer_OpenSim.pdb | Bin 409088 -> 413184 bytes bin/HttpServer_OpenSim.xml | 10909 +++++++++++++++++++++---------------------- 3 files changed, 5453 insertions(+), 5456 deletions(-) diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll index 95ea5dd..d910bb9 100755 Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb index b6b77f7..b9161e1 100644 Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ diff --git a/bin/HttpServer_OpenSim.xml b/bin/HttpServer_OpenSim.xml index 27386b7..d31bcca 100644 --- a/bin/HttpServer_OpenSim.xml +++ b/bin/HttpServer_OpenSim.xml @@ -1,5456 +1,5453 @@ - - - - HttpServer_OpenSim - - - - - The request could not be understood by the server due to malformed syntax. - The client SHOULD NOT repeat the request without modifications. - - Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php - - - - - All HTTP based exceptions will derive this class. - - - - - Create a new HttpException - - http status code (sent in the response) - error description - - - - Create a new HttpException - - http status code (sent in the response) - error description - inner exception - - - - status code to use in the response. - - - - - Create a new bad request exception. - - reason to why the request was bad. - - - - Create a new bad request exception. - - reason to why the request was bad. - inner exception - - - - Implements HTTP Digest authentication. It's more secure than Basic auth since password is - encrypted with a "key" from the server. - - - Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure. - - - - - Authentication modules are used to implement different - kind of HTTP authentication. - - - - - Tag used for authentication. - - - - - Initializes a new instance of the class. - - Delegate used to provide information used during authentication. - Delegate used to determine if authentication is required (may be null). - - - - Initializes a new instance of the class. - - Delegate used to provide information used during authentication. - - - - Create a response that can be sent in the WWW-Authenticate header. - - Realm that the user should authenticate in - Array with optional options. - A correct authentication request. - If realm is empty or null. - - - - An authentication response have been received from the web browser. - Check if it's correct - - Contents from the Authorization header - Realm that should be authenticated - GET/POST/PUT/DELETE etc. - options to specific implementations - Authentication object that is stored for the request. A user class or something like that. - if is invalid - If any of the parameters is empty or null. - - - - Used to invoke the authentication delegate that is used to lookup the user name/realm. - - Realm (domain) that user want to authenticate in - User name - Password used for validation. Some implementations got password in clear text, they are then sent to client. - object that will be stored in the request to help you identify the user if authentication was successful. - true if authentication was successful - - - - Determines if authentication is required. - - HTTP request from browser - true if user should be authenticated. - throw from your delegate if no more attempts are allowed. - If no more attempts are allowed - - - - name used in HTTP request. - - - - - Initializes a new instance of the class. - - Delegate used to provide information used during authentication. - Delegate used to determine if authentication is required (may be null). - - - - Initializes a new instance of the class. - - Delegate used to provide information used during authentication. - - - - Used by test classes to be able to use hardcoded values - - - - - An authentication response have been received from the web browser. - Check if it's correct - - Contents from the Authorization header - Realm that should be authenticated - GET/POST/PUT/DELETE etc. - First option: true if username/password is correct but not cnonce - - Authentication object that is stored for the request. A user class or something like that. - - if authenticationHeader is invalid - If any of the paramters is empty or null. - - - - Encrypts parameters into a Digest string - - Realm that the user want to log into. - User logging in - Users password. - HTTP method. - Uri/domain that generated the login prompt. - Quality of Protection. - "Number used ONCE" - Hexadecimal request counter. - "Client Number used ONCE" - Digest encrypted string - - - - - - Md5 hex encoded "userName:realm:password", without the quotes. - Md5 hex encoded "method:uri", without the quotes - Quality of Protection - "Number used ONCE" - Hexadecimal request counter. - Client number used once - - - - - Create a response that can be sent in the WWW-Authenticate header. - - Realm that the user should authenticate in - First options specifies if true if username/password is correct but not cnonce. - A correct auth request. - If realm is empty or null. - - - - Decodes authorization header value - - header value - Encoding that the buffer is in - All headers and their values if successful; otherwise null - - NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII); - - Can handle lots of whitespaces and new lines without failing. - - - - Gets the current nonce. - - - - - - Gets the Md5 hash bin hex2. - - To be hashed. - - - - - determines if the nonce is valid or has expired. - - nonce value (check wikipedia for info) - true if the nonce has not expired. - - - - name used in http request. - - - - - Gets or sets whether the token supplied in is a - HA1 generated string. - - - - - Class to make dynamic binding of redirects. Instead of having to specify a number of similar redirect rules - a regular expression can be used to identify redirect URLs and their targets. - - - [a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase) - ]]> - - - - - redirects from one URL to another. - - - - - Rules are used to perform operations before a request is being handled. - Rules can be used to create routing etc. - - - - - Process the incoming request. - - incoming HTTP request - outgoing HTTP response - true if response should be sent to the browser directly (no other rules or modules will be processed). - - returning true means that no modules will get the request. Returning true is typically being done - for redirects. - - If request or response is null. - - - - Initializes a new instance of the class. - - Absolute path (no server name) - Absolute path (no server name) - - server.Add(new RedirectRule("/", "/user/index")); - - - - - Initializes a new instance of the class. - - Absolute path (no server name) - Absolute path (no server name) - true if request should be redirected, false if the request URI should be replaced. - - server.Add(new RedirectRule("/", "/user/index")); - - - - - Process the incoming request. - - incoming HTTP request - outgoing HTTP response - true if response should be sent to the browser directly (no other rules or modules will be processed). - - returning true means that no modules will get the request. Returning true is typically being done - for redirects. - - - - - Gets string to match request URI with. - - Is compared to request.Uri.AbsolutePath - - - - Gets where to redirect. - - - - - Gets whether server should redirect client. - - - false means that the rule will replace - the current request URI with the new one from this class. - true means that a redirect response is sent to the client. - - - - - Initializes a new instance of the class. - - Expression to match URL - Expression to generate URL - - [a-zA-Z0-9]+)", "/user/${first}")); - Result of ie. /employee1 will then be /user/employee1 - ]]> - - - - - Initializes a new instance of the class. - - Expression to match URL - Expression to generate URL - Regular expression options to use, can be null - - [a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase)); - Result of ie. /employee1 will then be /user/employee1 - ]]> - - - - - Initializes a new instance of the class. - - Expression to match URL - Expression to generate URL - Regular expression options to apply - true if request should be redirected, false if the request URI should be replaced. - - [a-zA-Z0-9]+)", "/user/${first}", RegexOptions.None)); - Result of ie. /employee1 will then be /user/employee1 - ]]> - - Argument is null. - - - - - Process the incoming request. - - incoming HTTP request - outgoing HTTP response - true if response should be sent to the browser directly (no other rules or modules will be processed). - - returning true means that no modules will get the request. Returning true is typically being done - for redirects. - - If request or response is null - - - - We dont want to let the server to die due to exceptions thrown in worker threads. - therefore we use this delegate to give you a change to handle uncaught exceptions. - - Class that the exception was thrown in. - Exception - - Server will throw a InternalServerException in release version if you dont - handle this delegate. - - - - - Delegate used to let authentication modules authenticate the user name and password. - - Realm that the user want to authenticate in - User name specified by client - Can either be user password or implementation specific token. - object that will be stored in a session variable called if authentication was successful. - throw forbidden exception if too many attempts have been made. - - - Use to specify that the token is a HA1 token. (MD5 generated - string from realm, user name and password); Md5String(userName + ":" + realm + ":" + password); - - - - - - Let's you decide on a system level if authentication is required. - - HTTP request from client - true if user should be authenticated. - throw if no more attempts are allowed. - If no more attempts are allowed - - - - Interface for sessions - - - - - Remove everything from the session - - - - - Remove everything from the session - - True if the session is cleared due to expiration - - - - Session id - - - - - Should - - Name of the session variable - null if it's not set - If the object cant be serialized. - - - - When the session was last accessed. - This property is touched by the http server each time the - session is requested. - - - - - Number of session variables. - - - - - Event triggered upon clearing the session - - - - - Arguments sent when a is cleared - - - - - Instantiates the arguments for the event - - True if the session is cleared due to expiration - - - - Returns true if the session is cleared due to expiration - - - - - Delegate for when a IHttpSession is cleared - - this is being cleared. - Arguments for the clearing - - - - Cookies that should be set. - - - - - Adds a cookie in the collection. - - cookie to add - cookie is null - - - - Copy a request cookie - - - When the cookie should expire - - - - Gets a collection enumerator on the cookie list. - - collection enumerator - - - - Remove all cookies - - - - - Returns an enumerator that iterates through the collection. - - - - A that can be used to iterate through the collection. - - 1 - - - - Gets the count of cookies in the collection. - - - - - Gets the cookie of a given identifier (null if not existing). - - - - - Creates request parsers when needed. - - - - - Creates request parsers when needed. - - - - - Create a new request parser. - - Used when logging should be enabled. - A new request parser. - - - - Create a new request parser. - - Used when logging should be enabled. - A new request parser. - - - - Parses a HTTP request directly from a stream - - - - - Event driven parser used to parse incoming HTTP requests. - - - The parser supports partial messages and keeps the states between - each parsed buffer. It's therefore important that the parser gets - ed if a client disconnects. - - - - - Parse partial or complete message. - - buffer containing incoming bytes - where in buffer that parsing should start - number of bytes to parse - Unparsed bytes left in buffer. - BadRequestException. - - - - Clear parser state. - - - - - Current state in parser. - - - - - A request have been successfully parsed. - - - - - More body bytes have been received. - - - - - Request line have been received. - - - - - A header have been received. - - - - - Gets or sets the log writer. - - - - - Create a new request parser - - delegate receiving log entries. - - - - Add a number of bytes to the body - - buffer containing more body bytes. - starting offset in buffer - number of bytes, from offset, to read. - offset to continue from. - - - - Remove all state information for the request. - - - - - Parse request line - - - If line is incorrect - Expects the following format: "Method SP Request-URI SP HTTP-Version CRLF" - - - - We've parsed a new header. - - Name in lower case - Value, unmodified. - If content length cannot be parsed. - - - - Parse a message - - bytes to parse. - where in buffer that parsing should start - number of bytes to parse, starting on . - offset (where to start parsing next). - BadRequestException. - - - - Gets or sets the log writer. - - - - - Current state in parser. - - - - - A request have been successfully parsed. - - - - - More body bytes have been received. - - - - - Request line have been received. - - - - - A header have been received. - - - - - Used to inform http server that - - - - - Eventarguments used when an exception is thrown by a module - - the exception - - - - Exception thrown in a module - - - - Container for posted form data - - - - Contains some kind of input from the browser/client. - can be QueryString, form data or any other request body content. - - - - - Base class for request data containers - - - - - Adds a parameter mapped to the presented name - - The name to map the parameter to - The parameter value - - - - Returns true if the container contains the requested parameter - - Parameter id - True if parameter exists - - - - Returns a request parameter - - The name associated with the parameter - - - - Representation of a non-initialized class instance - - - Variable telling the class that it is non-initialized - - - - Initializes a new instance of the class. - - form name. - - - - Initializes a new instance of the class. - - form name. - if set to true all changes will be ignored. - this constructor should only be used by Empty - - - Creates a deep copy of the HttpInput class - The object to copy - The function makes a deep copy of quite a lot which can be slow - - - - Add a new element. Form array elements are parsed - and added in a correct hierarchy. - - Name is converted to lower case. - - name is null. - Cannot add stuff to . - - - - Returns true if the class contains a with the corresponding name. - - The field/query string name - True if the value exists - - - - Parses an item and returns it. - This function is primarily used to parse array items as in user[name]. - - - - - - - Outputs the instance representing all its values joined together - - - - Returns all items as an unescaped query string. - - - - - Extracts one parameter from an array - - Containing the string array - All but the first value - - string test1 = ExtractOne("system[user][extension][id]"); - string test2 = ExtractOne(test1); - string test3 = ExtractOne(test2); - // test1 = user[extension][id] - // test2 = extension[id] - // test3 = id - - - - Resets all data contained by class - - - - Returns an enumerator that iterates through the collection. - - - - A that can be used to iterate through the collection. - - 1 - - - - Returns an enumerator that iterates through a collection. - - - - An object that can be used to iterate through the collection. - - 2 - - - - Form name as lower case - - - - - Get a form item. - - - Returns if item was not found. - - - Instance to help mark a non-initialized form - - - Initializes a form container with the specified name - - - - Makes a deep copy of the input - - The input to copy - - - - Adds a file to the collection of posted files - - The file to add - If the file is already added - If file is null - If the instance is HttpForm.EmptyForm which cannot be modified - - - - Checks if the form contains a specified file - - Field name of the file parameter - True if the file exists - If the instance is HttpForm.EmptyForm which cannot be modified - - - - Retrieves a file held by by the form - - The identifier of the file - The requested file or null if the file was not found - If name is null or empty - If the instance is HttpForm.EmptyForm which cannot be modified - - - Disposes all held HttpFile's and resets values - - - - Retrieves the number of files added to the - - 0 if no files are added - - - - Interface for form content decoders. - - - - - - - Stream containing the content - Content type (with any additional info like boundry). Content type is always supplied in lower case - Stream enconding - A http form, or null if content could not be parsed. - If contents in the stream is not valid input data. - - - - Checks if the decoder can handle the mime type - - Content type (with any additional info like boundry). Content type is always supplied in lower case. - True if the decoder can parse the specified content type - - - - Lists content type mime types. - - - - - text/plain - - - - - text/haml - - - - - content type for javascript documents = application/javascript - - - - RFC 4329 states that text/javascript have been superseeded by - application/javascript. You might still want to check browser versions - since older ones do not support application/javascript. - - Browser support: http://krijnhoetmer.nl/stuff/javascript/mime-types/ - - - - - text/xml - - - - - A list of content types - - - - - - - Semicolon separated content types. - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Searches for the specified type - - Can also be a part of a type (searching for "xml" would return true for "application/xml"). - true if type was found. - - - - Get this first content type. - - - - - Fetch a content type - - Part of type ("xml" would return "application/xml") - - All content types are in lower case. - - - - A HttpModule can be used to serve Uri's. The module itself - decides if it should serve a Uri or not. In this way, you can - get a very flexible http application since you can let multiple modules - serve almost similar urls. - - - Throw if you are using a and want to prompt for user name/password. - - - - - Method that process the url - - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to - true if this module handled the request. - - - - Set the log writer to use. - - logwriter to use. - - - - Log something. - - importance of log message - message - - - - If true specifies that the module doesn't consume the processing of a request so that subsequent modules - can continue processing afterwards. Default is false. - - - - - Webhelper provides helpers for common tasks in HTML. - - - - - Used to let the website use different javascript libraries. - Default is - - - - - Creates a link that invokes through ajax. - - url to fetch - link title - - optional options in format "key, value, key, value". - Javascript options starts with ':'. - - a link tag - - WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');"); - - - - - Builds a link that updates an element with the fetched ajax content. - - Url to fetch content from - link title - html element to update with the results of the ajax request. - optional options in format "key, value, key, value" - A link tag. - - - - A link that pop ups a Dialog (overlay div) - - url to contents of dialog - link title - name/value of html attributes. - A "a"-tag that popups a dialog when clicked - - WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); - - - - - Create/Open a dialog box using ajax - - - - - - - - - Close a javascript dialog window/div. - - javascript for closing a dialog. - - - - - Create a <form> tag. - - name of form - action to invoke on submit - form should be posted as ajax - html code - - WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); - - - - - Create a link tag. - - url to go to - link title (text that is displayed) - html attributes, name, value, name, value - html code - - WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');"); - - - - - Build a link - - url to go to. - title of link (displayed text) - extra html attributes. - a complete link - - - - Build a link - - url to go to. - title of link (displayed text) - extra html attributes. - a complete link - more options - - - - Obsolete - - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete - - - - Obsolete - - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete - Obsolete - - - - Render errors into a UL with class "errors" - - class used by UL-tag. - items to list - an unordered html list. - - - - Render errors into a UL with class "errors" - - class used by UL-tag. - items to list - an unordered html list. - - - - Render errors into a UL with class "errors" - - - - - - - Generates a list with html attributes. - - StringBuilder that the options should be added to. - attributes set by user. - attributes set by any of the helper classes. - - - - Generates a list with html attributes. - - StringBuilder that the options should be added to. - - - - - Purpose of this class is to create a javascript toolkit independent javascript helper. - - - - - Generates a list with JS options. - - StringBuilder that the options should be added to. - the javascript options. name, value pairs. each string value should be escaped by YOU! - true if we should start with a comma. - - - - Removes any javascript parameters from an array of parameters - - The array of parameters to remove javascript params from - An array of html parameters - - - - javascript action that should be added to the "onsubmit" event in the form tag. - - - All javascript option names should end with colon. - - - JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); - - - - - - Requests a url through ajax - - url to fetch - optional options in format "key, value, key, value", used in JS request object. - a link tag - All javascript option names should end with colon. - - - JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); - - - - - - Ajax requests that updates an element with - the fetched content - - Url to fetch content from - element to update - optional options in format "key, value, key, value", used in JS updater object. - A link tag. - All javascript option names should end with colon. - - - JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');"); - - - - - - A link that pop ups a Dialog (overlay div) - - url to contents of dialog - link title - A "a"-tag that popups a dialog when clicked - name/value of html attributes - - WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); - - - - - Close a javascript dialog window/div. - - javascript for closing a dialog. - - - - - Creates a new modal dialog window - - url to open in window. - window title (may not be supported by all js implementations) - - - - - - Class that receives Requests from a . - - - - - Client have been disconnected. - - Client that was disconnected. - Reason - - - - - Invoked when a client context have received a new HTTP request - - Client that received the request. - Request that was received. - - - - - Generic helper functions for HTTP - - - - - Version string for HTTP v1.0 - - - - - Version string for HTTP v1.1 - - - - - An empty URI - - - - - Parses a query string. - - Query string (URI encoded) - A object if successful; otherwise - queryString is null. - If string cannot be parsed. - - - - This provider is used to let us implement any type of form decoding we want without - having to rewrite anything else in the server. - - - - - - - Should contain boundary and type, as in: multipart/form-data; boundary=---------------------------230051238959 - Stream containing form data. - Encoding used when decoding the stream - if no parser was found. - If stream is null or not readable. - If stream contents cannot be decoded properly. - - - - Add a decoder. - - - - - - - Number of added decoders. - - - - - Use with care. - - - - - Decoder used for unknown content types. - - - - - A session stored in memory. - - - - - - - A unique id used by the sessions store to identify the session - - - - Id - - - - - - Remove everything from the session - - - - - Clears the specified expire. - - True if the session is cleared due to expiration - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - 2 - - - - Session id - - - - - Should - - Name of the session variable - null if it's not set - - - - when the session was last accessed. - - - Used to determine when the session should be removed. - - - - - Number of values in the session - - - - - Flag to indicate that the session have been changed - and should be saved into the session store. - - - - - Event triggered upon clearing the session - - - - - This decoder converts XML documents to form items. - Each element becomes a subitem in the form, and each attribute becomes an item. - - - // xml: somethingdata - // result: - // form["hello"].Value = "something" - // form["hello"]["id"].Value = 1 - // form["hello"]["world]["id"].Value = 1 - // form["hello"]["world"].Value = "data" - - - The original xml document is stored in form["__xml__"].Value. - - - - - - - Stream containing the content - Content type (with any additional info like boundry). Content type is always supplied in lower case - Stream encoding - Note: contentType and encoding are not used? - A http form, or null if content could not be parsed. - - - - - Recursive function that will go through an xml element and store it's content - to the form item. - - (parent) Item in form that content should be added to. - Node that should be parsed. - - - - Checks if the decoder can handle the mime type - - Content type (with any additional info like boundry). Content type is always supplied in lower case. - True if the decoder can parse the specified content type - - - - - - - - - - - Represents a field in a multipart form - - - - The server encountered an unexpected condition which prevented it from fulfilling the request. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - error message. - - - - Initializes a new instance of the class. - - error message. - inner exception. - - - - Current state in the parsing. - - - - - Should parse the request line - - - - - Searching for a complete header name - - - - - Searching for colon after header name (ignoring white spaces) - - - - - Searching for start of header value (ignoring white spaces) - - - - - Searching for a complete header value (can span over multiple lines, as long as they are prefixed with one/more whitespaces) - - - - - Adding bytes to body - - - - - A reverse proxy are used to act as a bridge between local (protected/hidden) websites - and public clients. - - A typical usage is to allow web servers on non standard ports to still be available - to the public clients, or allow web servers on private ips to be available. - - - - - - - Base url requested from browser - Base url on private web server - - // this will return contents from http://192.168.1.128/view/jonas when client requests http://www.gauffin.com/user/view/jonas - _server.Add(new ReverseProxyModule("http://www.gauffin.com/user/", "http://192.168.1.128/"); - - - - - Method that determines if an url should be handled or not by the module - - Url requested by the client. - true if module should handle the url. - - - - Method that process the url - - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to - - - - Contains all HTTP Methods (according to the HTTP 1.1 specification) - - See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - - - - - - The DELETE method requests that the origin server delete the resource identified by the Request-URI. - - - - This method MAY be overridden by human intervention (or other means) on the origin server. - The client cannot be guaranteed that the operation has been carried out, even if the status code - returned from the origin server indicates that the action has been completed successfully. - - - However, the server SHOULD NOT indicate success unless, at the time the response is given, - it intends to delete the resource or move it to an inaccessible location. - - - A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, - 202 (Accepted) if the action has not yet been enacted, - or 204 (No Content) if the action has been enacted but the response does not include an entity. - - - If the request passes through a cache and the Request-URI identifies one or more currently cached entities, - those entries SHOULD be treated as stale. Responses to this method are not cacheable. - - - - - - The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. - - - - If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the - entity in the response and not the source text of the process, unless that text happens to be the output of the process. - - - The semantics of the GET method change to a "conditional GET" if the request message includes an - If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. - A conditional GET method requests that the entity be transferred only under the circumstances described - by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network - usage by allowing cached entities to be refreshed without requiring multiple requests or transferring - data already held by the client. - - - - - - The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. - - - The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the - information sent in response to a GET request. This method can be used for obtaining meta information about - the entity implied by the request without transferring the entity-body itself. - - This method is often used for testing hypertext links for validity, accessibility, and recent modification. - - - - - The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. - - - This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. - - - - - The POST method is used to request that the origin server accept the entity enclosed - in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. - - - POST is designed to allow a uniform method to cover the following functions: - - - Annotation of existing resources; - - Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; - - Providing a block of data, such as the result of submitting a form, to a data-handling process; - - Extending a database through an append operation. - - - - If a resource has been created on the origin server, the response SHOULD be 201 (Created) and - contain an entity which describes the status of the request and refers to the new resource, and a - Location header (see section 14.30). - - - The action performed by the POST method might not result in a resource that can be identified by a URI. - In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on - whether or not the response includes an entity that describes the result. - - Responses to this method are not cacheable, unless the response includes appropriate Cache-Control - or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent - to retrieve a cacheable resource. - - - - - - The PUT method requests that the enclosed entity be stored under the supplied Request-URI. - - - - - If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a - modified version of the one residing on the origin server. - - If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new - resource by the requesting user agent, the origin server can create the resource with that URI. - - If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. - - If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to - indicate successful completion of the request. - - If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be - given that reflects the nature of the problem. - - - - The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not - understand or implement and MUST return a 501 (Not Implemented) response in such cases. - - - - - - The TRACE method is used to invoke a remote, application-layer loop- back of the request message. - - - - - Contains all HTTP Methods (according to the HTTP 1.1 specification) - - See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html - - - - - - The DELETE method requests that the origin server delete the resource identified by the Request-URI. - - - - This method MAY be overridden by human intervention (or other means) on the origin server. - The client cannot be guaranteed that the operation has been carried out, even if the status code - returned from the origin server indicates that the action has been completed successfully. - - - However, the server SHOULD NOT indicate success unless, at the time the response is given, - it intends to delete the resource or move it to an inaccessible location. - - - A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, - 202 (Accepted) if the action has not yet been enacted, - or 204 (No Content) if the action has been enacted but the response does not include an entity. - - - If the request passes through a cache and the Request-URI identifies one or more currently cached entities, - those entries SHOULD be treated as stale. Responses to this method are not cacheable. - - - - - - The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. - - - - If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the - entity in the response and not the source text of the process, unless that text happens to be the output of the process. - - - The semantics of the GET method change to a "conditional GET" if the request message includes an - If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. - A conditional GET method requests that the entity be transferred only under the circumstances described - by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network - usage by allowing cached entities to be refreshed without requiring multiple requests or transferring - data already held by the client. - - - - - - The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. - - - The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the - information sent in response to a GET request. This method can be used for obtaining meta information about - the entity implied by the request without transferring the entity-body itself. - - This method is often used for testing hypertext links for validity, accessibility, and recent modification. - - - - - The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. - - - This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. - - - - - The POST method is used to request that the origin server accept the entity enclosed - in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. - - - POST is designed to allow a uniform method to cover the following functions: - - - Annotation of existing resources; - - Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; - - Providing a block of data, such as the result of submitting a form, to a data-handling process; - - Extending a database through an append operation. - - - - If a resource has been created on the origin server, the response SHOULD be 201 (Created) and - contain an entity which describes the status of the request and refers to the new resource, and a - Location header (see section 14.30). - - - The action performed by the POST method might not result in a resource that can be identified by a URI. - In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on - whether or not the response includes an entity that describes the result. - - Responses to this method are not cacheable, unless the response includes appropriate Cache-Control - or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent - to retrieve a cacheable resource. - - - - - - The PUT method requests that the enclosed entity be stored under the supplied Request-URI. - - - - - If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a - modified version of the one residing on the origin server. - - If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new - resource by the requesting user agent, the origin server can create the resource with that URI. - - If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. - - If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to - indicate successful completion of the request. - - If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be - given that reflects the nature of the problem. - - - - The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not - understand or implement and MUST return a 501 (Not Implemented) response in such cases. - - - - - - The TRACE method is used to invoke a remote, application-layer loop- back of the request message. - - - - - New implementation of the HTTP listener. - - - Use the Create methods to create a default listener. - - - - - Contains a listener that doesn't do anything with the connections. - - - - - Listen for regular HTTP connections - - IP Address to accept connections on - TCP Port to listen on, default HTTP port is 80. - Factory used to create es. - address is null. - Port must be a positive number. - - - - Initializes a new instance of the class. - - IP Address to accept connections on - TCP Port to listen on, default HTTPS port is 443 - Factory used to create es. - Certificate to use - - - - Initializes a new instance of the class. - - IP Address to accept connections on - TCP Port to listen on, default HTTPS port is 443 - Factory used to create es. - Certificate to use - which HTTPS protocol to use, default is TLS. - - - Exception. - - - - Will try to accept connections one more time. - - If any exceptions is thrown. - - - - Can be used to create filtering of new connections. - - Accepted socket - true if connection can be accepted; otherwise false. - - - - Start listen for new connections - - Number of connections that can stand in a queue to be accepted. - Listener have already been started. - - - - Stop the listener - - - - - - Gives you a change to receive log entries for all internals of the HTTP library. - - - You may not switch log writer after starting the listener. - - - - - True if we should turn on trace logs. - - - - - Catch exceptions not handled by the listener. - - - Exceptions will be thrown during debug mode if this event is not used, - exceptions will be printed to console and suppressed during release mode. - - - - - A request have been received from a . - - - - - Initializes a new instance of the class. - - IP Address to accept connections on - TCP Port to listen on, default HTTP port is 80. - Factory used to create es. - address is null. - Port must be a positive number. - - - - Initializes a new instance of the class. - - The address. - The port. - The factory. - The certificate. - - - - Initializes a new instance of the class. - - The address. - The port. - The factory. - The certificate. - The protocol. - - - - Creates a new instance with default factories. - - Address that the listener should accept connections on. - Port that listener should accept connections on. - Created HTTP listener. - - - - Creates a new instance with default factories. - - Address that the listener should accept connections on. - Port that listener should accept connections on. - Certificate to use - Created HTTP listener. - - - - Creates a new instance with default factories. - - Address that the listener should accept connections on. - Port that listener should accept connections on. - Certificate to use - which HTTPS protocol to use, default is TLS. - Created HTTP listener. - - - - Can be used to create filtering of new connections. - - Accepted socket - - true if connection can be accepted; otherwise false. - - - - - A client have been accepted, but not handled, by the listener. - - - - - Event arguments used when a new header have been parsed. - - - - - Initializes a new instance of the class. - - Name of header. - Header value. - - - - Initializes a new instance of the class. - - - - - Gets or sets header name. - - - - - Gets or sets header value. - - - - - Priority for log entries - - - - - - Very detailed logs to be able to follow the flow of the program. - - - - - Logs to help debug errors in the application - - - - - Information to be able to keep track of state changes etc. - - - - - Something did not go as we expected, but it's no problem. - - - - - Something that should not fail failed, but we can still keep - on going. - - - - - Something failed, and we cannot handle it properly. - - - - - Interface used to write to log files. - - - - - Write an entry to the log file. - - object that is writing to the log - importance of the log message - the message - - - - This class writes to the console. It colors the output depending on the logprio and includes a 3-level stacktrace (in debug mode) - - - - - - The actual instance of this class. - - - - - Logwriters the specified source. - - object that wrote the logentry. - Importance of the log message - The message. - - - - Get color for the specified logprio - - prio for the log entry - A for the prio - - - - Default log writer, writes everything to null (nowhere). - - - - - - The logging instance. - - - - - Writes everything to null - - object that wrote the log entry. - Importance of the log message - The message. - - - - Will contain helper functions for javascript. - - - - - Requests a url through ajax - - url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. - optional options in format "key, value, key, value", used in JS request object. All keys should end with colon. - a link tag - onclick attribute is used by this method. - - - // plain text - JSHelper.AjaxRequest("'/user/show/1'"); - - // ajax request using this.href - string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; - - - - - - Ajax requests that updates an element with - the fetched content - - url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. - element to update - options in format "key, value, key, value". All keys should end with colon. - A link tag. - - - JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); - - - - - - Opens contents in a dialog window. - - url to contents of dialog - link title - name, value, name, value, all parameter names should end with colon. - - - - Close a javascript dialog window/div. - - javascript for closing a dialog. - - - - - Delegate used by to populate select options. - - current object (for instance a User). - Text that should be displayed in the value part of a <optiongt;-tag. - Text shown in the select list. - - // Class that is going to be used in a SELECT-tag. - public class User - { - private readonly string _realName; - private readonly int _id; - public User(int id, string realName) - { - _id = id; - _realName = realName; - } - public string RealName - { - get { return _realName; } - } - - public int Id - { - get { return _id; } - } - } - - // Using an inline delegate to generate the select list - public void UserInlineDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - }, 2, true); - } - - // Using an method as delegate to generate the select list. - public void UseExternalDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, UserOptions, 1, true); - } - - // delegate returning id and title - public static void UserOptions(object o, out object id, out object title) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - } /// - - - - Arguments used when more body bytes have come. - - - - - Initializes a new instance of the class. - - buffer that contains the received bytes. - offset in buffer where to start processing. - number of bytes from that should be parsed. - - - - Initializes a new instance of the class. - - - - - Gets or sets buffer that contains the received bytes. - - - - - Gets or sets number of bytes from that should be parsed. - - - - - Gets or sets offset in buffer where to start processing. - - - - - Response that is sent back to the web browser / client. - - A response can be sent if different ways. The easiest one is - to just fill the Body stream with content, everything else - will then be taken care of by the framework. The default content-type - is text/html, you should change it if you send anything else. - - The second and slighty more complex way is to send the response - as parts. Start with sending the header using the SendHeaders method and - then you can send the body using SendBody method, but do not forget - to set ContentType and ContentLength before doing so. - - - public void MyHandler(IHttpRequest request, IHttpResponse response) - { - - } - - - - - Add another header to the document. - - Name of the header, case sensitive, use lower cases. - Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n - If headers already been sent. - If value conditions have not been met. - Adding any header will override the default ones and those specified by properties. - - - - Send headers and body to the browser. - - If content have already been sent. - - - - Make sure that you have specified ContentLength and sent the headers first. - - - If headers have not been sent. - - offest of first byte to send - number of bytes to send. - - - This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low. - - - - Make sure that you have specified ContentLength and sent the headers first. - - - If headers have not been sent. - - - - This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low. - - - - Send headers to the client. - - If headers already been sent. - - - - - - - Redirect client to somewhere else using the 302 status code. - - Destination of the redirect - If headers already been sent. - You can not do anything more with the request when a redirect have been done. This should be your last - action. - - - - redirect to somewhere - - where the redirect should go - - No body are allowed when doing redirects. - - - - - The body stream is used to cache the body contents - before sending everything to the client. It's the simplest - way to serve documents. - - - - - Defines the version of the HTTP Response for applications where it's required - for this to be forced. - - - - - The chunked encoding modifies the body of a message in order to - transfer it as a series of chunks, each with its own size indicator, - followed by an OPTIONAL trailer containing entity-header fields. This - allows dynamically produced content to be transferred along with the - information necessary for the recipient to verify that it has - received the full message. - - - - - Kind of connection - - - - - Encoding to use when sending stuff to the client. - - Default is UTF8 - - - - Number of seconds to keep connection alive - - Only used if Connection property is set to ConnectionType.KeepAlive - - - - Status code that is sent to the client. - - Default is HttpStatusCode.Ok - - - - Information about why a specific status code was used. - - - - - Size of the body. MUST be specified before sending the header, - unless property Chunked is set to true. - - - - - Kind of content in the body - - Default is text/html - - - - Headers have been sent to the client- - - You can not send any additional headers if they have already been sent. - - - - The whole response have been sent. - - - - - Cookies that should be created/changed. - - - - - Type of HTTP connection - - - - - Connection is closed after each request-response - - - - - Connection is kept alive for X seconds (unless another request have been made) - - - - - Contains server side HTTP request information. - - - - - Called during parsing of a . - - Name of the header, should not be URL encoded - Value of the header, should not be URL encoded - If a header is incorrect. - - - - Add bytes to the body - - buffer to read bytes from - where to start read - number of bytes to read - Number of bytes actually read (same as length unless we got all body bytes). - If body is not writable - bytes is null. - offset is out of range. - - - - Clear everything in the request - - - - - Decode body into a form. - - A list with form decoders. - If body contents is not valid for the chosen decoder. - If body is still being transferred. - - - - Sets the cookies. - - The cookies. - - - - Create a response object. - - Context for the connected client. - A new . - - - - Gets kind of types accepted by the client. - - - - - Gets or sets body stream. - - - - - Gets whether the body is complete. - - - - - Gets or sets kind of connection used for the session. - - - - - Gets or sets number of bytes in the body. - - - - - Gets cookies that was sent with the request. - - - - - Gets form parameters. - - - - - Gets headers sent by the client. - - - - - Gets or sets version of HTTP protocol that's used. - - - Probably or . - - - - - - Gets whether the request was made by Ajax (Asynchronous JavaScript) - - - - - Gets or sets requested method. - - - Will always be in upper case. - - - - - - Gets parameter from or . - - - - - Gets variables sent in the query string - - - - - Gets or sets requested URI. - - - - - Gets URI absolute path divided into parts. - - - // URI is: http://gauffin.com/code/tiny/ - Console.WriteLine(request.UriParts[0]); // result: code - Console.WriteLine(request.UriParts[1]); // result: tiny - - - If you're using controllers than the first part is controller name, - the second part is method name and the third part is Id property. - - - - - - Gets or sets path and query. - - - - Are only used during request parsing. Cannot be set after "Host" header have been - added. - - - - - Contains a connection to a browser/client. - - - - - Disconnect from client - - error to report in the event. - - - - Send a response. - - Either or - HTTP status code - reason for the status code. - HTML body contents, can be null or empty. - A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty - If is invalid. - - - - Send a response. - - Either or - HTTP status code - reason for the status code. - - - - Send a response. - - - - - - send a whole buffer - - buffer to send - - - - - Send data using the stream - - Contains data to send - Start position in buffer - number of bytes to send - - - - - - Closes the streams and disposes of the unmanaged resources - - - - - Using SSL or other encryption method. - - - - - Using SSL or other encryption method. - - - - - The context have been disconnected. - - - Event can be used to clean up a context, or to reuse it. - - - - - A request have been received in the context. - - - - - A have been disconnected. - - - - - Initializes a new instance of the class. - - Reason to disconnection. - - - - Gets reason to why client disconnected. - - - - - - - - - - Initializes a new instance of the class. - - The request. - - - - Gets received request. - - - - - The website module let's you handle multiple websites in the same server. - It uses the "Host" header to check which site you want. - - It's recommended that you do not - add any other modules to HttpServer if you are using the website module. Instead, - add all wanted modules to each website. - - - - - - domain name that should be handled. - - - - - Method that process the url - - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to - - - - Name of site. - - - - - represents a HTTP input item. Each item can have multiple sub items, a sub item - is made in a HTML form by using square brackets - - - // becomes: - Console.WriteLine("Value: {0}", form["user"]["FirstName"].Value); - - - All names in a form SHOULD be in lowercase. - - - - Representation of a non-initialized . - - - - Initializes an input item setting its name/identifier and value - - Parameter name/id - Parameter value - - - Creates a deep copy of the item specified - The item to copy - The function makes a deep copy of quite a lot which can be slow - - - - Add another value to this item - - Value to add. - Cannot add stuff to . - - - - checks if a sub-item exists (and has a value). - - name in lower case - true if the sub-item exists and has a value; otherwise false. - - - Returns a formatted representation of the instance with the values of all contained parameters - - - - Outputs the string in a formatted manner - - A prefix to append, used internally - produce a query string - - - - Add a sub item. - - Can contain array formatting, the item is then parsed and added in multiple levels - Value to add. - Argument is null. - Cannot add stuff to . - - - - Returns an enumerator that iterates through the collection. - - - - A that can be used to iterate through the collection. - - 1 - - - - Returns an enumerator that iterates through a collection. - - - - An object that can be used to iterate through the collection. - - 2 - - - - Outputs the string in a formatted manner - - A prefix to append, used internally - - - - - Number of values - - - - - Get a sub item - - name in lower case. - if no item was found. - - - - Name of item (in lower case). - - - - - Returns the first value, or null if no value exist. - - - - - Returns the last value, or null if no value exist. - - - - - Returns the list with values. - - - - - - - name in lower case - - - - - Container class for posted files - - - - - Creates a container for a posted file - - The identifier of the post field - The file path - The content type of the file - The name of the file uploaded - If any parameter is null or empty - - - - Creates a container for a posted file - - If any parameter is null or empty - - - Destructor disposing the file - - - - Deletes the temporary file - - True if manual dispose - - - - Disposing interface, cleans up managed resources (the temporary file) and suppresses finalization - - - - - The name/id of the file - - - - - The full file path - - - - - The name of the uploaded file - - - - - The type of file - - - - - PrototypeJS implementation of the javascript functions. - - - - - Requests a url through ajax - - url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. - optional options in format "key, value, key, value", used in JS request object. All keys should end with colon. - a link tag - onclick attribute is used by this method. - - - // plain text - JSHelper.AjaxRequest("'/user/show/1'"); - - // ajax request using this.href - string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; - - - - - - Determins if a list of strings contains a specific value - - options to check in - value to find - true if value was found - case insensitive - - - - Ajax requests that updates an element with - the fetched content - - URL to fetch. URL is NOT enclosed in quotes by the implementation. You need to do that yourself. - element to update - options in format "key, value, key, value". All keys should end with colon. - A link tag. - - - JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); - - - - - - A link that pop ups a Dialog (overlay div) - - URL to contents of dialog - link title - name, value, name, value - - A "a"-tag that popups a dialog when clicked - - Requires Control.Modal found here: http://livepipe.net/projects/control_modal/ - And the following JavaScript (load it in application.js): - - Event.observe(window, 'load', - function() { - document.getElementsByClassName('modal').each(function(link){ new Control.Modal(link); }); - } - ); - - - - WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); - - - - - create a modal dialog (usually using DIVs) - - url to fetch - dialog title - javascript/html attributes. javascript options ends with colon ':'. - - - - - Close a javascript dialog window/div. - - javascript for closing a dialog. - - - - - javascript action that should be added to the "onsubmit" event in the form tag. - - remember to encapsulate strings in '' - - All javascript option names should end with colon. - - - JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); - - - - - - The request requires user authentication. The response MUST include a - WWW-Authenticate header field (section 14.47) containing a challenge - applicable to the requested resource. - - The client MAY repeat the request with a suitable Authorization header - field (section 14.8). If the request already included Authorization - credentials, then the 401 response indicates that authorization has been - refused for those credentials. If the 401 response contains the same challenge - as the prior response, and the user agent has already attempted authentication - at least once, then the user SHOULD be presented the entity that was given in the response, - since that entity might include relevant diagnostic information. - - HTTP access authentication is explained in rfc2617: - http://www.ietf.org/rfc/rfc2617.txt - - (description is taken from - http://www.submissionchamber.com/help-guides/error-codes.php#sec10.4.2) - - - - - Create a new unauhtorized exception. - - - - - - Create a new unauhtorized exception. - - reason to why the request was unauthorized. - inner exception - - - - Create a new unauhtorized exception. - - reason to why the request was unauthorized. - - - - The server understood the request, but is refusing to fulfill it. - Authorization will not help and the request SHOULD NOT be repeated. - If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, - it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information - available to the client, the status code 404 (Not Found) can be used instead. - - Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php - - - - - Initializes a new instance of the class. - - error message - - - - The "basic" authentication scheme is based on the model that the - client must authenticate itself with a user-ID and a password for - each realm. The realm value should be considered an opaque string - which can only be compared for equality with other realms on that - server. The server will service the request only if it can validate - the user-ID and password for the protection space of the Request-URI. - There are no optional authentication parameters. - - - - - Initializes a new instance of the class. - - Delegate used to provide information used during authentication. - Delegate used to determine if authentication is required (may be null). - - - - Initializes a new instance of the class. - - Delegate used to provide information used during authentication. - - - - Create a response that can be sent in the WWW-Authenticate header. - - Realm that the user should authenticate in - Not used in basic auth - A correct auth request. - - - - An authentication response have been received from the web browser. - Check if it's correct - - Contents from the Authorization header - Realm that should be authenticated - GET/POST/PUT/DELETE etc. - Not used in basic auth - Authentication object that is stored for the request. A user class or something like that. - if authenticationHeader is invalid - If any of the paramters is empty or null. - - - - name used in http request. - - - - - A session store is used to store and load sessions on a media. - The default implementation () saves/retrieves sessions from memory. - - - - - Creates a new http session with a generated id. - - A object - - - - Creates a new http session with a specific id - - Id used to identify the new cookie.. - A object. - - Id should be generated by the store implementation if it's null or . - - - - - Load an existing session. - - Session id (usually retrieved from a client side cookie). - A session if found; otherwise null. - - - - Save an updated session to the store. - - Session id (usually retrieved from a client side cookie). - If Id property have not been specified. - - - - We use the flyweight pattern which reuses small objects - instead of creating new each time. - - Unused session that should be reused next time Create is called. - - - - Remove expired sessions - - - - - Remove a session - - id of the session. - - - - Load a session from the store - - - null if session is not found. - - - - Number of minutes before a session expires. - - Default time is 20 minutes. - - - - This class is created as a wrapper, since there are two different cookie types in .Net (Cookie and HttpCookie). - The framework might switch class in the future and we dont want to have to replace all instances - - - - - Let's copy all the cookies. - - value from cookie header. - - - - Adds a cookie in the collection. - - cookie to add - cookie is null - - - - Gets a collection enumerator on the cookie list. - - collection enumerator - - - - Remove all cookies. - - - - - Returns an enumerator that iterates through the collection. - - - - A that can be used to iterate through the collection. - - 1 - - - - Remove a cookie from the collection. - - Name of cookie. - - - - Gets the count of cookies in the collection. - - - - - Gets the cookie of a given identifier (null if not existing). - - - - - Inversion of control interface. - - - - - Add a component instance - - Interface type - Instance to add - - - - Get a component. - - Interface type - Component if registered, otherwise null. - - Component will get created if needed. - - - - - Checks if the specified component interface have been added. - - - true if found; otherwise false. - - - - Add a component. - - Type being requested. - Type being created. - - - - Contains server side HTTP request information. - - - - - Chars used to split an URL path into multiple parts. - - - - - Assign a form. - - - - - - Creates a new object that is a copy of the current instance. - - - - A new object that is a copy of this instance. - - 2 - - - - Decode body into a form. - - A list with form decoders. - If body contents is not valid for the chosen decoder. - If body is still being transferred. - - - - Cookies - - the cookies - - - - Create a response object. - - A new . - - - - Called during parsing of a . - - Name of the header, should not be URL encoded - Value of the header, should not be URL encoded - If a header is incorrect. - - - - Add bytes to the body - - buffer to read bytes from - where to start read - number of bytes to read - Number of bytes actually read (same as length unless we got all body bytes). - If body is not writable - bytes is null. - offset is out of range. - - - - Clear everything in the request - - - - - Gets or sets a value indicating whether this is secure. - - - - - Path and query (will be merged with the host header) and put in Uri - - - - - - Gets whether the body is complete. - - - - - Gets kind of types accepted by the client. - - - - - Gets or sets body stream. - - - - - Gets or sets kind of connection used for the session. - - - - - Gets or sets number of bytes in the body. - - - - - Gets headers sent by the client. - - - - - Gets or sets version of HTTP protocol that's used. - - - Probably or . - - - - - - Gets or sets requested method. - - - - Will always be in upper case. - - - - - - Gets variables sent in the query string - - - - - Gets or sets requested URI. - - - - - Uri absolute path splitted into parts. - - - // uri is: http://gauffin.com/code/tiny/ - Console.WriteLine(request.UriParts[0]); // result: code - Console.WriteLine(request.UriParts[1]); // result: tiny - - - If you're using controllers than the first part is controller name, - the second part is method name and the third part is Id property. - - - - - - Gets parameter from or . - - - - - Gets form parameters. - - - - - Gets whether the request was made by Ajax (Asynchronous JavaScript) - - - - - Gets cookies that was sent with the request. - - - - - The object form class takes an object and creates form items for it. - - - - - Initializes a new instance of the class. - - - form name *and* id. - action to do when form is posted. - - - - - Initializes a new instance of the class. - - form name *and* id. - action to do when form is posted. - object to get values from - - - - Initializes a new instance of the class. - - form action. - object to get values from. - - - - write out the FORM-tag. - - generated html code - - - - Writeout the form tag - - form should be posted through ajax. - generated html code - - - - Generates a text box. - - - - generated html code - - - - password box - - - - generated html code - - - - Hiddens the specified property name. - - Name of the property. - The options. - generated html code - - - - Labels the specified property name. - - property in object. - caption - generated html code - - - - Generate a checkbox - - property in object - checkbox value - additional html attributes. - generated html code - - - - Write a html select tag - - object property. - id column - The title column. - The options. - - - - - Selects the specified property name. - - Name of the property. - The items. - The id column. - The title column. - The options. - - - - - Write a submit tag. - - button caption - html submit tag - - - - html end form tag - - html - - - - Can handle application/x-www-form-urlencoded - - - - - - Stream containing the content - Content type (with any additional info like boundry). Content type is always supplied in lower case - Stream encoding - - A HTTP form, or null if content could not be parsed. - - If contents in the stream is not valid input data. - - - - Checks if the decoder can handle the mime type - - Content type (with any additional info like boundry). Content type is always supplied in lower case. - True if the decoder can parse the specified content type - - - - - - - http://www.faqs.org/rfcs/rfc1867.html - - - - - multipart/form-data - - - - - form-data - - - - - - - Stream containing the content - Content type (with any additional info like boundry). Content type is always supplied in lower case - Stream enconding - A http form, or null if content could not be parsed. - If contents in the stream is not valid input data. - If any parameter is null - - - - Checks if the decoder can handle the mime type - - Content type (with any additional info like boundry). Content type is always supplied in lower case. - True if the decoder can parse the specified content type - - - - Invoked when a client have been accepted by the - - - Can be used to revoke incoming connections - - - - - Initializes a new instance of the class. - - The socket. - - - - Client may not be handled. - - - - - Accepted socket. - - - - - Client should be revoked. - - - - - The purpose of this module is to serve files. - - - - - Initializes a new instance of the class. - - Uri to serve, for instance "/files/" - Path on hard drive where we should start looking for files - If true a Last-Modifed header will be sent upon requests urging web browser to cache files - - - - Initializes a new instance of the class. - - Uri to serve, for instance "/files/" - Path on hard drive where we should start looking for files - - - - Mimtypes that this class can handle per default - - - - - Determines if the request should be handled by this module. - Invoked by the - - - true if this module should handle it. - - - Illegal path - - - - check if source contains any of the chars. - - - - - - - - Method that process the Uri. - - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to - Failed to find file extension - File type is forbidden. - - - - return a file extension from an absolute Uri path (or plain filename) - - - - - - - List with all mime-type that are allowed. - - All other mime types will result in a Forbidden http status code. - - - - characters that may not exist in a path. - - - fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" }; - - - - - Helpers to make XML handling easier - - - - - Serializes object to XML. - - object to serialize. - XML - - Removes name spaces and adds indentation - - - - - Create an object from a XML string - - Type of object - XML string - object - - - - The requested resource was not found in the web server. - - - - - Create a new exception - - message describing the error - inner exception - - - - Create a new exception - - message describing the error - - - - cookie sent by the client/browser - - - - - - Constructor. - - cookie identifier - cookie content - id or content is null - id is empty - - - - Gets the cookie HTML representation. - - cookie string - - - - Gets the cookie identifier. - - - - - Cookie value. Set to null to remove cookie. - - - - - Returns item either from a form or a query string (checks them in that order) - - - - Representation of a non-initialized HttpParam - - - Initialises the class to hold a value either from a post request or a querystring request - - - - The add method is not availible for HttpParam - since HttpParam checks both Request.Form and Request.QueryString - - name identifying the value - value to add - - - - - Checks whether the form or querystring has the specified value - - Name, case sensitive - true if found; otherwise false. - - - - Returns an enumerator that iterates through the collection. - - - - A that can be used to iterate through the collection. - - 1 - - - - Returns an enumerator that iterates through a collection. - - - - An object that can be used to iterate through the collection. - - 2 - - - - Fetch an item from the form or querystring (in that order). - - - Item if found; otherwise HttpInputItem.EmptyLanguageNode - - - - Contains a connection to a browser/client. - - - Remember to after you have hooked the event. - - TODO: Maybe this class should be broken up into HttpClientChannel and HttpClientContext? - - - - Initializes a new instance of the class. - - true if the connection is secured (SSL/TLS) - client that connected. - Stream used for communication - Used to create a . - Size of buffer to use when reading data. Must be at least 4096 bytes. - If fails - Stream must be writable and readable. - - - - Process incoming body bytes. - - - Bytes - - - - - - - - - - - Start reading content. - - - Make sure to call base.Start() if you override this method. - - - - - Clean up context. - - - Make sure to call base.Cleanup() if you override the method. - - - - - Disconnect from client - - error to report in the event. - - - BadRequestException. - - - - Send a response. - - Either or - HTTP status code - reason for the status code. - HTML body contents, can be null or empty. - A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty - If is invalid. - - - - Send a response. - - Either or - HTTP status code - reason for the status code. - - - - Send a response. - - - - - - send a whole buffer - - buffer to send - - - - - Send data using the stream - - Contains data to send - Start position in buffer - number of bytes to send - - - - - - This context have been cleaned, which means that it can be reused. - - - - - Context have been started (a new client have connected) - - - - - Overload to specify own type. - - - Must be specified before the context is being used. - - - - - Using SSL or other encryption method. - - - - - Using SSL or other encryption method. - - - - - Specify which logger to use. - - - - - Gets or sets the network stream. - - - - - Gets or sets IP address that the client connected from. - - - - - Gets or sets port that the client connected from. - - - - - The context have been disconnected. - - - Event can be used to clean up a context, or to reuse it. - - - - - A request have been received in the context. - - - - Class to handle loading of resource files - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - logger. - - - - Loads resources from a namespace in the given assembly to an URI - - The URI to map the resources to - The assembly in which the resources reside - The namespace from which to load the resources - - - resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); - - Will make the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/ - - The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded - If a resource has already been mapped to an uri - - - - Retrieves a stream for the specified resource path if loaded otherwise null - - Path to the resource to retrieve a stream for - A stream or null if the resource couldn't be found - - - - Fetch all files from the resource that matches the specified arguments. - - The path to the resource to extract - - a list of files if found; or an empty array if no files are found. - - Search path must end with an asterisk for finding arbitrary files - - - - Fetch all files from the resource that matches the specified arguments. - - Where the file should reside. - Files to check - - a list of files if found; or an empty array if no files are found. - - - - - Returns whether or not the loader has an instance of the file requested - - The name of the template/file - True if the loader can provide the file - - - - Small design by contract implementation. - - - - - Check whether a parameter is empty. - - Parameter value - Parameter name, or error description. - value is empty. - - - - Checks whether a parameter is null. - - Parameter value - Parameter name, or error description. - value is null. - - - - Checks whether a parameter is null. - - - Parameter value - Parameter name, or error description. - value is null. - - - - cookie being sent back to the browser. - - - - - - Constructor. - - cookie identifier - cookie content - cookie expiration date. Use DateTime.MinValue for session cookie. - id or content is null - id is empty - - - - Create a new cookie - - name identifying the cookie - cookie value - when the cookie expires. Setting DateTime.MinValue will delete the cookie when the session is closed. - Path to where the cookie is valid - Domain that the cookie is valid for. - - - - Create a new cookie - - Name and value will be used - when the cookie expires. - - - - Gets the cookie HTML representation. - - cookie string - - - - When the cookie expires. - DateTime.MinValue means that the cookie expires when the session do so. - - - - - Cookie is only valid under this path. - - - - - Used when the request line have been successfully parsed. - - - - - Initializes a new instance of the class. - - The HTTP method. - The URI path. - The HTTP version. - - - - Initializes a new instance of the class. - - - - - Gets or sets http method. - - - Should be one of the methods declared in . - - - - - Gets or sets the version of the HTTP protocol that the client want to use. - - - - - Gets or sets requested URI path. - - - - - Delegate used to find a realm/domain. - - - - - Realms are used during HTTP Authentication - - - - - - - A complete HTTP server, you need to add a module to it to be able to handle incoming requests. - - - - // this small example will add two web site modules, thus handling - // two different sites. In reality you should add Controller modules or something - // two the website modules to be able to handle different requests. - HttpServer server = new HttpServer(); - server.Add(new WebSiteModule("www.gauffin.com", "Gauffin Telecom AB")); - server.Add(new WebSiteModule("www.vapadi.se", "Remote PBX")); - - // start regular http - server.Start(IPAddress.Any, 80); - - // start https - server.Start(IPAddress.Any, 443, myCertificate); - - - - - - - - - Initializes a new instance of the class. - - Used to get all components used in the server.. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Form decoders are used to convert different types of posted data to the object types. - - - - - - Initializes a new instance of the class. - - A session store is used to save and retrieve sessions - - - - - Initializes a new instance of the class. - - The log writer. - - - - - Initializes a new instance of the class. - - Form decoders are used to convert different types of posted data to the object types. - The log writer. - - - - - - - Initializes a new instance of the class. - - Form decoders are used to convert different types of posted data to the object types. - A session store is used to save and retrieve sessions - The log writer. - - - - - - - - Adds the specified rule. - - The rule. - - - - Add a to the server. - - mode to add - - - - Decodes the request body. - - The request. - Failed to decode form data. - - - - Generate a HTTP error page (that will be added to the response body). - response status code is also set. - - Response that the page will be generated in. - . - response body contents. - - - - Generate a HTTP error page (that will be added to the response body). - response status code is also set. - - Response that the page will be generated in. - exception. - - - - Realms are used by the s. - - HTTP request - domain/realm. - - - - Process an incoming request. - - connection to client - request information - response that should be filled - session information - - - - Can be overloaded to implement stuff when a client have been connected. - - - Default implementation does nothing. - - client that disconnected - disconnect reason - - - - Handle authentication - - - - - true if request can be handled; false if not. - Invalid authorization header - - - - Will request authentication. - - - Sends respond to client, nothing else can be done with the response after this. - - - - - - - - Received from a when a request have been parsed successfully. - - that received the request. - The request. - - - - To be able to track request count. - - - - - - - Start the web server using regular HTTP. - - IP Address to listen on, use IpAddress.Any to accept connections on all IP addresses/network cards. - Port to listen on. 80 can be a good idea =) - address is null. - Port must be a positive number. - - - - Accept secure connections. - - IP Address to listen on, use to accept connections on all IP Addresses / network cards. - Port to listen on. 80 can be a good idea =) - Certificate to use - address is null. - Port must be a positive number. - - - - shut down the server and listeners - - - - - write an entry to the log file - - importance of the message - log message - - - - write an entry to the log file - - object that wrote the message - importance of the message - log message - - - - Server that is handling the current request. - - - Will be set as soon as a request arrives to the object. - - - - - Modules used for authentication. The module that is is added first is used as - the default authentication module. - - Use the corresponding property - in the if you are using multiple websites. - - - - Form decoder providers are used to decode request body (which normally contains form data). - - - - - Server name sent in HTTP responses. - - - Do NOT include version in name, since it makes it - easier for hackers. - - - - - Name of cookie where session id is stored. - - - - - Specified where logging should go. - - - - - - - - Number of connections that can wait to be accepted by the server. - - Default is 10. - - - - Gets or sets maximum number of allowed simultaneous requests. - - - - This property is useful in busy systems. The HTTP server - will start queuing new requests if this limit is hit, instead - of trying to process all incoming requests directly. - - - The default number if allowed simultaneous requests are 10. - - - - - - Gets or sets maximum number of requests queuing to be handled. - - - - The WebServer will start turning requests away if response code - to indicate that the server - is too busy to be able to handle the request. - - - - - - Realms are used during HTTP authentication. - Default realm is same as server name. - - - - - Let's to receive unhandled exceptions from the threads. - - - Exceptions will be thrown during debug mode if this event is not used, - exceptions will be printed to console and suppressed during release mode. - - - - - Serves files that are stored in embedded resources. - - - - - Initializes a new instance of the class. - Runs to make sure the basic mime types are available, they can be cleared later - through the use of if desired. - - - - - Initializes a new instance of the class. - Runs to make sure the basic mime types are available, they can be cleared later - through the use of if desired. - - The log writer to use when logging events - - - - Mimtypes that this class can handle per default - - - - - Loads resources from a namespace in the given assembly to an uri - - The uri to map the resources to - The assembly in which the resources reside - The namespace from which to load the resources - - resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); - - will make ie the resource MyLib.Models.User.Views.stylesheet.css accessible via /user/stylesheet.css - - The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded - - - - Returns true if the module can handle the request - - - - - Method that process the url - - Information sent by the browser about the request - Information that is being sent back to the client. - Session used to - true if this module handled the request. - - - - List with all mime-type that are allowed. - - All other mime types will result in a Forbidden http status code. - - - - Container to bind resource names to assemblies - - - - - Instantiates an instance of - - The dot seperated uri the resource maps to - The full resource name - The assembly the resource exists in - - - - Retrieves a stream to the resource - - Null if the resource couldn't be located somehow - - - - Retrieves the assembly the resource resides in - - - - - Retrieves the full name/path of the assembly - - - - - Retrieves the extension of the resource - - - - Returns the Uri without extension - - - Retrieves the full path name to the resource file - - - - Helpers making it easier to work with forms. - - - - - - Used to let the website use different JavaScript libraries. - Default is - - - - - Create a <form> tag. - - name of form - action to invoke on submit - form should be posted as Ajax - HTML code - - - // without options - WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); - - // with options - WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax, "style", "display:inline", "class", "greenForm"); - - - HTML attributes or JavaScript options. - Method will ALWAYS be POST. - options must consist of name, value, name, value - - - - Creates a select list with the values in a collection. - - Name of the SELECT-tag - collection used to generate options. - delegate used to return id and title from objects. - value that should be marked as selected. - First row should contain an empty value. - string containing a SELECT-tag. - - - - - Creates a select list with the values in a collection. - - Name of the SELECT-tag - Id of the SELECT-tag - collection used to generate options. - delegate used to return id and title from objects. - value that should be marked as selected. - First row should contain an empty value. - string containing a SELECT-tag. - - - - // Class that is going to be used in a SELECT-tag. - public class User - { - private readonly string _realName; - private readonly int _id; - public User(int id, string realName) - { - _id = id; - _realName = realName; - } - public string RealName - { - get { return _realName; } - } - - public int Id - { - get { return _id; } - } - } - - // Using an inline delegate to generate the select list - public void UserInlineDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - }, 2, true); - } - - // Using an method as delegate to generate the select list. - public void UseExternalDelegate() - { - List<User> items = new List<User>(); - items.Add(new User(1, "adam")); - items.Add(new User(2, "bertial")); - items.Add(new User(3, "david")); - string htmlSelect = Select("users", "users", items, UserOptions, 1, true); - } - - // delegate returning id and title - public static void UserOptions(object o, out object id, out object title) - { - User user = (User)o; - id = user.Id; - value = user.RealName; - } - - - name, id, collection or getIdTitle is null. - - - - Creates a select list with the values in a collection. - - Name of the SELECT-tag - Id of the SELECT-tag - collection used to generate options. - delegate used to return id and title from objects. - value that should be marked as selected. - First row should contain an empty value. - name, value collection of extra HTML attributes. - string containing a SELECT-tag. - - name, id, collection or getIdTitle is null. - Invalid HTML attribute list. - - - - Generate a list of HTML options - - collection used to generate options. - delegate used to return id and title from objects. - value that should be marked as selected. - First row should contain an empty value. - - collection or getIdTitle is null. - - - sb is null. - - - - Creates a check box. - - element name - element value - determines if the check box is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button - - - - Creates a check box. - - element name - element id - element value - determines if the check box is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button - - value in your business object. (check box will be selected if it matches the element value) - - - - - Creates a check box. - - element name - element id - determines if the check box is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button - will set value to "1". - - - - Creates a RadioButton. - - element name - element value - determines if the radio button is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button - - - - Creates a RadioButton. - - element name - element id - element value - determines if the radio button is selected or not. This is done differently depending on the - type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if - the box is checked or not. - a list with additional attributes (name, value, name, value). - a generated radio button - - - - form close tag - - - - - - Add a component instance - - Interface type - Instance to add - - - - Get a component. - - Interface type - Component if registered, otherwise null. - - Component will get created if needed. - - - - If instance cannot be created. - - - - Checks if the specified component interface have been added. - - - true if found; otherwise false. - - - - Add a component. - - Type being requested. - Type being created. - Type have already been mapped. - - - - Session store using memory for each session. - - - - - Initializes the class setting the expirationtimer to clean the session every minute - - - - - Delegate for the cleanup timer - - - - - Creates a new http session - - - - - - Creates a new http session with a specific id - - Id used to identify the new cookie.. - A object. - - Id should be generated by the store implementation if it's null or . - - - - - Load an existing session. - - - - - - - Save an updated session to the store. - - - - - - We use the flyweight pattern which reuses small objects - instead of creating new each time. - - EmptyLanguageNode (unused) session that should be reused next time Create is called. - - - - Remove expired sessions - - - - - Remove a session - - id of the session. - - - - Load a session from the store - - - null if session is not found. - - - - Number of minutes before a session expires. - Default is 20 minutes. - - - - - Used to queue incoming requests. - - - - - Initializes a new instance of the class. - - Called when a request should be processed. - - - - Used to process queued requests. - - - - - Gets or sets maximum number of allowed simultaneous requests. - - - - - Gets or sets maximum number of requests queuing to be handled. - - - - - Specifies how many requests the HTTP server is currently processing. - - - - - Used two queue incoming requests to avoid - thread starvation. - - - - - Method used to process a queued request - - Context that the request was received from. - Request to process. - - - - Response that is sent back to the web browser / client. - - - - A response can be sent if different ways. The easiest one is - to just fill the Body stream with content, everything else - will then be taken care of by the framework. The default content-type - is text/html, you should change it if you send anything else. - - The second and slightly more complex way is to send the response - as parts. Start with sending the header using the SendHeaders method and - then you can send the body using SendBody method, but do not forget - to set and before doing so. - - - - - // Example using response body. - class MyModule : HttpModule - { - public override bool Process(IHttpRequest request, IHttpResponse response, IHttpSession session) - { - StreamWriter writer = new StreamWriter(response.Body); - writer.WriteLine("Hello dear World!"); - writer.Flush(); - - // return true to tell webserver that we've handled the url - return true; - } - } - - - todo: add two examples, using SendHeaders/SendBody and just the Body stream. - - - - Initializes a new instance of the class. - - Client that send the . - Contains information of what the client want to receive. - cannot be empty. - - - - Initializes a new instance of the class. - - Client that send the . - Version of HTTP protocol that the client uses. - Type of HTTP connection used. - - - - Add another header to the document. - - Name of the header, case sensitive, use lower cases. - Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n - If headers already been sent. - If value conditions have not been met. - Adding any header will override the default ones and those specified by properties. - - - - Send headers and body to the browser. - - If content have already been sent. - - - - Make sure that you have specified and sent the headers first. - - - If headers have not been sent. - - offset of first byte to send - number of bytes to send. - - - This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low. - - - - Make sure that you have specified and sent the headers first. - - - If headers have not been sent. - - - - This method can be used if you want to send body contents without caching them first. This - is recommended for larger files to keep the memory usage low. - - - - Send headers to the client. - - If headers already been sent. - - - - - - - Redirect client to somewhere else using the 302 status code. - - Destination of the redirect - If headers already been sent. - You can not do anything more with the request when a redirect have been done. This should be your last - action. - - - - redirect to somewhere - - where the redirect should go - - No body are allowed when doing redirects. - - - - - The body stream is used to cache the body contents - before sending everything to the client. It's the simplest - way to serve documents. - - - - - The chunked encoding modifies the body of a message in order to - transfer it as a series of chunks, each with its own size indicator, - followed by an OPTIONAL trailer containing entity-header fields. This - allows dynamically produced content to be transferred along with the - information necessary for the recipient to verify that it has - received the full message. - - - - - Defines the version of the HTTP Response for applications where it's required - for this to be forced. - - - - - Kind of connection - - - - - Encoding to use when sending stuff to the client. - - Default is UTF8 - - - - Number of seconds to keep connection alive - - Only used if Connection property is set to . - - - - Status code that is sent to the client. - - Default is - - - - Information about why a specific status code was used. - - - - - Size of the body. MUST be specified before sending the header, - unless property Chunked is set to true. - - - - - Kind of content in the body - - Default type is "text/html" - - - - Headers have been sent to the client- - - You can not send any additional headers if they have already been sent. - - - - The whole response have been sent. - - - - - Cookies that should be created/changed. - - - - - Used to create and reuse contexts. - - - - - Used to create es. - - - - - Creates a that handles a connected client. - - Client socket (accepted by the ). - A creates . - - - - Create a secure . - - Client socket (accepted by the ). - HTTPS certificate to use. - Kind of HTTPS protocol. Usually TLS or SSL. - A created . - - - - A request have been received from one of the contexts. - - - - - Initializes a new instance of the class. - - The writer. - Amount of bytes to read from the incoming socket stream. - Used to create a request parser. - - - - Create a new context. - - true if socket is running HTTPS. - Client that connected - Network/SSL stream. - A context. - - - - Create a new context. - - true if HTTPS is used. - Remote client - Network stream, uses . - A new context (always). - - - - Create a secure . - - Client socket (accepted by the ). - HTTPS certificate to use. - Kind of HTTPS protocol. Usually TLS or SSL. - - A created . - - - - - Creates a that handles a connected client. - - Client socket (accepted by the ). - - A creates . - - - - - True if detailed trace logs should be written. - - - - - A request have been received from one of the contexts. - - - - - Custom network stream to mark sockets as reusable when disposing the stream. - - - - - Creates a new instance of the class for the specified . - - - The that the will use to send and receive data. - - - The parameter is null. - - - The parameter is not connected. - -or- - The property of the parameter is not . - -or- - The parameter is in a nonblocking state. - - - - - Initializes a new instance of the class for the specified with the specified ownership. - - - The that the will use to send and receive data. - - - Set to true to indicate that the will take ownership of the ; otherwise, false. - - - The parameter is null. - - - The parameter is not connected. - -or- - the value of the property of the parameter is not . - -or- - the parameter is in a nonblocking state. - - - - - Creates a new instance of the class for the specified with the specified access rights. - - - The that the will use to send and receive data. - - - A bitwise combination of the values that specify the type of access given to the over the provided . - - - The parameter is null. - - - The parameter is not connected. - -or- - the property of the parameter is not . - -or- - the parameter is in a nonblocking state. - - - - - Creates a new instance of the class for the specified with the specified access rights and the specified ownership. - - - The that the will use to send and receive data. - - - A bitwise combination of the values that specifies the type of access given to the over the provided . - - - Set to true to indicate that the will take ownership of the ; otherwise, false. - - - The parameter is null. - - - The parameter is not connected. - -or- - The property of the parameter is not . - -or- - The parameter is in a nonblocking state. - - - - - Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. - - - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - + + + + HttpServer_OpenSim + + + + + A session store is used to store and load sessions on a media. + The default implementation () saves/retrieves sessions from memory. + + + + + Creates a new http session with a generated id. + + A object + + + + Creates a new http session with a specific id + + Id used to identify the new cookie.. + A object. + + Id should be generated by the store implementation if it's null or . + + + + + Load an existing session. + + Session id (usually retrieved from a client side cookie). + A session if found; otherwise null. + + + + Save an updated session to the store. + + Session id (usually retrieved from a client side cookie). + If Id property have not been specified. + + + + We use the flyweight pattern which reuses small objects + instead of creating new each time. + + Unused session that should be reused next time Create is called. + + + + Remove expired sessions + + + + + Remove a session + + id of the session. + + + + Load a session from the store + + + null if session is not found. + + + + Number of minutes before a session expires. + + Default time is 20 minutes. + + + + Contains server side HTTP request information. + + + + + Called during parsing of a . + + Name of the header, should not be URL encoded + Value of the header, should not be URL encoded + If a header is incorrect. + + + + Add bytes to the body + + buffer to read bytes from + where to start read + number of bytes to read + Number of bytes actually read (same as length unless we got all body bytes). + If body is not writable + bytes is null. + offset is out of range. + + + + Clear everything in the request + + + + + Decode body into a form. + + A list with form decoders. + If body contents is not valid for the chosen decoder. + If body is still being transferred. + + + + Sets the cookies. + + The cookies. + + + + Create a response object. + + Context for the connected client. + A new . + + + + Gets kind of types accepted by the client. + + + + + Gets or sets body stream. + + + + + Gets whether the body is complete. + + + + + Gets or sets kind of connection used for the session. + + + + + Gets or sets number of bytes in the body. + + + + + Gets cookies that was sent with the request. + + + + + Gets form parameters. + + + + + Gets headers sent by the client. + + + + + Gets or sets version of HTTP protocol that's used. + + + Probably or . + + + + + + Gets whether the request was made by Ajax (Asynchronous JavaScript) + + + + + Gets or sets requested method. + + + Will always be in upper case. + + + + + + Gets parameter from or . + + + + + Gets variables sent in the query string + + + + + Gets or sets requested URI. + + + + + Gets URI absolute path divided into parts. + + + // URI is: http://gauffin.com/code/tiny/ + Console.WriteLine(request.UriParts[0]); // result: code + Console.WriteLine(request.UriParts[1]); // result: tiny + + + If you're using controllers than the first part is controller name, + the second part is method name and the third part is Id property. + + + + + + Gets or sets path and query. + + + + Are only used during request parsing. Cannot be set after "Host" header have been + added. + + + + + Class that receives Requests from a . + + + + + Client have been disconnected. + + Client that was disconnected. + Reason + + + + + Invoked when a client context have received a new HTTP request + + Client that received the request. + Request that was received. + + + + + Delegate used by to populate select options. + + current object (for instance a User). + Text that should be displayed in the value part of a <optiongt;-tag. + Text shown in the select list. + + // Class that is going to be used in a SELECT-tag. + public class User + { + private readonly string _realName; + private readonly int _id; + public User(int id, string realName) + { + _id = id; + _realName = realName; + } + public string RealName + { + get { return _realName; } + } + + public int Id + { + get { return _id; } + } + } + + // Using an inline delegate to generate the select list + public void UserInlineDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + }, 2, true); + } + + // Using an method as delegate to generate the select list. + public void UseExternalDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, UserOptions, 1, true); + } + + // delegate returning id and title + public static void UserOptions(object o, out object id, out object title) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + } /// + + + + The server understood the request, but is refusing to fulfill it. + Authorization will not help and the request SHOULD NOT be repeated. + If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, + it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information + available to the client, the status code 404 (Not Found) can be used instead. + + Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php + + + + + All HTTP based exceptions will derive this class. + + + + + Create a new HttpException + + http status code (sent in the response) + error description + + + + Create a new HttpException + + http status code (sent in the response) + error description + inner exception + + + + status code to use in the response. + + + + + Initializes a new instance of the class. + + error message + + + + A session stored in memory. + + + + + Interface for sessions + + + + + Remove everything from the session + + + + + Remove everything from the session + + True if the session is cleared due to expiration + + + + Session id + + + + + Should + + Name of the session variable + null if it's not set + If the object cant be serialized. + + + + When the session was last accessed. + This property is touched by the http server each time the + session is requested. + + + + + Number of session variables. + + + + + Event triggered upon clearing the session + + + + + + + A unique id used by the sessions store to identify the session + + + + Id + + + + + + Remove everything from the session + + + + + Clears the specified expire. + + True if the session is cleared due to expiration + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + 2 + + + + Session id + + + + + Should + + Name of the session variable + null if it's not set + + + + when the session was last accessed. + + + Used to determine when the session should be removed. + + + + + Number of values in the session + + + + + Flag to indicate that the session have been changed + and should be saved into the session store. + + + + + Event triggered upon clearing the session + + + + + cookie being sent back to the browser. + + + + + + cookie sent by the client/browser + + + + + + Constructor. + + cookie identifier + cookie content + id or content is null + id is empty + + + + Gets the cookie HTML representation. + + cookie string + + + + Gets the cookie identifier. + + + + + Cookie value. Set to null to remove cookie. + + + + + Constructor. + + cookie identifier + cookie content + cookie expiration date. Use DateTime.MinValue for session cookie. + id or content is null + id is empty + + + + Create a new cookie + + name identifying the cookie + cookie value + when the cookie expires. Setting DateTime.MinValue will delete the cookie when the session is closed. + Path to where the cookie is valid + Domain that the cookie is valid for. + + + + Create a new cookie + + Name and value will be used + when the cookie expires. + + + + Gets the cookie HTML representation. + + cookie string + + + + When the cookie expires. + DateTime.MinValue means that the cookie expires when the session do so. + + + + + Cookie is only valid under this path. + + + + + Contains a connection to a browser/client. + + + + + Disconnect from client + + error to report in the event. + + + + Send a response. + + Either or + HTTP status code + reason for the status code. + HTML body contents, can be null or empty. + A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty + If is invalid. + + + + Send a response. + + Either or + HTTP status code + reason for the status code. + + + + Send a response. + + + + + + send a whole buffer + + buffer to send + + + + + Send data using the stream + + Contains data to send + Start position in buffer + number of bytes to send + + + + + + Closes the streams and disposes of the unmanaged resources + + + + + Using SSL or other encryption method. + + + + + Using SSL or other encryption method. + + + + + The context have been disconnected. + + + Event can be used to clean up a context, or to reuse it. + + + + + A request have been received in the context. + + + + + A have been disconnected. + + + + + Initializes a new instance of the class. + + Reason to disconnection. + + + + Gets reason to why client disconnected. + + + + + + + + + + Initializes a new instance of the class. + + The request. + + + + Gets received request. + + + + + Contains a listener that doesn't do anything with the connections. + + + + + Listen for regular HTTP connections + + IP Address to accept connections on + TCP Port to listen on, default HTTP port is 80. + Factory used to create es. + address is null. + Port must be a positive number. + + + + Initializes a new instance of the class. + + IP Address to accept connections on + TCP Port to listen on, default HTTPS port is 443 + Factory used to create es. + Certificate to use + + + + Initializes a new instance of the class. + + IP Address to accept connections on + TCP Port to listen on, default HTTPS port is 443 + Factory used to create es. + Certificate to use + which HTTPS protocol to use, default is TLS. + + + Exception. + + + + Will try to accept connections one more time. + + If any exceptions is thrown. + + + + Can be used to create filtering of new connections. + + Accepted socket + true if connection can be accepted; otherwise false. + + + + Start listen for new connections + + Number of connections that can stand in a queue to be accepted. + Listener have already been started. + + + + Stop the listener + + + + + + Gives you a change to receive log entries for all internals of the HTTP library. + + + You may not switch log writer after starting the listener. + + + + + True if we should turn on trace logs. + + + + + Catch exceptions not handled by the listener. + + + Exceptions will be thrown during debug mode if this event is not used, + exceptions will be printed to console and suppressed during release mode. + + + + + A request have been received from a . + + + + + + + + http://www.faqs.org/rfcs/rfc1867.html + + + + + Interface for form content decoders. + + + + + + + Stream containing the content + Content type (with any additional info like boundry). Content type is always supplied in lower case + Stream enconding + A http form, or null if content could not be parsed. + If contents in the stream is not valid input data. + + + + Checks if the decoder can handle the mime type + + Content type (with any additional info like boundry). Content type is always supplied in lower case. + True if the decoder can parse the specified content type + + + + multipart/form-data + + + + + form-data + + + + + + + Stream containing the content + Content type (with any additional info like boundry). Content type is always supplied in lower case + Stream enconding + A http form, or null if content could not be parsed. + If contents in the stream is not valid input data. + If any parameter is null + + + + Checks if the decoder can handle the mime type + + Content type (with any additional info like boundry). Content type is always supplied in lower case. + True if the decoder can parse the specified content type + + + + The requested resource was not found in the web server. + + + + + Create a new exception + + message describing the error + inner exception + + + + Create a new exception + + message describing the error + + + + Delegate used to let authentication modules authenticate the user name and password. + + Realm that the user want to authenticate in + User name specified by client + Can either be user password or implementation specific token. + object that will be stored in a session variable called if authentication was successful. + throw forbidden exception if too many attempts have been made. + + + Use to specify that the token is a HA1 token. (MD5 generated + string from realm, user name and password); Md5String(userName + ":" + realm + ":" + password); + + + + + + Let's you decide on a system level if authentication is required. + + HTTP request from client + true if user should be authenticated. + throw if no more attempts are allowed. + If no more attempts are allowed + + + + Authentication modules are used to implement different + kind of HTTP authentication. + + + + + Tag used for authentication. + + + + + Initializes a new instance of the class. + + Delegate used to provide information used during authentication. + Delegate used to determine if authentication is required (may be null). + + + + Initializes a new instance of the class. + + Delegate used to provide information used during authentication. + + + + Create a response that can be sent in the WWW-Authenticate header. + + Realm that the user should authenticate in + Array with optional options. + A correct authentication request. + If realm is empty or null. + + + + An authentication response have been received from the web browser. + Check if it's correct + + Contents from the Authorization header + Realm that should be authenticated + GET/POST/PUT/DELETE etc. + options to specific implementations + Authentication object that is stored for the request. A user class or something like that. + if is invalid + If any of the parameters is empty or null. + + + + Used to invoke the authentication delegate that is used to lookup the user name/realm. + + Realm (domain) that user want to authenticate in + User name + Password used for validation. Some implementations got password in clear text, they are then sent to client. + object that will be stored in the request to help you identify the user if authentication was successful. + true if authentication was successful + + + + Determines if authentication is required. + + HTTP request from browser + true if user should be authenticated. + throw from your delegate if no more attempts are allowed. + If no more attempts are allowed + + + + name used in HTTP request. + + + + + Contains some kind of input from the browser/client. + can be QueryString, form data or any other request body content. + + + + + Base class for request data containers + + + + + Adds a parameter mapped to the presented name + + The name to map the parameter to + The parameter value + + + + Returns true if the container contains the requested parameter + + Parameter id + True if parameter exists + + + + Returns a request parameter + + The name associated with the parameter + + + + Representation of a non-initialized class instance + + + Variable telling the class that it is non-initialized + + + + Initializes a new instance of the class. + + form name. + + + + Initializes a new instance of the class. + + form name. + if set to true all changes will be ignored. + this constructor should only be used by Empty + + + Creates a deep copy of the HttpInput class + The object to copy + The function makes a deep copy of quite a lot which can be slow + + + + Add a new element. Form array elements are parsed + and added in a correct hierarchy. + + Name is converted to lower case. + + name is null. + Cannot add stuff to . + + + + Returns true if the class contains a with the corresponding name. + + The field/query string name + True if the value exists + + + + Parses an item and returns it. + This function is primarily used to parse array items as in user[name]. + + + + + + + Outputs the instance representing all its values joined together + + + + Returns all items as an unescaped query string. + + + + + Extracts one parameter from an array + + Containing the string array + All but the first value + + string test1 = ExtractOne("system[user][extension][id]"); + string test2 = ExtractOne(test1); + string test3 = ExtractOne(test2); + // test1 = user[extension][id] + // test2 = extension[id] + // test3 = id + + + + Resets all data contained by class + + + + Returns an enumerator that iterates through the collection. + + + + A that can be used to iterate through the collection. + + 1 + + + + Returns an enumerator that iterates through a collection. + + + + An object that can be used to iterate through the collection. + + 2 + + + + Form name as lower case + + + + + Get a form item. + + + Returns if item was not found. + + + + Small design by contract implementation. + + + + + Check whether a parameter is empty. + + Parameter value + Parameter name, or error description. + value is empty. + + + + Checks whether a parameter is null. + + Parameter value + Parameter name, or error description. + value is null. + + + + Checks whether a parameter is null. + + + Parameter value + Parameter name, or error description. + value is null. + + + + Contains all HTTP Methods (according to the HTTP 1.1 specification) + + See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + + + + + + The DELETE method requests that the origin server delete the resource identified by the Request-URI. + + + + This method MAY be overridden by human intervention (or other means) on the origin server. + The client cannot be guaranteed that the operation has been carried out, even if the status code + returned from the origin server indicates that the action has been completed successfully. + + + However, the server SHOULD NOT indicate success unless, at the time the response is given, + it intends to delete the resource or move it to an inaccessible location. + + + A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, + 202 (Accepted) if the action has not yet been enacted, + or 204 (No Content) if the action has been enacted but the response does not include an entity. + + + If the request passes through a cache and the Request-URI identifies one or more currently cached entities, + those entries SHOULD be treated as stale. Responses to this method are not cacheable. + + + + + + The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. + + + + If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the + entity in the response and not the source text of the process, unless that text happens to be the output of the process. + + + The semantics of the GET method change to a "conditional GET" if the request message includes an + If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. + A conditional GET method requests that the entity be transferred only under the circumstances described + by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network + usage by allowing cached entities to be refreshed without requiring multiple requests or transferring + data already held by the client. + + + + + + The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. + + + The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the + information sent in response to a GET request. This method can be used for obtaining meta information about + the entity implied by the request without transferring the entity-body itself. + + This method is often used for testing hypertext links for validity, accessibility, and recent modification. + + + + + The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. + + + This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. + + + + + The POST method is used to request that the origin server accept the entity enclosed + in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. + + + POST is designed to allow a uniform method to cover the following functions: + + + Annotation of existing resources; + + Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; + + Providing a block of data, such as the result of submitting a form, to a data-handling process; + + Extending a database through an append operation. + + + + If a resource has been created on the origin server, the response SHOULD be 201 (Created) and + contain an entity which describes the status of the request and refers to the new resource, and a + Location header (see section 14.30). + + + The action performed by the POST method might not result in a resource that can be identified by a URI. + In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on + whether or not the response includes an entity that describes the result. + + Responses to this method are not cacheable, unless the response includes appropriate Cache-Control + or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent + to retrieve a cacheable resource. + + + + + + The PUT method requests that the enclosed entity be stored under the supplied Request-URI. + + + + + If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a + modified version of the one residing on the origin server. + + If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new + resource by the requesting user agent, the origin server can create the resource with that URI. + + If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. + + If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to + indicate successful completion of the request. + + If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be + given that reflects the nature of the problem. + + + + The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not + understand or implement and MUST return a 501 (Not Implemented) response in such cases. + + + + + + The TRACE method is used to invoke a remote, application-layer loop- back of the request message. + + + + + Contains all HTTP Methods (according to the HTTP 1.1 specification) + + See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + + + + + + The DELETE method requests that the origin server delete the resource identified by the Request-URI. + + + + This method MAY be overridden by human intervention (or other means) on the origin server. + The client cannot be guaranteed that the operation has been carried out, even if the status code + returned from the origin server indicates that the action has been completed successfully. + + + However, the server SHOULD NOT indicate success unless, at the time the response is given, + it intends to delete the resource or move it to an inaccessible location. + + + A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, + 202 (Accepted) if the action has not yet been enacted, + or 204 (No Content) if the action has been enacted but the response does not include an entity. + + + If the request passes through a cache and the Request-URI identifies one or more currently cached entities, + those entries SHOULD be treated as stale. Responses to this method are not cacheable. + + + + + + The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. + + + + If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the + entity in the response and not the source text of the process, unless that text happens to be the output of the process. + + + The semantics of the GET method change to a "conditional GET" if the request message includes an + If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. + A conditional GET method requests that the entity be transferred only under the circumstances described + by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network + usage by allowing cached entities to be refreshed without requiring multiple requests or transferring + data already held by the client. + + + + + + The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. + + + The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the + information sent in response to a GET request. This method can be used for obtaining meta information about + the entity implied by the request without transferring the entity-body itself. + + This method is often used for testing hypertext links for validity, accessibility, and recent modification. + + + + + The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. + + + This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. + + + + + The POST method is used to request that the origin server accept the entity enclosed + in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. + + + POST is designed to allow a uniform method to cover the following functions: + + + Annotation of existing resources; + + Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; + + Providing a block of data, such as the result of submitting a form, to a data-handling process; + + Extending a database through an append operation. + + + + If a resource has been created on the origin server, the response SHOULD be 201 (Created) and + contain an entity which describes the status of the request and refers to the new resource, and a + Location header (see section 14.30). + + + The action performed by the POST method might not result in a resource that can be identified by a URI. + In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on + whether or not the response includes an entity that describes the result. + + Responses to this method are not cacheable, unless the response includes appropriate Cache-Control + or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent + to retrieve a cacheable resource. + + + + + + The PUT method requests that the enclosed entity be stored under the supplied Request-URI. + + + + + If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a + modified version of the one residing on the origin server. + + If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new + resource by the requesting user agent, the origin server can create the resource with that URI. + + If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. + + If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to + indicate successful completion of the request. + + If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be + given that reflects the nature of the problem. + + + + The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not + understand or implement and MUST return a 501 (Not Implemented) response in such cases. + + + + + + The TRACE method is used to invoke a remote, application-layer loop- back of the request message. + + + + + Priority for log entries + + + + + + Very detailed logs to be able to follow the flow of the program. + + + + + Logs to help debug errors in the application + + + + + Information to be able to keep track of state changes etc. + + + + + Something did not go as we expected, but it's no problem. + + + + + Something that should not fail failed, but we can still keep + on going. + + + + + Something failed, and we cannot handle it properly. + + + + + Interface used to write to log files. + + + + + Write an entry to the log file. + + object that is writing to the log + importance of the log message + the message + + + + This class writes to the console. It colors the output depending on the logprio and includes a 3-level stacktrace (in debug mode) + + + + + + The actual instance of this class. + + + + + Logwriters the specified source. + + object that wrote the logentry. + Importance of the log message + The message. + + + + Get color for the specified logprio + + prio for the log entry + A for the prio + + + + Default log writer, writes everything to null (nowhere). + + + + + + The logging instance. + + + + + Writes everything to null + + object that wrote the log entry. + Importance of the log message + The message. + + + + Inversion of control interface. + + + + + Add a component instance + + Interface type + Instance to add + + + + Get a component. + + Interface type + Component if registered, otherwise null. + + Component will get created if needed. + + + + + Checks if the specified component interface have been added. + + + true if found; otherwise false. + + + + Add a component. + + Type being requested. + Type being created. + + + + Returns item either from a form or a query string (checks them in that order) + + + + Representation of a non-initialized HttpParam + + + Initialises the class to hold a value either from a post request or a querystring request + + + + The add method is not availible for HttpParam + since HttpParam checks both Request.Form and Request.QueryString + + name identifying the value + value to add + + + + + Checks whether the form or querystring has the specified value + + Name, case sensitive + true if found; otherwise false. + + + + Returns an enumerator that iterates through the collection. + + + + A that can be used to iterate through the collection. + + 1 + + + + Returns an enumerator that iterates through a collection. + + + + An object that can be used to iterate through the collection. + + 2 + + + + Fetch an item from the form or querystring (in that order). + + + Item if found; otherwise HttpInputItem.EmptyLanguageNode + + + Container for posted form data + + + Instance to help mark a non-initialized form + + + Initializes a form container with the specified name + + + + Makes a deep copy of the input + + The input to copy + + + + Adds a file to the collection of posted files + + The file to add + If the file is already added + If file is null + If the instance is HttpForm.EmptyForm which cannot be modified + + + + Checks if the form contains a specified file + + Field name of the file parameter + True if the file exists + If the instance is HttpForm.EmptyForm which cannot be modified + + + + Retrieves a file held by by the form + + The identifier of the file + The requested file or null if the file was not found + If name is null or empty + If the instance is HttpForm.EmptyForm which cannot be modified + + + Disposes all held HttpFile's and resets values + + + + Retrieves the number of files added to the + + 0 if no files are added + + + + The object form class takes an object and creates form items for it. + + + + + Initializes a new instance of the class. + + + form name *and* id. + action to do when form is posted. + + + + + Initializes a new instance of the class. + + form name *and* id. + action to do when form is posted. + object to get values from + + + + Initializes a new instance of the class. + + form action. + object to get values from. + + + + write out the FORM-tag. + + generated html code + + + + Writeout the form tag + + form should be posted through ajax. + generated html code + + + + Generates a text box. + + + + generated html code + + + + password box + + + + generated html code + + + + Hiddens the specified property name. + + Name of the property. + The options. + generated html code + + + + Labels the specified property name. + + property in object. + caption + generated html code + + + + Generate a checkbox + + property in object + checkbox value + additional html attributes. + generated html code + + + + Write a html select tag + + object property. + id column + The title column. + The options. + + + + + Selects the specified property name. + + Name of the property. + The items. + The id column. + The title column. + The options. + + + + + Write a submit tag. + + button caption + html submit tag + + + + html end form tag + + html + + + + This provider is used to let us implement any type of form decoding we want without + having to rewrite anything else in the server. + + + + + + + Should contain boundary and type, as in: multipart/form-data; boundary=---------------------------230051238959 + Stream containing form data. + Encoding used when decoding the stream + if no parser was found. + If stream is null or not readable. + If stream contents cannot be decoded properly. + + + + Add a decoder. + + + + + + + Number of added decoders. + + + + + Use with care. + + + + + Decoder used for unknown content types. + + + + + We dont want to let the server to die due to exceptions thrown in worker threads. + therefore we use this delegate to give you a change to handle uncaught exceptions. + + Class that the exception was thrown in. + Exception + + Server will throw a InternalServerException in release version if you dont + handle this delegate. + + + + + Contains a connection to a browser/client. + + + Remember to after you have hooked the event. + + TODO: Maybe this class should be broken up into HttpClientChannel and HttpClientContext? + + + + Initializes a new instance of the class. + + true if the connection is secured (SSL/TLS) + client that connected. + Stream used for communication + Used to create a . + Size of buffer to use when reading data. Must be at least 4096 bytes. + If fails + Stream must be writable and readable. + + + + Process incoming body bytes. + + + Bytes + + + + + + + + + + + Start reading content. + + + Make sure to call base.Start() if you override this method. + + + + + Clean up context. + + + Make sure to call base.Cleanup() if you override the method. + + + + + Disconnect from client + + error to report in the event. + + + + Send a response. + + Either or + HTTP status code + reason for the status code. + HTML body contents, can be null or empty. + A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty + If is invalid. + + + + Send a response. + + Either or + HTTP status code + reason for the status code. + + + + Send a response. + + + + + + send a whole buffer + + buffer to send + + + + + Send data using the stream + + Contains data to send + Start position in buffer + number of bytes to send + + + + + + This context have been cleaned, which means that it can be reused. + + + + + Context have been started (a new client have connected) + + + + + Overload to specify own type. + + + Must be specified before the context is being used. + + + + + Using SSL or other encryption method. + + + + + Using SSL or other encryption method. + + + + + Specify which logger to use. + + + + + Gets or sets the network stream. + + + + + Gets or sets IP address that the client connected from. + + + + + Gets or sets port that the client connected from. + + + + + The context have been disconnected. + + + Event can be used to clean up a context, or to reuse it. + + + + + A request have been received in the context. + + + + + Helpers to make XML handling easier + + + + + Serializes object to XML. + + object to serialize. + XML + + Removes name spaces and adds indentation + + + + + Create an object from a XML string + + Type of object + XML string + object + + + + Can handle application/x-www-form-urlencoded + + + + + + Stream containing the content + Content type (with any additional info like boundry). Content type is always supplied in lower case + Stream encoding + + A HTTP form, or null if content could not be parsed. + + If contents in the stream is not valid input data. + + + + Checks if the decoder can handle the mime type + + Content type (with any additional info like boundry). Content type is always supplied in lower case. + True if the decoder can parse the specified content type + + + + Invoked when a client have been accepted by the + + + Can be used to revoke incoming connections + + + + + Initializes a new instance of the class. + + The socket. + + + + Client may not be handled. + + + + + Accepted socket. + + + + + Client should be revoked. + + + + + Arguments sent when a is cleared + + + + + Instantiates the arguments for the event + + True if the session is cleared due to expiration + + + + Returns true if the session is cleared due to expiration + + + + + Delegate for when a IHttpSession is cleared + + this is being cleared. + Arguments for the clearing + + + + Event arguments used when a new header have been parsed. + + + + + Initializes a new instance of the class. + + Name of header. + Header value. + + + + Initializes a new instance of the class. + + + + + Gets or sets header name. + + + + + Gets or sets header value. + + + + Class to handle loading of resource files + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + logger. + + + + Loads resources from a namespace in the given assembly to an URI + + The URI to map the resources to + The assembly in which the resources reside + The namespace from which to load the resources + + + resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); + + Will make the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/ + + The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded + If a resource has already been mapped to an uri + + + + Retrieves a stream for the specified resource path if loaded otherwise null + + Path to the resource to retrieve a stream for + A stream or null if the resource couldn't be found + + + + Fetch all files from the resource that matches the specified arguments. + + The path to the resource to extract + + a list of files if found; or an empty array if no files are found. + + Search path must end with an asterisk for finding arbitrary files + + + + Fetch all files from the resource that matches the specified arguments. + + Where the file should reside. + Files to check + + a list of files if found; or an empty array if no files are found. + + + + + Returns whether or not the loader has an instance of the file requested + + The name of the template/file + True if the loader can provide the file + + + + redirects from one URL to another. + + + + + Rules are used to perform operations before a request is being handled. + Rules can be used to create routing etc. + + + + + Process the incoming request. + + incoming HTTP request + outgoing HTTP response + true if response should be sent to the browser directly (no other rules or modules will be processed). + + returning true means that no modules will get the request. Returning true is typically being done + for redirects. + + If request or response is null. + + + + Initializes a new instance of the class. + + Absolute path (no server name) + Absolute path (no server name) + + server.Add(new RedirectRule("/", "/user/index")); + + + + + Initializes a new instance of the class. + + Absolute path (no server name) + Absolute path (no server name) + true if request should be redirected, false if the request URI should be replaced. + + server.Add(new RedirectRule("/", "/user/index")); + + + + + Process the incoming request. + + incoming HTTP request + outgoing HTTP response + true if response should be sent to the browser directly (no other rules or modules will be processed). + + returning true means that no modules will get the request. Returning true is typically being done + for redirects. + + + + + Gets string to match request URI with. + + Is compared to request.Uri.AbsolutePath + + + + Gets where to redirect. + + + + + Gets whether server should redirect client. + + + false means that the rule will replace + the current request URI with the new one from this class. + true means that a redirect response is sent to the client. + + + + + Used to queue incoming requests. + + + + + Initializes a new instance of the class. + + Called when a request should be processed. + + + + Used to process queued requests. + + + + + Gets or sets maximum number of allowed simultaneous requests. + + + + + Gets or sets maximum number of requests queuing to be handled. + + + + + Specifies how many requests the HTTP server is currently processing. + + + + + Used two queue incoming requests to avoid + thread starvation. + + + + + Method used to process a queued request + + Context that the request was received from. + Request to process. + + + + Parses a HTTP request directly from a stream + + + + + Event driven parser used to parse incoming HTTP requests. + + + The parser supports partial messages and keeps the states between + each parsed buffer. It's therefore important that the parser gets + ed if a client disconnects. + + + + + Parse partial or complete message. + + buffer containing incoming bytes + where in buffer that parsing should start + number of bytes to parse + Unparsed bytes left in buffer. + BadRequestException. + + + + Clear parser state. + + + + + Current state in parser. + + + + + A request have been successfully parsed. + + + + + More body bytes have been received. + + + + + Request line have been received. + + + + + A header have been received. + + + + + Gets or sets the log writer. + + + + + Create a new request parser + + delegate receiving log entries. + + + + Add a number of bytes to the body + + buffer containing more body bytes. + starting offset in buffer + number of bytes, from offset, to read. + offset to continue from. + + + + Remove all state information for the request. + + + + + Parse request line + + + If line is incorrect + Expects the following format: "Method SP Request-URI SP HTTP-Version CRLF" + + + + We've parsed a new header. + + Name in lower case + Value, unmodified. + If content length cannot be parsed. + + + + Parse a message + + bytes to parse. + where in buffer that parsing should start + number of bytes to parse, starting on . + offset (where to start parsing next). + BadRequestException. + + + + Gets or sets the log writer. + + + + + Current state in parser. + + + + + A request have been successfully parsed. + + + + + More body bytes have been received. + + + + + Request line have been received. + + + + + A header have been received. + + + + + Response that is sent back to the web browser / client. + + A response can be sent if different ways. The easiest one is + to just fill the Body stream with content, everything else + will then be taken care of by the framework. The default content-type + is text/html, you should change it if you send anything else. + + The second and slighty more complex way is to send the response + as parts. Start with sending the header using the SendHeaders method and + then you can send the body using SendBody method, but do not forget + to set ContentType and ContentLength before doing so. + + + public void MyHandler(IHttpRequest request, IHttpResponse response) + { + + } + + + + + Add another header to the document. + + Name of the header, case sensitive, use lower cases. + Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n + If headers already been sent. + If value conditions have not been met. + Adding any header will override the default ones and those specified by properties. + + + + Send headers and body to the browser. + + If content have already been sent. + + + + Make sure that you have specified ContentLength and sent the headers first. + + + If headers have not been sent. + + offest of first byte to send + number of bytes to send. + + + This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low. + + + + Make sure that you have specified ContentLength and sent the headers first. + + + If headers have not been sent. + + + + This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low. + + + + Send headers to the client. + + If headers already been sent. + + + + + + + Redirect client to somewhere else using the 302 status code. + + Destination of the redirect + If headers already been sent. + You can not do anything more with the request when a redirect have been done. This should be your last + action. + + + + redirect to somewhere + + where the redirect should go + + No body are allowed when doing redirects. + + + + + The body stream is used to cache the body contents + before sending everything to the client. It's the simplest + way to serve documents. + + + + + Defines the version of the HTTP Response for applications where it's required + for this to be forced. + + + + + The chunked encoding modifies the body of a message in order to + transfer it as a series of chunks, each with its own size indicator, + followed by an OPTIONAL trailer containing entity-header fields. This + allows dynamically produced content to be transferred along with the + information necessary for the recipient to verify that it has + received the full message. + + + + + Kind of connection + + + + + Encoding to use when sending stuff to the client. + + Default is UTF8 + + + + Number of seconds to keep connection alive + + Only used if Connection property is set to ConnectionType.KeepAlive + + + + Status code that is sent to the client. + + Default is HttpStatusCode.Ok + + + + Information about why a specific status code was used. + + + + + Size of the body. MUST be specified before sending the header, + unless property Chunked is set to true. + + + + + Kind of content in the body + + Default is text/html + + + + Headers have been sent to the client- + + You can not send any additional headers if they have already been sent. + + + + The whole response have been sent. + + + + + Cookies that should be created/changed. + + + + + Type of HTTP connection + + + + + Connection is closed after each request-response + + + + + Connection is kept alive for X seconds (unless another request have been made) + + + + + Response that is sent back to the web browser / client. + + + + A response can be sent if different ways. The easiest one is + to just fill the Body stream with content, everything else + will then be taken care of by the framework. The default content-type + is text/html, you should change it if you send anything else. + + The second and slightly more complex way is to send the response + as parts. Start with sending the header using the SendHeaders method and + then you can send the body using SendBody method, but do not forget + to set and before doing so. + + + + + // Example using response body. + class MyModule : HttpModule + { + public override bool Process(IHttpRequest request, IHttpResponse response, IHttpSession session) + { + StreamWriter writer = new StreamWriter(response.Body); + writer.WriteLine("Hello dear World!"); + writer.Flush(); + + // return true to tell webserver that we've handled the url + return true; + } + } + + + todo: add two examples, using SendHeaders/SendBody and just the Body stream. + + + + Initializes a new instance of the class. + + Client that send the . + Contains information of what the client want to receive. + cannot be empty. + + + + Initializes a new instance of the class. + + Client that send the . + Version of HTTP protocol that the client uses. + Type of HTTP connection used. + + + + Add another header to the document. + + Name of the header, case sensitive, use lower cases. + Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n + If headers already been sent. + If value conditions have not been met. + Adding any header will override the default ones and those specified by properties. + + + + Send headers and body to the browser. + + If content have already been sent. + + + + Make sure that you have specified and sent the headers first. + + + If headers have not been sent. + + offset of first byte to send + number of bytes to send. + + + This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low. + + + + Make sure that you have specified and sent the headers first. + + + If headers have not been sent. + + + + This method can be used if you want to send body contents without caching them first. This + is recommended for larger files to keep the memory usage low. + + + + Send headers to the client. + + If headers already been sent. + + + + + + + Redirect client to somewhere else using the 302 status code. + + Destination of the redirect + If headers already been sent. + You can not do anything more with the request when a redirect have been done. This should be your last + action. + + + + redirect to somewhere + + where the redirect should go + + No body are allowed when doing redirects. + + + + + The body stream is used to cache the body contents + before sending everything to the client. It's the simplest + way to serve documents. + + + + + The chunked encoding modifies the body of a message in order to + transfer it as a series of chunks, each with its own size indicator, + followed by an OPTIONAL trailer containing entity-header fields. This + allows dynamically produced content to be transferred along with the + information necessary for the recipient to verify that it has + received the full message. + + + + + Defines the version of the HTTP Response for applications where it's required + for this to be forced. + + + + + Kind of connection + + + + + Encoding to use when sending stuff to the client. + + Default is UTF8 + + + + Number of seconds to keep connection alive + + Only used if Connection property is set to . + + + + Status code that is sent to the client. + + Default is + + + + Information about why a specific status code was used. + + + + + Size of the body. MUST be specified before sending the header, + unless property Chunked is set to true. + + + + + Kind of content in the body + + Default type is "text/html" + + + + Headers have been sent to the client- + + You can not send any additional headers if they have already been sent. + + + + The whole response have been sent. + + + + + Cookies that should be created/changed. + + + + + represents a HTTP input item. Each item can have multiple sub items, a sub item + is made in a HTML form by using square brackets + + + // becomes: + Console.WriteLine("Value: {0}", form["user"]["FirstName"].Value); + + + All names in a form SHOULD be in lowercase. + + + + Representation of a non-initialized . + + + + Initializes an input item setting its name/identifier and value + + Parameter name/id + Parameter value + + + Creates a deep copy of the item specified + The item to copy + The function makes a deep copy of quite a lot which can be slow + + + + Add another value to this item + + Value to add. + Cannot add stuff to . + + + + checks if a sub-item exists (and has a value). + + name in lower case + true if the sub-item exists and has a value; otherwise false. + + + Returns a formatted representation of the instance with the values of all contained parameters + + + + Outputs the string in a formatted manner + + A prefix to append, used internally + produce a query string + + + + Add a sub item. + + Can contain array formatting, the item is then parsed and added in multiple levels + Value to add. + Argument is null. + Cannot add stuff to . + + + + Returns an enumerator that iterates through the collection. + + + + A that can be used to iterate through the collection. + + 1 + + + + Returns an enumerator that iterates through a collection. + + + + An object that can be used to iterate through the collection. + + 2 + + + + Outputs the string in a formatted manner + + A prefix to append, used internally + + + + + Number of values + + + + + Get a sub item + + name in lower case. + if no item was found. + + + + Name of item (in lower case). + + + + + Returns the first value, or null if no value exist. + + + + + Returns the last value, or null if no value exist. + + + + + Returns the list with values. + + + + + + + name in lower case + + + + + Helpers making it easier to work with forms. + + + + + + Used to let the website use different JavaScript libraries. + Default is + + + + + Create a <form> tag. + + name of form + action to invoke on submit + form should be posted as Ajax + HTML code + + + // without options + WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); + + // with options + WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax, "style", "display:inline", "class", "greenForm"); + + + HTML attributes or JavaScript options. + Method will ALWAYS be POST. + options must consist of name, value, name, value + + + + Creates a select list with the values in a collection. + + Name of the SELECT-tag + collection used to generate options. + delegate used to return id and title from objects. + value that should be marked as selected. + First row should contain an empty value. + string containing a SELECT-tag. + + + + + Creates a select list with the values in a collection. + + Name of the SELECT-tag + Id of the SELECT-tag + collection used to generate options. + delegate used to return id and title from objects. + value that should be marked as selected. + First row should contain an empty value. + string containing a SELECT-tag. + + + + // Class that is going to be used in a SELECT-tag. + public class User + { + private readonly string _realName; + private readonly int _id; + public User(int id, string realName) + { + _id = id; + _realName = realName; + } + public string RealName + { + get { return _realName; } + } + + public int Id + { + get { return _id; } + } + } + + // Using an inline delegate to generate the select list + public void UserInlineDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + }, 2, true); + } + + // Using an method as delegate to generate the select list. + public void UseExternalDelegate() + { + List<User> items = new List<User>(); + items.Add(new User(1, "adam")); + items.Add(new User(2, "bertial")); + items.Add(new User(3, "david")); + string htmlSelect = Select("users", "users", items, UserOptions, 1, true); + } + + // delegate returning id and title + public static void UserOptions(object o, out object id, out object title) + { + User user = (User)o; + id = user.Id; + value = user.RealName; + } + + + name, id, collection or getIdTitle is null. + + + + Creates a select list with the values in a collection. + + Name of the SELECT-tag + Id of the SELECT-tag + collection used to generate options. + delegate used to return id and title from objects. + value that should be marked as selected. + First row should contain an empty value. + name, value collection of extra HTML attributes. + string containing a SELECT-tag. + + name, id, collection or getIdTitle is null. + Invalid HTML attribute list. + + + + Generate a list of HTML options + + collection used to generate options. + delegate used to return id and title from objects. + value that should be marked as selected. + First row should contain an empty value. + + collection or getIdTitle is null. + + + sb is null. + + + + Creates a check box. + + element name + element value + determines if the check box is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button + + + + Creates a check box. + + element name + element id + element value + determines if the check box is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button + + value in your business object. (check box will be selected if it matches the element value) + + + + + Creates a check box. + + element name + element id + determines if the check box is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button + will set value to "1". + + + + Creates a RadioButton. + + element name + element value + determines if the radio button is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button + + + + Creates a RadioButton. + + element name + element id + element value + determines if the radio button is selected or not. This is done differently depending on the + type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if + the box is checked or not. + a list with additional attributes (name, value, name, value). + a generated radio button + + + + form close tag + + + + + + Add a component instance + + Interface type + Instance to add + + + + Get a component. + + Interface type + Component if registered, otherwise null. + + Component will get created if needed. + + + + If instance cannot be created. + + + + Checks if the specified component interface have been added. + + + true if found; otherwise false. + + + + Add a component. + + Type being requested. + Type being created. + Type have already been mapped. + + + + Arguments used when more body bytes have come. + + + + + Initializes a new instance of the class. + + buffer that contains the received bytes. + offset in buffer where to start processing. + number of bytes from that should be parsed. + + + + Initializes a new instance of the class. + + + + + Gets or sets buffer that contains the received bytes. + + + + + Gets or sets number of bytes from that should be parsed. + + + + + Gets or sets offset in buffer where to start processing. + + + + + Used to create and reuse contexts. + + + + + Used to create es. + + + + + Creates a that handles a connected client. + + Client socket (accepted by the ). + A creates . + + + + Create a secure . + + Client socket (accepted by the ). + HTTPS certificate to use. + Kind of HTTPS protocol. Usually TLS or SSL. + A created . + + + + A request have been received from one of the contexts. + + + + + Initializes a new instance of the class. + + The writer. + Amount of bytes to read from the incoming socket stream. + Used to create a request parser. + + + + Create a new context. + + true if socket is running HTTPS. + Client that connected + Network/SSL stream. + A context. + + + + Create a new context. + + true if HTTPS is used. + Remote client + Network stream, uses . + A new context (always). + + + + Create a secure . + + Client socket (accepted by the ). + HTTPS certificate to use. + Kind of HTTPS protocol. Usually TLS or SSL. + + A created . + + + + + Creates a that handles a connected client. + + Client socket (accepted by the ). + + A creates . + + + + + True if detailed trace logs should be written. + + + + + A request have been received from one of the contexts. + + + + + Custom network stream to mark sockets as reusable when disposing the stream. + + + + + Creates a new instance of the class for the specified . + + + The that the will use to send and receive data. + + + The parameter is null. + + + The parameter is not connected. + -or- + The property of the parameter is not . + -or- + The parameter is in a nonblocking state. + + + + + Initializes a new instance of the class for the specified with the specified ownership. + + + The that the will use to send and receive data. + + + Set to true to indicate that the will take ownership of the ; otherwise, false. + + + The parameter is null. + + + The parameter is not connected. + -or- + the value of the property of the parameter is not . + -or- + the parameter is in a nonblocking state. + + + + + Creates a new instance of the class for the specified with the specified access rights. + + + The that the will use to send and receive data. + + + A bitwise combination of the values that specify the type of access given to the over the provided . + + + The parameter is null. + + + The parameter is not connected. + -or- + the property of the parameter is not . + -or- + the parameter is in a nonblocking state. + + + + + Creates a new instance of the class for the specified with the specified access rights and the specified ownership. + + + The that the will use to send and receive data. + + + A bitwise combination of the values that specifies the type of access given to the over the provided . + + + Set to true to indicate that the will take ownership of the ; otherwise, false. + + + The parameter is null. + + + The parameter is not connected. + -or- + The property of the parameter is not . + -or- + The parameter is in a nonblocking state. + + + + + Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. + + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Serves files that are stored in embedded resources. + + + + + A HttpModule can be used to serve Uri's. The module itself + decides if it should serve a Uri or not. In this way, you can + get a very flexible http application since you can let multiple modules + serve almost similar urls. + + + Throw if you are using a and want to prompt for user name/password. + + + + + Method that process the url + + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to + true if this module handled the request. + + + + Set the log writer to use. + + logwriter to use. + + + + Log something. + + importance of log message + message + + + + If true specifies that the module doesn't consume the processing of a request so that subsequent modules + can continue processing afterwards. Default is false. + + + + + Initializes a new instance of the class. + Runs to make sure the basic mime types are available, they can be cleared later + through the use of if desired. + + + + + Initializes a new instance of the class. + Runs to make sure the basic mime types are available, they can be cleared later + through the use of if desired. + + The log writer to use when logging events + + + + Mimtypes that this class can handle per default + + + + + Loads resources from a namespace in the given assembly to an uri + + The uri to map the resources to + The assembly in which the resources reside + The namespace from which to load the resources + + resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views"); + + will make ie the resource MyLib.Models.User.Views.stylesheet.css accessible via /user/stylesheet.css + + The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded + + + + Returns true if the module can handle the request + + + + + Method that process the url + + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to + true if this module handled the request. + + + + List with all mime-type that are allowed. + + All other mime types will result in a Forbidden http status code. + + + + The purpose of this module is to serve files. + + + + + Initializes a new instance of the class. + + Uri to serve, for instance "/files/" + Path on hard drive where we should start looking for files + If true a Last-Modifed header will be sent upon requests urging web browser to cache files + + + + Initializes a new instance of the class. + + Uri to serve, for instance "/files/" + Path on hard drive where we should start looking for files + + + + Mimtypes that this class can handle per default + + + + + Determines if the request should be handled by this module. + Invoked by the + + + true if this module should handle it. + + + Illegal path + + + + check if source contains any of the chars. + + + + + + + + Method that process the Uri. + + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to + Failed to find file extension + File type is forbidden. + + + + return a file extension from an absolute Uri path (or plain filename) + + + + + + + List with all mime-type that are allowed. + + All other mime types will result in a Forbidden http status code. + + + + characters that may not exist in a path. + + + fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" }; + + + + + The server encountered an unexpected condition which prevented it from fulfilling the request. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + error message. + + + + Initializes a new instance of the class. + + error message. + inner exception. + + + + Class to make dynamic binding of redirects. Instead of having to specify a number of similar redirect rules + a regular expression can be used to identify redirect URLs and their targets. + + + [a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase) + ]]> + + + + + Initializes a new instance of the class. + + Expression to match URL + Expression to generate URL + + [a-zA-Z0-9]+)", "/user/${first}")); + Result of ie. /employee1 will then be /user/employee1 + ]]> + + + + + Initializes a new instance of the class. + + Expression to match URL + Expression to generate URL + Regular expression options to use, can be null + + [a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase)); + Result of ie. /employee1 will then be /user/employee1 + ]]> + + + + + Initializes a new instance of the class. + + Expression to match URL + Expression to generate URL + Regular expression options to apply + true if request should be redirected, false if the request URI should be replaced. + + [a-zA-Z0-9]+)", "/user/${first}", RegexOptions.None)); + Result of ie. /employee1 will then be /user/employee1 + ]]> + + Argument is null. + + + + + Process the incoming request. + + incoming HTTP request + outgoing HTTP response + true if response should be sent to the browser directly (no other rules or modules will be processed). + + returning true means that no modules will get the request. Returning true is typically being done + for redirects. + + If request or response is null + + + + Used when the request line have been successfully parsed. + + + + + Initializes a new instance of the class. + + The HTTP method. + The URI path. + The HTTP version. + + + + Initializes a new instance of the class. + + + + + Gets or sets http method. + + + Should be one of the methods declared in . + + + + + Gets or sets the version of the HTTP protocol that the client want to use. + + + + + Gets or sets requested URI path. + + + + + Delegate used to find a realm/domain. + + + + + Realms are used during HTTP Authentication + + + + + + + A complete HTTP server, you need to add a module to it to be able to handle incoming requests. + + + + // this small example will add two web site modules, thus handling + // two different sites. In reality you should add Controller modules or something + // two the website modules to be able to handle different requests. + HttpServer server = new HttpServer(); + server.Add(new WebSiteModule("www.gauffin.com", "Gauffin Telecom AB")); + server.Add(new WebSiteModule("www.vapadi.se", "Remote PBX")); + + // start regular http + server.Start(IPAddress.Any, 80); + + // start https + server.Start(IPAddress.Any, 443, myCertificate); + + + + + + + + + Initializes a new instance of the class. + + Used to get all components used in the server.. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + Form decoders are used to convert different types of posted data to the object types. + + + + + + Initializes a new instance of the class. + + A session store is used to save and retrieve sessions + + + + + Initializes a new instance of the class. + + The log writer. + + + + + Initializes a new instance of the class. + + Form decoders are used to convert different types of posted data to the object types. + The log writer. + + + + + + + Initializes a new instance of the class. + + Form decoders are used to convert different types of posted data to the object types. + A session store is used to save and retrieve sessions + The log writer. + + + + + + + + Adds the specified rule. + + The rule. + + + + Add a to the server. + + mode to add + + + + Decodes the request body. + + The request. + Failed to decode form data. + + + + Generate a HTTP error page (that will be added to the response body). + response status code is also set. + + Response that the page will be generated in. + . + response body contents. + + + + Generate a HTTP error page (that will be added to the response body). + response status code is also set. + + Response that the page will be generated in. + exception. + + + + Realms are used by the s. + + HTTP request + domain/realm. + + + + Process an incoming request. + + connection to client + request information + response that should be filled + session information + + + + Can be overloaded to implement stuff when a client have been connected. + + + Default implementation does nothing. + + client that disconnected + disconnect reason + + + + Handle authentication + + + + + true if request can be handled; false if not. + Invalid authorization header + + + + Will request authentication. + + + Sends respond to client, nothing else can be done with the response after this. + + + + + + + + Received from a when a request have been parsed successfully. + + that received the request. + The request. + + + + To be able to track request count. + + + + + + + Start the web server using regular HTTP. + + IP Address to listen on, use IpAddress.Any to accept connections on all IP addresses/network cards. + Port to listen on. 80 can be a good idea =) + address is null. + Port must be a positive number. + + + + Accept secure connections. + + IP Address to listen on, use to accept connections on all IP Addresses / network cards. + Port to listen on. 80 can be a good idea =) + Certificate to use + address is null. + Port must be a positive number. + + + + shut down the server and listeners + + + + + write an entry to the log file + + importance of the message + log message + + + + write an entry to the log file + + object that wrote the message + importance of the message + log message + + + + Server that is handling the current request. + + + Will be set as soon as a request arrives to the object. + + + + + Modules used for authentication. The module that is is added first is used as + the default authentication module. + + Use the corresponding property + in the if you are using multiple websites. + + + + Form decoder providers are used to decode request body (which normally contains form data). + + + + + Server name sent in HTTP responses. + + + Do NOT include version in name, since it makes it + easier for hackers. + + + + + Name of cookie where session id is stored. + + + + + Specified where logging should go. + + + + + + + + Number of connections that can wait to be accepted by the server. + + Default is 10. + + + + Gets or sets maximum number of allowed simultaneous requests. + + + + This property is useful in busy systems. The HTTP server + will start queuing new requests if this limit is hit, instead + of trying to process all incoming requests directly. + + + The default number if allowed simultaneous requests are 10. + + + + + + Gets or sets maximum number of requests queuing to be handled. + + + + The WebServer will start turning requests away if response code + to indicate that the server + is too busy to be able to handle the request. + + + + + + Realms are used during HTTP authentication. + Default realm is same as server name. + + + + + Let's to receive unhandled exceptions from the threads. + + + Exceptions will be thrown during debug mode if this event is not used, + exceptions will be printed to console and suppressed during release mode. + + + + + The request requires user authentication. The response MUST include a + WWW-Authenticate header field (section 14.47) containing a challenge + applicable to the requested resource. + + The client MAY repeat the request with a suitable Authorization header + field (section 14.8). If the request already included Authorization + credentials, then the 401 response indicates that authorization has been + refused for those credentials. If the 401 response contains the same challenge + as the prior response, and the user agent has already attempted authentication + at least once, then the user SHOULD be presented the entity that was given in the response, + since that entity might include relevant diagnostic information. + + HTTP access authentication is explained in rfc2617: + http://www.ietf.org/rfc/rfc2617.txt + + (description is taken from + http://www.submissionchamber.com/help-guides/error-codes.php#sec10.4.2) + + + + + Create a new unauhtorized exception. + + + + + + Create a new unauhtorized exception. + + reason to why the request was unauthorized. + inner exception + + + + Create a new unauhtorized exception. + + reason to why the request was unauthorized. + + + + Lists content type mime types. + + + + + text/plain + + + + + text/haml + + + + + content type for javascript documents = application/javascript + + + + RFC 4329 states that text/javascript have been superseeded by + application/javascript. You might still want to check browser versions + since older ones do not support application/javascript. + + Browser support: http://krijnhoetmer.nl/stuff/javascript/mime-types/ + + + + + text/xml + + + + + A list of content types + + + + + + + Semicolon separated content types. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Searches for the specified type + + Can also be a part of a type (searching for "xml" would return true for "application/xml"). + true if type was found. + + + + Get this first content type. + + + + + Fetch a content type + + Part of type ("xml" would return "application/xml") + + All content types are in lower case. + + + + Session store using memory for each session. + + + + + Initializes the class setting the expirationtimer to clean the session every minute + + + + + Delegate for the cleanup timer + + + + + Creates a new http session + + + + + + Creates a new http session with a specific id + + Id used to identify the new cookie.. + A object. + + Id should be generated by the store implementation if it's null or . + + + + + Load an existing session. + + + + + + + Save an updated session to the store. + + + + + + We use the flyweight pattern which reuses small objects + instead of creating new each time. + + EmptyLanguageNode (unused) session that should be reused next time Create is called. + + + + Remove expired sessions + + + + + Remove a session + + id of the session. + + + + Load a session from the store + + + null if session is not found. + + + + Number of minutes before a session expires. + Default is 20 minutes. + + + + + Webhelper provides helpers for common tasks in HTML. + + + + + Used to let the website use different javascript libraries. + Default is + + + + + Creates a link that invokes through ajax. + + url to fetch + link title + + optional options in format "key, value, key, value". + Javascript options starts with ':'. + + a link tag + + WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');"); + + + + + Builds a link that updates an element with the fetched ajax content. + + Url to fetch content from + link title + html element to update with the results of the ajax request. + optional options in format "key, value, key, value" + A link tag. + + + + A link that pop ups a Dialog (overlay div) + + url to contents of dialog + link title + name/value of html attributes. + A "a"-tag that popups a dialog when clicked + + WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + + + + + Create/Open a dialog box using ajax + + + + + + + + + Close a javascript dialog window/div. + + javascript for closing a dialog. + + + + + Create a <form> tag. + + name of form + action to invoke on submit + form should be posted as ajax + html code + + WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax); + + + + + Create a link tag. + + url to go to + link title (text that is displayed) + html attributes, name, value, name, value + html code + + WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');"); + + + + + Build a link + + url to go to. + title of link (displayed text) + extra html attributes. + a complete link + + + + Build a link + + url to go to. + title of link (displayed text) + extra html attributes. + a complete link + more options + + + + Obsolete + + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete + + + + Obsolete + + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete + Obsolete + + + + Render errors into a UL with class "errors" + + class used by UL-tag. + items to list + an unordered html list. + + + + Render errors into a UL with class "errors" + + class used by UL-tag. + items to list + an unordered html list. + + + + Render errors into a UL with class "errors" + + + + + + + Generates a list with html attributes. + + StringBuilder that the options should be added to. + attributes set by user. + attributes set by any of the helper classes. + + + + Generates a list with html attributes. + + StringBuilder that the options should be added to. + + + + + Purpose of this class is to create a javascript toolkit independent javascript helper. + + + + + Generates a list with JS options. + + StringBuilder that the options should be added to. + the javascript options. name, value pairs. each string value should be escaped by YOU! + true if we should start with a comma. + + + + Removes any javascript parameters from an array of parameters + + The array of parameters to remove javascript params from + An array of html parameters + + + + javascript action that should be added to the "onsubmit" event in the form tag. + + + All javascript option names should end with colon. + + + JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + + + + + + Requests a url through ajax + + url to fetch + optional options in format "key, value, key, value", used in JS request object. + a link tag + All javascript option names should end with colon. + + + JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + + + + + + Ajax requests that updates an element with + the fetched content + + Url to fetch content from + element to update + optional options in format "key, value, key, value", used in JS updater object. + A link tag. + All javascript option names should end with colon. + + + JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');"); + + + + + + A link that pop ups a Dialog (overlay div) + + url to contents of dialog + link title + A "a"-tag that popups a dialog when clicked + name/value of html attributes + + WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + + + + + Close a javascript dialog window/div. + + javascript for closing a dialog. + + + + + Creates a new modal dialog window + + url to open in window. + window title (may not be supported by all js implementations) + + + + + + + + + + + + + Represents a field in a multipart form + + + + The request could not be understood by the server due to malformed syntax. + The client SHOULD NOT repeat the request without modifications. + + Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php + + + + + Create a new bad request exception. + + reason to why the request was bad. + + + + Create a new bad request exception. + + reason to why the request was bad. + inner exception + + + + Container class for posted files + + + + + Creates a container for a posted file + + The identifier of the post field + The file path + The content type of the file + The name of the file uploaded + If any parameter is null or empty + + + + Creates a container for a posted file + + If any parameter is null or empty + + + Destructor disposing the file + + + + Deletes the temporary file + + True if manual dispose + + + + Disposing interface, cleans up managed resources (the temporary file) and suppresses finalization + + + + + The name/id of the file + + + + + The full file path + + + + + The name of the uploaded file + + + + + The type of file + + + + + Will contain helper functions for javascript. + + + + + Requests a url through ajax + + url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. + optional options in format "key, value, key, value", used in JS request object. All keys should end with colon. + a link tag + onclick attribute is used by this method. + + + // plain text + JSHelper.AjaxRequest("'/user/show/1'"); + + // ajax request using this.href + string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; + + + + + + Ajax requests that updates an element with + the fetched content + + url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. + element to update + options in format "key, value, key, value". All keys should end with colon. + A link tag. + + + JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); + + + + + + Opens contents in a dialog window. + + url to contents of dialog + link title + name, value, name, value, all parameter names should end with colon. + + + + Close a javascript dialog window/div. + + javascript for closing a dialog. + + + + + Contains server side HTTP request information. + + + + + Chars used to split an URL path into multiple parts. + + + + + Assign a form. + + + + + + Creates a new object that is a copy of the current instance. + + + + A new object that is a copy of this instance. + + 2 + + + + Decode body into a form. + + A list with form decoders. + If body contents is not valid for the chosen decoder. + If body is still being transferred. + + + + Cookies + + the cookies + + + + Create a response object. + + A new . + + + + Called during parsing of a . + + Name of the header, should not be URL encoded + Value of the header, should not be URL encoded + If a header is incorrect. + + + + Add bytes to the body + + buffer to read bytes from + where to start read + number of bytes to read + Number of bytes actually read (same as length unless we got all body bytes). + If body is not writable + bytes is null. + offset is out of range. + + + + Clear everything in the request + + + + + Gets or sets a value indicating whether this is secure. + + + + + Path and query (will be merged with the host header) and put in Uri + + + + + + Gets whether the body is complete. + + + + + Gets kind of types accepted by the client. + + + + + Gets or sets body stream. + + + + + Gets or sets kind of connection used for the session. + + + + + Gets or sets number of bytes in the body. + + + + + Gets headers sent by the client. + + + + + Gets or sets version of HTTP protocol that's used. + + + Probably or . + + + + + + Gets or sets requested method. + + + + Will always be in upper case. + + + + + + Gets variables sent in the query string + + + + + Gets or sets requested URI. + + + + + Uri absolute path splitted into parts. + + + // uri is: http://gauffin.com/code/tiny/ + Console.WriteLine(request.UriParts[0]); // result: code + Console.WriteLine(request.UriParts[1]); // result: tiny + + + If you're using controllers than the first part is controller name, + the second part is method name and the third part is Id property. + + + + + + Gets parameter from or . + + + + + Gets form parameters. + + + + + Gets whether the request was made by Ajax (Asynchronous JavaScript) + + + + + Gets cookies that was sent with the request. + + + + + The website module let's you handle multiple websites in the same server. + It uses the "Host" header to check which site you want. + + It's recommended that you do not + add any other modules to HttpServer if you are using the website module. Instead, + add all wanted modules to each website. + + + + + + domain name that should be handled. + + + + + Method that process the url + + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to + + + + Name of site. + + + + + Container to bind resource names to assemblies + + + + + Instantiates an instance of + + The dot seperated uri the resource maps to + The full resource name + The assembly the resource exists in + + + + Retrieves a stream to the resource + + Null if the resource couldn't be located somehow + + + + Retrieves the assembly the resource resides in + + + + + Retrieves the full name/path of the assembly + + + + + Retrieves the extension of the resource + + + + Returns the Uri without extension + + + Retrieves the full path name to the resource file + + + + Creates request parsers when needed. + + + + + Creates request parsers when needed. + + + + + Create a new request parser. + + Used when logging should be enabled. + A new request parser. + + + + Create a new request parser. + + Used when logging should be enabled. + A new request parser. + + + + The "basic" authentication scheme is based on the model that the + client must authenticate itself with a user-ID and a password for + each realm. The realm value should be considered an opaque string + which can only be compared for equality with other realms on that + server. The server will service the request only if it can validate + the user-ID and password for the protection space of the Request-URI. + There are no optional authentication parameters. + + + + + Initializes a new instance of the class. + + Delegate used to provide information used during authentication. + Delegate used to determine if authentication is required (may be null). + + + + Initializes a new instance of the class. + + Delegate used to provide information used during authentication. + + + + Create a response that can be sent in the WWW-Authenticate header. + + Realm that the user should authenticate in + Not used in basic auth + A correct auth request. + + + + An authentication response have been received from the web browser. + Check if it's correct + + Contents from the Authorization header + Realm that should be authenticated + GET/POST/PUT/DELETE etc. + Not used in basic auth + Authentication object that is stored for the request. A user class or something like that. + if authenticationHeader is invalid + If any of the paramters is empty or null. + + + + name used in http request. + + + + + Current state in the parsing. + + + + + Should parse the request line + + + + + Searching for a complete header name + + + + + Searching for colon after header name (ignoring white spaces) + + + + + Searching for start of header value (ignoring white spaces) + + + + + Searching for a complete header value (can span over multiple lines, as long as they are prefixed with one/more whitespaces) + + + + + Adding bytes to body + + + + + This decoder converts XML documents to form items. + Each element becomes a subitem in the form, and each attribute becomes an item. + + + // xml: somethingdata + // result: + // form["hello"].Value = "something" + // form["hello"]["id"].Value = 1 + // form["hello"]["world]["id"].Value = 1 + // form["hello"]["world"].Value = "data" + + + The original xml document is stored in form["__xml__"].Value. + + + + + + + Stream containing the content + Content type (with any additional info like boundry). Content type is always supplied in lower case + Stream encoding + Note: contentType and encoding are not used? + A http form, or null if content could not be parsed. + + + + + Recursive function that will go through an xml element and store it's content + to the form item. + + (parent) Item in form that content should be added to. + Node that should be parsed. + + + + Checks if the decoder can handle the mime type + + Content type (with any additional info like boundry). Content type is always supplied in lower case. + True if the decoder can parse the specified content type + + + + Cookies that should be set. + + + + + Adds a cookie in the collection. + + cookie to add + cookie is null + + + + Copy a request cookie + + + When the cookie should expire + + + + Gets a collection enumerator on the cookie list. + + collection enumerator + + + + Remove all cookies + + + + + Returns an enumerator that iterates through the collection. + + + + A that can be used to iterate through the collection. + + 1 + + + + Gets the count of cookies in the collection. + + + + + Gets the cookie of a given identifier (null if not existing). + + + + + This class is created as a wrapper, since there are two different cookie types in .Net (Cookie and HttpCookie). + The framework might switch class in the future and we dont want to have to replace all instances + + + + + Let's copy all the cookies. + + value from cookie header. + + + + Adds a cookie in the collection. + + cookie to add + cookie is null + + + + Gets a collection enumerator on the cookie list. + + collection enumerator + + + + Remove all cookies. + + + + + Returns an enumerator that iterates through the collection. + + + + A that can be used to iterate through the collection. + + 1 + + + + Remove a cookie from the collection. + + Name of cookie. + + + + Gets the count of cookies in the collection. + + + + + Gets the cookie of a given identifier (null if not existing). + + + + + New implementation of the HTTP listener. + + + Use the Create methods to create a default listener. + + + + + Initializes a new instance of the class. + + IP Address to accept connections on + TCP Port to listen on, default HTTP port is 80. + Factory used to create es. + address is null. + Port must be a positive number. + + + + Initializes a new instance of the class. + + The address. + The port. + The factory. + The certificate. + + + + Initializes a new instance of the class. + + The address. + The port. + The factory. + The certificate. + The protocol. + + + + Creates a new instance with default factories. + + Address that the listener should accept connections on. + Port that listener should accept connections on. + Created HTTP listener. + + + + Creates a new instance with default factories. + + Address that the listener should accept connections on. + Port that listener should accept connections on. + Certificate to use + Created HTTP listener. + + + + Creates a new instance with default factories. + + Address that the listener should accept connections on. + Port that listener should accept connections on. + Certificate to use + which HTTPS protocol to use, default is TLS. + Created HTTP listener. + + + + Can be used to create filtering of new connections. + + Accepted socket + + true if connection can be accepted; otherwise false. + + + + + A client have been accepted, but not handled, by the listener. + + + + + Generic helper functions for HTTP + + + + + Version string for HTTP v1.0 + + + + + Version string for HTTP v1.1 + + + + + An empty URI + + + + + Parses a query string. + + Query string (URI encoded) + A object if successful; otherwise + queryString is null. + If string cannot be parsed. + + + + A reverse proxy are used to act as a bridge between local (protected/hidden) websites + and public clients. + + A typical usage is to allow web servers on non standard ports to still be available + to the public clients, or allow web servers on private ips to be available. + + + + + + + Base url requested from browser + Base url on private web server + + // this will return contents from http://192.168.1.128/view/jonas when client requests http://www.gauffin.com/user/view/jonas + _server.Add(new ReverseProxyModule("http://www.gauffin.com/user/", "http://192.168.1.128/"); + + + + + Method that determines if an url should be handled or not by the module + + Url requested by the client. + true if module should handle the url. + + + + Method that process the url + + Information sent by the browser about the request + Information that is being sent back to the client. + Session used to + + + + Used to inform http server that + + + + + Eventarguments used when an exception is thrown by a module + + the exception + + + + Exception thrown in a module + + + + + PrototypeJS implementation of the javascript functions. + + + + + Requests a url through ajax + + url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself. + optional options in format "key, value, key, value", used in JS request object. All keys should end with colon. + a link tag + onclick attribute is used by this method. + + + // plain text + JSHelper.AjaxRequest("'/user/show/1'"); + + // ajax request using this.href + string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; + + + + + + Determins if a list of strings contains a specific value + + options to check in + value to find + true if value was found + case insensitive + + + + Ajax requests that updates an element with + the fetched content + + URL to fetch. URL is NOT enclosed in quotes by the implementation. You need to do that yourself. + element to update + options in format "key, value, key, value". All keys should end with colon. + A link tag. + + + JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true"); + + + + + + A link that pop ups a Dialog (overlay div) + + URL to contents of dialog + link title + name, value, name, value + + A "a"-tag that popups a dialog when clicked + + Requires Control.Modal found here: http://livepipe.net/projects/control_modal/ + And the following JavaScript (load it in application.js): + + Event.observe(window, 'load', + function() { + document.getElementsByClassName('modal').each(function(link){ new Control.Modal(link); }); + } + ); + + + + WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');"); + + + + + create a modal dialog (usually using DIVs) + + url to fetch + dialog title + javascript/html attributes. javascript options ends with colon ':'. + + + + + Close a javascript dialog window/div. + + javascript for closing a dialog. + + + + + javascript action that should be added to the "onsubmit" event in the form tag. + + remember to encapsulate strings in '' + + All javascript option names should end with colon. + + + JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);"); + + + + + + Implements HTTP Digest authentication. It's more secure than Basic auth since password is + encrypted with a "key" from the server. + + + Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure. + + + + + Initializes a new instance of the class. + + Delegate used to provide information used during authentication. + Delegate used to determine if authentication is required (may be null). + + + + Initializes a new instance of the class. + + Delegate used to provide information used during authentication. + + + + Used by test classes to be able to use hardcoded values + + + + + An authentication response have been received from the web browser. + Check if it's correct + + Contents from the Authorization header + Realm that should be authenticated + GET/POST/PUT/DELETE etc. + First option: true if username/password is correct but not cnonce + + Authentication object that is stored for the request. A user class or something like that. + + if authenticationHeader is invalid + If any of the paramters is empty or null. + + + + Encrypts parameters into a Digest string + + Realm that the user want to log into. + User logging in + Users password. + HTTP method. + Uri/domain that generated the login prompt. + Quality of Protection. + "Number used ONCE" + Hexadecimal request counter. + "Client Number used ONCE" + Digest encrypted string + + + + + + Md5 hex encoded "userName:realm:password", without the quotes. + Md5 hex encoded "method:uri", without the quotes + Quality of Protection + "Number used ONCE" + Hexadecimal request counter. + Client number used once + + + + + Create a response that can be sent in the WWW-Authenticate header. + + Realm that the user should authenticate in + First options specifies if true if username/password is correct but not cnonce. + A correct auth request. + If realm is empty or null. + + + + Decodes authorization header value + + header value + Encoding that the buffer is in + All headers and their values if successful; otherwise null + + NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII); + + Can handle lots of whitespaces and new lines without failing. + + + + Gets the current nonce. + + + + + + Gets the Md5 hash bin hex2. + + To be hashed. + + + + + determines if the nonce is valid or has expired. + + nonce value (check wikipedia for info) + true if the nonce has not expired. + + + + name used in http request. + + + + + Gets or sets whether the token supplied in is a + HA1 generated string. + + + + -- cgit v1.1 From 01ae916bad672722aa62ee712b7b580d6f5f4370 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Nov 2011 00:07:34 +0000 Subject: Don't register a region twice on both official registration and maptile regeneration. Maptile storage appears orthogonal to region registration --- OpenSim/Region/Framework/Scenes/Scene.cs | 12 +++++------- .../Services/Connectors/MapImage/MapImageServiceConnector.cs | 4 +++- OpenSim/Services/GridService/GridService.cs | 1 + OpenSim/Services/MapImageService/MapImageService.cs | 2 ++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f10789b..47450ed 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -5017,18 +5017,16 @@ namespace OpenSim.Region.Framework.Scenes return offsets.ToArray(); } + /// + /// Regenerate the maptile for this scene. + /// + /// + /// public void RegenerateMaptile(object sender, ElapsedEventArgs e) { IWorldMapModule mapModule = RequestModuleInterface(); if (mapModule != null) - { mapModule.GenerateMaptile(); - - string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo)); - - if (error != String.Empty) - throw new Exception(error); - } } // This method is called across the simulation connector to diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs index 69e2d17..e46714e 100644 --- a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs +++ b/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs @@ -129,7 +129,9 @@ namespace OpenSim.Services.Connectors } else - m_log.DebugFormat("[MAP IMAGE CONNECTOR]: RegisterRegion received null reply"); + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Map post received null reply"); + } } catch (Exception e) { diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 05cfe5f..768e4e1 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -156,6 +156,7 @@ namespace OpenSim.Services.GridService regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); return "Region overlaps another region"; } + if ((region != null) && (region.RegionID == regionInfos.RegionID) && ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY))) { diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index 7e7391c..83727b6 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs @@ -138,6 +138,8 @@ namespace OpenSim.Services.MapImageService public byte[] GetMapTile(string fileName, out string format) { +// m_log.DebugFormat("[MAP IMAGE SERVICE]: Getting map tile {0}", fileName); + format = ".jpg"; string fullName = Path.Combine(m_TilesStoragePath, fileName); if (File.Exists(fullName)) -- cgit v1.1 From 7a180781778a6369799c244ab95f5e6844b3be05 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Nov 2011 00:10:29 +0000 Subject: improve region deregistration log message --- OpenSim/Services/GridService/GridService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 768e4e1..82a9193 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -244,11 +244,14 @@ namespace OpenSim.Services.GridService public bool DeregisterRegion(UUID regionID) { - m_log.DebugFormat("[GRID SERVICE]: Region {0} deregistered", regionID); RegionData region = m_Database.Get(regionID, UUID.Zero); if (region == null) return false; + m_log.DebugFormat( + "[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}", + region.RegionName, region.RegionID, region.posX, region.posY); + int flags = Convert.ToInt32(region.Data["flags"]); if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Data.RegionFlags.Persistent) != 0) -- cgit v1.1 From d05d065d859c8877cb910cf5748e32e1560086a6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Nov 2011 00:29:52 +0000 Subject: Improve some grid region log messages to express regions at co-ordinate (e.g. 1000, 1000) rather than meter positions (256000, 256000) --- OpenSim/Data/IRegionData.cs | 20 ++++++++++++++++++++ .../Server/Handlers/Map/MapAddServerConnector.cs | 14 +++++++++----- OpenSim/Services/GridService/GridService.cs | 6 +++--- OpenSim/Services/Interfaces/IGridService.cs | 21 +++++++++++++++++---- OpenSim/Services/MapImageService/MapImageService.cs | 2 +- 5 files changed, 50 insertions(+), 13 deletions(-) diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index 46dc4fb..4761a7a 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs @@ -37,10 +37,30 @@ namespace OpenSim.Data public UUID RegionID; public UUID ScopeID; public string RegionName; + + /// + /// The position in meters of this region. + /// public int posX; + + /// + /// The position in meters of this region. + /// public int posY; + public int sizeX; public int sizeY; + + /// + /// Return the x-coordinate of this region. We currently assume that every region is the same size. + /// + public int coordX { get { return (sizeX != 0) ? posX / sizeX : -1; } } + + /// + /// Return the y-coordinate of this region. We currently assume that every region is the same size. + /// + public int coordY { get { return (sizeY != 0) ? posY / sizeY : -1; } } + public Dictionary Data; } diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index 99f98b6..8291107 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs @@ -79,7 +79,7 @@ namespace OpenSim.Server.Handlers.MapImage public override byte[] Handle(string path, Stream requestData, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { - m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); +// m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); StreamReader sr = new StreamReader(requestData); string body = sr.ReadToEnd(); sr.Close(); @@ -97,9 +97,14 @@ namespace OpenSim.Server.Handlers.MapImage int x = 0, y = 0; Int32.TryParse(request["X"].ToString(), out x); Int32.TryParse(request["Y"].ToString(), out y); - string type = "image/jpeg"; - if (request.ContainsKey("TYPE")) - type = request["TYPE"].ToString(); + + m_log.DebugFormat("[MAP ADD SERVER CONNECTOR]: Received map data for region at {0}-{1}", x, y); + +// string type = "image/jpeg"; +// +// if (request.ContainsKey("TYPE")) +// type = request["TYPE"].ToString(); + byte[] data = Convert.FromBase64String(request["DATA"].ToString()); string reason = string.Empty; @@ -117,7 +122,6 @@ namespace OpenSim.Server.Handlers.MapImage } return FailureResult("Unexpected server error"); - } private byte[] SuccessResult() diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 82a9193..eae10e8 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -237,7 +237,7 @@ namespace OpenSim.Services.GridService } m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}", - regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY); + regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionCoordX, regionInfos.RegionCoordY); return String.Empty; } @@ -250,8 +250,8 @@ namespace OpenSim.Services.GridService m_log.DebugFormat( "[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}", - region.RegionName, region.RegionID, region.posX, region.posY); - + region.RegionName, region.RegionID, region.coordX, region.coordY); + int flags = Convert.ToInt32(region.Data["flags"]); if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Data.RegionFlags.Persistent) != 0) diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 41dd20c..7137f9a 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -103,9 +103,8 @@ namespace OpenSim.Services.Interfaces int GetRegionFlags(UUID scopeID, UUID regionID); } - public class GridRegion : Object + public class GridRegion { - /// /// The port by which http communication occurs with the region /// @@ -149,6 +148,19 @@ namespace OpenSim.Services.Interfaces protected IPEndPoint m_internalEndPoint; + /// + /// The co-ordinate of this region. + /// + public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } } + + /// + /// The co-ordinate of this region + /// + public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } } + + /// + /// The location of this region in meters. + /// public int RegionLocX { get { return m_regionLocX; } @@ -156,6 +168,9 @@ namespace OpenSim.Services.Interfaces } protected int m_regionLocX; + /// + /// The location of this region in meters. + /// public int RegionLocY { get { return m_regionLocY; } @@ -407,8 +422,6 @@ namespace OpenSim.Services.Interfaces if (kvp.ContainsKey("Token")) Token = kvp["Token"].ToString(); - } } - } diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index 83727b6..a85ee70 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs @@ -208,7 +208,7 @@ namespace OpenSim.Services.MapImageService private bool CreateTile(uint zoomLevel, int x, int y) { - m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel); +// m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel); int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2); int thisWidth = (int)Math.Pow(2, (double)zoomLevel - 1); -- cgit v1.1 From b89534ad0a8a0be24f27634b9a198e2b53f129e0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Nov 2011 00:34:13 +0000 Subject: Remove mono compiler warnings. Fix problem with co-ordinate given in deregister region message --- OpenSim/Data/IRegionData.cs | 10 +++++----- .../Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs | 2 -- OpenSim/Server/Handlers/Map/MapGetServerConnector.cs | 6 ++++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index 4761a7a..0068daa 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs @@ -47,19 +47,19 @@ namespace OpenSim.Data /// The position in meters of this region. /// public int posY; - + public int sizeX; public int sizeY; /// - /// Return the x-coordinate of this region. We currently assume that every region is the same size. + /// Return the x-coordinate of this region. /// - public int coordX { get { return (sizeX != 0) ? posX / sizeX : -1; } } + public int coordX { get { return (sizeX != 0) ? posX / (int)Constants.RegionSize : -1; } } /// - /// Return the y-coordinate of this region. We currently assume that every region is the same size. + /// Return the y-coordinate of this region. /// - public int coordY { get { return (sizeY != 0) ? posY / sizeY : -1; } } + public int coordY { get { return (sizeY != 0) ? posY / (int)Constants.RegionSize : -1; } } public Dictionary Data; } diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs index 5c89d0f..56f130e 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs @@ -99,7 +99,6 @@ namespace OpenSim.Server.Handlers.Hypergrid } return FailureResult(); - } #region Method-specific handlers @@ -127,7 +126,6 @@ namespace OpenSim.Server.Handlers.Hypergrid return FailureResult(); } - string perms = "0"; FriendInfo[] friendsInfo = m_FriendsService.GetFriends(principalID); foreach (FriendInfo finfo in friendsInfo) { diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs index e8a424f..501074d 100644 --- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs @@ -42,7 +42,8 @@ namespace OpenSim.Server.Handlers.MapImage { public class MapGetServiceConnector : ServiceConnector { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private IMapImageService m_MapService; private string m_ConfigName = "MapImageService"; @@ -69,7 +70,8 @@ namespace OpenSim.Server.Handlers.MapImage class MapServerGetHandler : BaseStreamHandler { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private IMapImageService m_MapService; public MapServerGetHandler(IMapImageService service) : -- cgit v1.1 From 21353de9b729e2f01da52eb9664df4d53de638e3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Nov 2011 00:34:56 +0000 Subject: Enable v2/v3 map tile url setting on robust as default in config This is necessary to see map tiles on v2/v3 viewers and appears to work fine --- bin/Robust.HG.ini.example | 2 +- bin/Robust.ini.example | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index a23063d..eee7dc8 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -237,7 +237,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 AllowRemoteSetLoginLevel = "false" ; For V2 map - ; MapTileURL = "http://127.0.0.1:8002"; + MapTileURL = "http://127.0.0.1:8002"; ; If you run this login server behind a proxy, set this to true ; HasProxy = false diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example index 897cfde..beef1c3 100644 --- a/bin/Robust.ini.example +++ b/bin/Robust.ini.example @@ -222,7 +222,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 AllowRemoteSetLoginLevel = "false" ; For V2 map - ; MapTileURL = "http://127.0.0.1:8002"; + MapTileURL = "http://127.0.0.1:8002"; ; If you run this login server behind a proxy, set this to true ; HasProxy = false -- cgit v1.1 From 10a23a823edb261af2c0b7895ce0898ea6918ef1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Nov 2011 01:16:07 +0000 Subject: Get rid of the spurious [WEB UTIL] couldn't decode : Invalid character 'O' in input string messages These are just the result of an attempt to canonicalize received messages - it's not important that we constantly log them. Also finally get the deregister grid service message working properly --- OpenSim/Data/IRegionData.cs | 4 ++-- OpenSim/Framework/WebUtil.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 8 ++++++-- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 3 +-- .../Services/Connectors/Simulation/SimulationServiceConnector.cs | 2 +- OpenSim/Services/GridService/GridService.cs | 4 ++-- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index 0068daa..546b5e8 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs @@ -54,12 +54,12 @@ namespace OpenSim.Data /// /// Return the x-coordinate of this region. /// - public int coordX { get { return (sizeX != 0) ? posX / (int)Constants.RegionSize : -1; } } + public int coordX { get { return posX / (int)Constants.RegionSize; } } /// /// Return the y-coordinate of this region. /// - public int coordY { get { return (sizeY != 0) ? posY / (int)Constants.RegionSize : -1; } } + public int coordY { get { return posY / (int)Constants.RegionSize; } } public Dictionary Data; } diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index cafa441..c6be79e 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -297,7 +297,7 @@ namespace OpenSim.Framework catch (Exception e) { // don't need to treat this as an error... we're just guessing anyway - m_log.DebugFormat("[WEB UTIL] couldn't decode <{0}>: {1}",response,e.Message); +// m_log.DebugFormat("[WEB UTIL] couldn't decode <{0}>: {1}",response,e.Message); } return result; diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 0e22156..d76ed3e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -174,7 +174,6 @@ namespace OpenSim.Region.Framework.Scenes { // We're ignoring a collection was modified error because this data gets old and outdated fast. } - } /// @@ -182,13 +181,18 @@ namespace OpenSim.Region.Framework.Scenes /// protected void SendCloseChildAgent(UUID agentID, ulong regionHandle) { - m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle); // let's do our best, but there's not much we can do if the neighbour doesn't accept. //m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID); uint x = 0, y = 0; Utils.LongToUInts(regionHandle, out x, out y); + GridRegion destination = m_scene.GridService.GetRegionByPosition(m_regionInfo.ScopeID, (int)x, (int)y); + + m_log.DebugFormat( + "[INTERGRID]: Sending close agent {0} to region at {1}-{2}", + agentID, destination.RegionCoordX, destination.RegionCoordY); + m_scene.SimulationService.CloseAgent(destination, agentID); } diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index e8ae05b..b65a443 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -220,14 +220,13 @@ namespace OpenSim.Server.Handlers.Simulation responsedata["int_response_code"] = HttpStatusCode.OK; responsedata["str_response_string"] = "OpenSim agent " + id.ToString(); - m_log.Debug("[AGENT HANDLER]: Agent Released/Deleted."); + m_log.DebugFormat("[AGENT HANDLER]: Agent {0} Released/Deleted from region {1}", id, regionID); } protected virtual void ReleaseAgent(UUID regionID, UUID id) { m_SimulationService.ReleaseAgent(regionID, id, ""); } - } public class AgentPostHandler : BaseStreamHandler diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 7cbd361..c45f456 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -369,7 +369,7 @@ namespace OpenSim.Services.Connectors.Simulation /// public bool CloseAgent(GridRegion destination, UUID id) { - // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start"); +// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start"); string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index eae10e8..89f0716 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -249,7 +249,7 @@ namespace OpenSim.Services.GridService return false; m_log.DebugFormat( - "[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}", + "[GRID SERVICE]: Deregistering region {0} ({1}) at {2}-{3}", region.RegionName, region.RegionID, region.coordX, region.coordY); int flags = Convert.ToInt32(region.Data["flags"]); @@ -296,7 +296,7 @@ namespace OpenSim.Services.GridService } } - m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count); +// m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count); } else { -- cgit v1.1 From 726ca72c479dc5c9510631e675c932f1331e92bb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Nov 2011 01:27:06 +0000 Subject: minor: Make HelloNeighbour messages more informative --- .../Neighbour/LocalNeighbourServiceConnector.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs index f71bf46..40cc536 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs @@ -25,11 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using log4net; -using Nini.Config; using System; using System.Collections.Generic; using System.Reflection; +using log4net; +using Nini.Config; +using OpenMetaverse; using OpenSim.Framework; using OpenSim.Server.Base; using OpenSim.Region.Framework.Interfaces; @@ -119,10 +120,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour #region INeighbourService - public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) + public OpenSim.Services.Interfaces.GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) { - m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}.", - thisRegion.RegionName, regionHandle); + uint x, y; + Utils.LongToUInts(regionHandle, out x, out y); + + m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from region {0} to region at {1}-{2}", + thisRegion.RegionName, x / Constants.RegionSize, y / Constants.RegionSize); + foreach (Scene s in m_Scenes) { if (s.RegionInfo.RegionHandle == regionHandle) -- cgit v1.1 From 2206e2fc9680240ce8ddad985998febc18896850 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 19 Nov 2011 01:32:21 +0000 Subject: Remove the "[LOCAL SIMULATION CONNECTOR]: Did not find region {0} for SendCreateChildAgent" message This is misleading since a simulator will call this method before successfully trying remote regions. Also comments out spammy "[SIMULATION]: Stream handler called" AgentHandlers messages for now. --- .../ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | 1 - OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 2cf02b5..a17c6ae 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs @@ -196,7 +196,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation } } - m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Did not find region {0} for SendCreateChildAgent", destination.RegionName); reason = "Did not find region " + destination.RegionName; return false; } diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index b65a443..fdb4967 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -251,7 +251,7 @@ namespace OpenSim.Server.Handlers.Simulation public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { - m_log.DebugFormat("[SIMULATION]: Stream handler called"); +// m_log.DebugFormat("[SIMULATION]: Stream handler called"); Hashtable keysvals = new Hashtable(); Hashtable headervals = new Hashtable(); @@ -438,7 +438,7 @@ namespace OpenSim.Server.Handlers.Simulation public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { - m_log.DebugFormat("[SIMULATION]: Stream handler called"); +// m_log.DebugFormat("[SIMULATION]: Stream handler called"); Hashtable keysvals = new Hashtable(); Hashtable headervals = new Hashtable(); -- cgit v1.1