diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index ef61200f52..4532e76e25 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -226,6 +226,15 @@ namespace OpenSim.Framework.Servers.HttpServer return true; } + private void OnRequest(object source, RequestEventArgs args) + { + IHttpClientContext context = (IHttpClientContext)source; + IHttpRequest request = args.Request; + + OnHandleRequestIOThread(context,request); + + } + public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request) { OSHttpRequest req = new OSHttpRequest(context, request); @@ -1406,7 +1415,7 @@ namespace OpenSim.Framework.Servers.HttpServer { //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); //m_httpListener.Prefixes.Add("http://10.1.1.5:" + m_port + "/"); - m_httpListener2 = new CoolHTTPListener(m_listenIPAddress, (int)m_port); + m_httpListener2 = CoolHTTPListener.Create(m_listenIPAddress, (int)m_port); m_httpListener2.ExceptionThrown += httpServerException; m_httpListener2.LogWriter = httpserverlog; @@ -1414,7 +1423,7 @@ namespace OpenSim.Framework.Servers.HttpServer // if you want more detailed trace information from the HttpServer //m_httpListener2.UseTraceLogs = true; - m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; + //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; } else { @@ -1422,7 +1431,7 @@ namespace OpenSim.Framework.Servers.HttpServer //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); } - m_httpListener2.RequestHandler += OnHandleRequestIOThread; + m_httpListener2.RequestReceived += OnRequest; //m_httpListener.Start(); m_httpListener2.Start(64); HTTPDRunning = true; @@ -1474,10 +1483,10 @@ namespace OpenSim.Framework.Servers.HttpServer { HTTPDRunning = false; m_httpListener2.ExceptionThrown -= httpServerException; - m_httpListener2.DisconnectHandler = null; + //m_httpListener2.DisconnectHandler = null; m_httpListener2.LogWriter = null; - m_httpListener2.RequestHandler -= OnHandleRequestIOThread; + m_httpListener2.RequestReceived -= OnRequest; m_httpListener2.Stop(); } diff --git a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs index 48db44db9e..f7f0afab18 100644 --- a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs +++ b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs @@ -46,6 +46,10 @@ namespace OpenSim.Framework.Servers.Tests public class TestHttpClientContext: IHttpClientContext { private bool _secured; + public bool IsSecured + { + get { return _secured; } + } public bool Secured { get { return _secured; } @@ -62,10 +66,19 @@ namespace OpenSim.Framework.Servers.Tests public void Respond(string body) {} public void Send(byte[] buffer) {} public void Send(byte[] buffer, int offset, int size) {} + public void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body, string contentType) {} + + public event EventHandler Disconnected = delegate { }; + /// + /// A request have been received in the context. + /// + public event EventHandler RequestReceived = delegate { }; + } public class TestHttpRequest: IHttpRequest { + private string _uriPath; public bool BodyIsComplete { get { return true; } @@ -183,6 +196,24 @@ namespace OpenSim.Framework.Servers.Tests return clone; } + public IHttpResponse CreateResponse(IHttpClientContext context) + { + return new HttpResponse(context, this); + } + /// + /// Path and query (will be merged with the host header) and put in Uri + /// + /// + public string UriPath + { + get { return _uriPath; } + set + { + _uriPath = value; + + } + } + } public class TestHttpResponse: IHttpResponse diff --git a/OpenSim/Region/UserStatistics/Default_Report.cs b/OpenSim/Region/UserStatistics/Default_Report.cs index 668fd45f11..0e1763046d 100644 --- a/OpenSim/Region/UserStatistics/Default_Report.cs +++ b/OpenSim/Region/UserStatistics/Default_Report.cs @@ -112,15 +112,15 @@ TD.align_top { vertical-align: top; } ajaxUpdaterDivs[0] = "activeconnections"; ajaxUpdaterSeconds[0] = 10; - ajaxUpdaterReportFragments[0] = "activeconnectionsajax.ajax"; + ajaxUpdaterReportFragments[0] = "activeconnectionsajax.html"; ajaxUpdaterDivs[1] = "activesimstats"; ajaxUpdaterSeconds[1] = 20; - ajaxUpdaterReportFragments[1] = "simstatsajax.ajax"; + ajaxUpdaterReportFragments[1] = "simstatsajax.html"; ajaxUpdaterDivs[2] = "activelog"; ajaxUpdaterSeconds[2] = 5; - ajaxUpdaterReportFragments[2] = "activelogajax.ajax"; + ajaxUpdaterReportFragments[2] = "activelogajax.html"; HTMLUtil.InsertPeriodicUpdaters(ref output, ajaxUpdaterDivs, ajaxUpdaterSeconds, ajaxUpdaterReportFragments); diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index 0807607893..a65b84cedc 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs @@ -110,9 +110,9 @@ namespace OpenSim.Region.UserStatistics reports.Add("", rep); reports.Add("prototype.js", protodep); reports.Add("updater.js", updatedep); - reports.Add("activeconnectionsajax.ajax", ajConnections); - reports.Add("simstatsajax.ajax", ajSimStats); - reports.Add("activelogajax.ajax", ajLogLines); + reports.Add("activeconnectionsajax.html", ajConnections); + reports.Add("simstatsajax.html", ajSimStats); + reports.Add("activelogajax.html", ajLogLines); reports.Add("clients.report", clientReport); reports.Add("sessions.report", sessionsReport); diff --git a/ThirdPartyLicenses/C# Webserver.txt b/ThirdPartyLicenses/C# Webserver.txt index 40511b5fbb..b99689154b 100644 --- a/ThirdPartyLicenses/C# Webserver.txt +++ b/ThirdPartyLicenses/C# Webserver.txt @@ -1,145 +1,71 @@ -Files: HttpServer.dll +Files: HttpServer_OpenSim.dll -Version 2.1, February 1999 +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ -Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] +1. Definitions. -Preamble +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. -This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. -When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. -To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. -We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). -To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. -Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. -When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. +2. Grant of Copyright License. -We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. -For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. +3. Grant of Patent License. -In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. -Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. +4. Redistribution. -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and -0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". +2. You must cause any modified files to carry prominent notices stating that You changed the files; and -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. +5. Submission of Contributions. -1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. +6. Trademarks. -2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. -a) The modified work must itself be a software library. +7. Disclaimer of Warranty. -b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. -c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. +8. Limitation of Liability. -d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. -(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) +9. Accepting Warranty or Additional Liability. -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the Library into a program that is not a library. - -4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. - -5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. - -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. - -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - -6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. - -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: - -a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) - -b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. - -c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. - -d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. - -e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. - -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - -7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. - -b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. - -8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. - -10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - -11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - -14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. \ No newline at end of file +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. \ No newline at end of file diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll index bc2783502d..77042a0b98 100644 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 new file mode 100644 index 0000000000..e3abbe2f7c Binary files /dev/null and b/bin/HttpServer_OpenSim.pdb differ diff --git a/bin/HttpServer_OpenSim.xml b/bin/HttpServer_OpenSim.xml index 747f35d1eb..22cc1c0932 100644 --- a/bin/HttpServer_OpenSim.xml +++ b/bin/HttpServer_OpenSim.xml @@ -4,400 +4,991 @@ HttpServer_OpenSim - + - Cookies that should be set. + Interface for sessions - + - 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 + Remove everything from the session - + - Returns an enumerator that iterates through the collection. + 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 + + + + 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 . + + + + + The server encountered an unexpected condition which prevented it from fulfilling the request. + + + + + 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. + + + + + Initializes a new instance of the class. + + error message. + + + + Initializes a new instance of the class. + + error message. + inner exception. + + + + Used to inform http server that + + + + + Eventarguments used when an exception is thrown by a module + + the exception + + + + Exception thrown in a module + + + + + 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 + + + + + + + + + + Represents a field in a multipart form + + + + 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. + + + + + 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 - A that can be used to iterate through the collection. + true if connection can be accepted; otherwise false. - 1 - + - Gets the count of cookies in the collection. + A client have been accepted, but not handled, by the listener. - + - Gets the cookie of a given identifier (null if not existing). + 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. + + + + + Interface for form content decoders. - + - Generates C#/HTML from HAML code. + - HAML documentation: http://haml.hamptoncatlin.com/docs/rdoc/classes/Haml.html + 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. - + - A code generator is used to convert template code to something that we can - work with, as HTML or c# code. + 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 - + - Generate C# code from the template. + - A that the generated code will be written to. - If the template have not been parsed first. - If template is incorrect + 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. + - + - Parse a file and convert into to our own template object code. + Recursive function that will go through an xml element and store it's content + to the form item. - Path and filename to a template - If something is incorrect in the template. - - - - - + (parent) Item in form that content should be added to. + Node that should be parsed. - + - Parse a file and convert into to our own template object code. + Checks if the decoder can handle the mime type - A containing our template - If something is incorrect in the template. + 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 - + - Initializes a new instance of the class. + 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. + + + + + 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. - + - Initializes a new instance of the class. + Tag used for authentication. - The log writer. - + - Check and validate indentation + Initializes a new instance of the class. - line to check - number of white spaces - number of indentations (2 white spaces = 1 intend, 1 tab = 1 intend) + Delegate used to provide information used during authentication. + Delegate used to determine if authentication is required (may be null). - + - Check indentation + Initializes a new instance of the class. - fills line with intend info + Delegate used to provide information used during authentication. - + - check if current line is a multi line + Create a response that can be sent in the WWW-Authenticate header. - previous line - current line + Realm that the user should authenticate in + Array with optional options. + A correct authentication request. + If realm is empty or null. - + - Generate HTML code from the template. - Code is encapsulated in <% and <%= + An authentication response have been received from the web browser. + Check if it's correct - A that the generated code will be written to. - If the template have not been parsed first. - If template is incorrect + 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. - + - Get the first word (letters and digits only) from the specified offset. + 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 - + - Check indentation / node placement + 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. - + - Parse a node - todo: improve doc - - - - - - - - - PreParse goes through the text add handles indentation - and all multi line cases. - - Reader containing the text - - - - print the entire document - - - - - Print line information to the console - - - - - - Read next line from file - - true if line could be read; false if EOF. - - - - Generates a string with spaces. - - number of spaces. - string of spaces. - - - - Parse a file and convert into to our own template object code. - - Path and filename to a template - If something is incorrect in the template. - - - - - - - - - - Parse a file and convert into to our own template object code. - - A containing our template - If something is incorrect in the template. - - - - Generate C# code from the template. - - A that the generated code will be written to. - If the template have not been parsed first. - If template is incorrect - - - - Property to retrieve the root node for the latest parsed document - - - - - 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 thier targets. + Decodes authorization header value + header value + Encoding that the buffer is in + All headers and their values if successful; otherwise null - [a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase) - ]]> + NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII); + Can handle lots of whitespaces and new lines without failing. - + - redirects from one url to another. + 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. - + - Rules are used to perform operations before a request is being handled. - Rules can be used to create routing etc. + Gets or sets whether the token supplied in is a + HA1 generated string. - + - Process the incoming request. + Class that receives Requests from a . - incoming http request - outgoing http response - true if response should be sent to the browser directly (no other rules or modules will be processed). + + + + 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 to find a realm/domain. + + + - returning true means that no modules will get the request. Returning true is typically being done - for redirects. + Realms are used during HTTP Authentication - If request or response is null. + + - + - Initializes a new instance of the class. + A complete HTTP server, you need to add a module to it to be able to handle incoming requests. - Absolute path (no servername) - Absolute path (no servername) - server.Add(new RedirectRule("/", "/user/index")); + + // 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. + Initializes a new instance of the class. - Absolute path (no servername) - Absolute path (no servername) - true if request should be redirected, false if the request uri should be replaced. - - server.Add(new RedirectRule("/", "/user/index")); - + Used to get all components used in the server.. - + - 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. - - - - - string to match request url with. - - Is compared to request.Uri.AbsolutePath - - - - Where to redirect. + Initializes a new instance of the class. - + - true if we should redirect. + 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. - false means that the rule will replace - the current request uri with the new one from this class. + Default implementation does nothing. + client that disconnected + disconnect reason - + - Initializes a new instance of the class. + Handle authentication - Expression to match url - Expression to generate url - - [a-zA-Z0-9]+)", "/user/${first}")); - Result of ie. /employee1 will then be /user/employee1 - ]]> - + + + + true if request can be handled; false if not. + Invalid authorization header - + - Initializes a new instance of the class. + Will request authentication. - 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 - ]]> - - - - - 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. + Sends respond to client, nothing else can be done with the response after this. - If request or response is null + + + - + - Interface used to load templates from different sources. + 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 - + - Load a template into a and return it. + write an entry to the log file - Relative path (and filename) to template. - a if file was found; otherwise null. + importance of the message + log message - + - Fetch all files from the resource that matches the specified arguments. + write an entry to the log file - Where the file should reside. - Files to check - a list of files if found; or an empty array if no files are found. + object that wrote the message + importance of the message + log message - + - Check's whether a template should be reloaded or not. + Server that is handling the current request. - template information - true if template is OK; false if it do not exist or are old. + + Will be set as soon as a request arrives to the object. + - + - Returns whether or not the loader has an instance of the file requested + Modules used for authentication. The module that is is added first is used as + the default authentication module. - The name of the template/file - True if the loader can provide the file + 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. + @@ -657,206 +1248,389 @@ - + - Contains a connection to a browser/client. + PrototypeJS implementation of the javascript functions. - + - Contains a connection to a browser/client. + Requests a url through ajax - - - - Disconnect from client - - error to report in the delegate. - - - - Send a response. - - Either HttpHelper.HTTP10 or HttpHelper.HTTP11 - http status code - reason for the status code. - html body contents, can be null or empty. - If httpVersion is invalid. - - - - Send a response. - - Either HttpHelper.HTTP10 or HttpHelper.HTTP11 - 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 - - - - - - Using SSL or other encryption method. - - - - - Buffersize determines how large the HTTP header can be. - - - - - Initializes a new instance of the class. - - true if the connection is secured (SSL/TLS) - client that connected. - delegate handling incoming requests. - delegate being called when a client disconnectes - Stream used for communication - If beginreceive fails - delegate used to write log entries - - - - - - Initializes a new instance of the class. - - true if the connection is secured (SSL/TLS) - delegate handling incoming requests. - client that connected - Stream used for communication - If beginreceive fails - - - - - - Disconnect from client - - error to report in the delegate. - - - - This method checks the request if a responde to 100-continue should be sent. - - - 100 continue is a value in the Expect header. - It's used to let the webserver determine if a request can be handled. The client - waits for a reply before sending the body. - - - - - Send a response. - - Either HttpHelper.HTTP10 or HttpHelper.HTTP11 - http status code - reason for the status code. - html body contents, can be null or empty. - If httpVersion is invalid. - - - - Send a response. - - Either HttpHelper.HTTP10 or HttpHelper.HTTP11 - 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 - - - - - - Using SSL or other encryption method. - - - - - 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. - - - - - A controller module is a part of the ModelViewController design pattern. - It gives you a way to create user friendly URLs. - - - The controller module uses the flyweight pattern which means that - the memory usage will continue to increase until the module have - enough objects in memory to serve all concurrent requests. The objects - are reused and will not be freed. - + 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. - ControllerModule module = new ControllerModule(); - module.Add(new UserController()); - module.Add(new SearchController()); - myWebsite.Add(module); + // 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>"; - + - A HttpModule can be used to serve urls. The module itself - decides if it should serve a url or not. In this way, you can - get a very flexible http app since you can let multiple modules - serve almost similiar urls. + 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);"); + + + + + + Event driven parser used to parse incoming HTTP requests. - Throw UnauthorizedException if you are using a AuthenticationModule and want to prompt for username/password. + 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. + + + + + 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 + + + + + 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. + + + + + 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 + + + + 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. @@ -887,113 +1661,424 @@ can continue processing afterwards. Default is false. - + - The controller module uses the prototype design pattern - to be able to create new controller objects for requests - if the stack is empty. + 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. - A prototype which will be cloned for each request - - If a controller with that name have been added already. - + - Method that process the incoming request. + 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. - + - Get a prototype + List with all mime-type that are allowed. - in lowercase, without "Controller" - The controller if found; otherwise null. - - - //fetches the class UserController - RequestController userController = controllerModule["user"]; - - + All other mime types will result in a Forbidden http status code. - + - Initializes a new instance of the class. + The purpose of this module is to serve files. - A controller used to handle certain URLs. Will be cloned for each parallel request. - + - Retrieve a previously created controller (or a new one if none exist). + 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. + + + - + - Add a controller + 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. - + - Prototype controller used for cloning. + return a file extension from an absolute Uri path (or plain filename) - The prototype. + + - + - Will contain helper functions for javascript. + List with all mime-type that are allowed. + All other mime types will result in a Forbidden http status code. - + - Requests a url through ajax + characters that may not exist in a path. - 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'"); + fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" }; + + + + 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. + - // ajax request using this.href - string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>"; - - + + A that can be used to iterate through the collection. + + 1 - + - Ajax requests that updates an element with - the fetched content + Returns an enumerator that iterates through a collection. - 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"); - - + + + An object that can be used to iterate through the collection. + + 2 - + - Opens contents in a dialog window. + Form name as lower case - url to contents of dialog - link title - name, value, name, value, all parameter names should end with colon. - + - Close a javascript dialog window/div. + Get a form item. - javascript for closing a dialog. - + + 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 + + + + 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. + + + + 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. + + + + + 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. @@ -1057,1007 +2142,37 @@ value = user.RealName; } /// - + - Methods marked with BeforeFilter will be invoked before each request. + 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 - - BeforeFilters should take no arguments and return false - if controller method should not be invoked. - - - + - Initializes a new instance of the class. + Let's copy all the cookies. - - BeforeFilters should take no arguments and return false - if controller method should not be invoked. - + value from cookie header. - + - Initializes a new instance of the class. + Adds a cookie in the collection. - Specify if the filter should be invoked among the first filters, in between or among the last. - - BeforeFilters should take no arguments and return false - if controller method should not be invoked. - + cookie to add + cookie is null - + - Filters position in before filter queue + Gets a collection enumerator on the cookie list. + collection enumerator - + - Determins when a before filter is executed. + Remove all cookies. - - - - Filter will be invoked first (unless another filter is added after this one with the First position) - - - - - Invoke after all first filters, and before the last filters. - - - - - Filter will be invoked last (unless another filter is added after this one with the Last position) - - - - - 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. - - - - - Authentication modules are used to implement different - kind of http 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 auth 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 authenticationHeader is invalid - If any of the paramters is empty or null. - - - - Used to invoke the auth delegate that is used to lookup the username/realm. - - Realm (domain) that user want to authenticate in - Username - 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 ForbiddenException 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. - - - - 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. - - - - - The follow node allows users to display code in a haml document - - - #main Welcome =user.FirstName - - - - - Child nodes may not be the first node on a line - - - - - A node represents a controller code and contents. For example a html tag, an attribute list or something else. - - - - - Add a new node - - parent node. - - - - Modifiers are used to modify the first node on the line. - Typical modifiers are attribute lists, class names and IDs. - - Modifier node - - - - Parse node contents add return a fresh node. - - List containing all node types - Node that this is a subnode to. Can be null - Line to parse - Where to start the parsing. Should be set to where the next node should start parsing. - A node corresponding to the bla bla; null if parsing failed. - - - - - determines if this node can handle the line (by checking the first word); - - Controller char (word) - true if text belongs to this node type - First node on line, used since some nodes cannot exist on their own on a line. - - - - Generate HTML code (with ASP tags) - - - - - - Converts the node to c# code - - true if we are inside the internal stringbuilder - c# code - - - - Convert the node to c# code - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - c# code - - - - Generate C# code of the node - - true if we are inside the internal stringbuilder - code is small enough to fit on one row. - smallEnough is a default value, recalc it - c# code - - - - Get intendation level for this node. - - - - - - Returns true if the node is applicable after another node as text instead of being applied as a modifier - - - - - Count our children and our childrens children and so on... - - - - - All child nodes for this node. - - - - - Should only be set for each parent. - - - - - Modifiers are used to modify the first node on the line. - Typical modifiers are attribute lists, class names and IDs. - - - - - Last modifier for this node - - - - - - Number of modifiers for this line. - - - - - Parent node. - - - - - Child nodes may not be the first node on a line - - parent node - - - - Creates a DIV node and add's the specified node to it. - - Contains all prototypes for each control char. used to instanciate new nodes. - parent node - current line information - node to add to the DIV node - current node - - - - Get endposition for this modifier. - - where to start searching - contents of the current line - char that tells us that this is the end position - index on the current line - - - - Get endposition for this modifier. - - where to start searching - contents of the current line - index on the current line - - - - This is a plain text node - - - - - Contains C# code that will be rendered into the view. - - Parent node - - - - Parse node contents add return a fresh node. - - List containing all node types - Node that this is a subnode to. Can be null - Line to parse - Where to start the parsing. Should be set to where the next node should start parsing. - A node corresponding to the bla bla; null if parsing failed. - - - - - determines if this node can handle the line (by checking the first word); - - Controller char (word) - true if text belongs to this node type - first node on line - - - - Generate HTML for this node (with asp tags for code) - - - - - - = is placed at the end of a tag definition, after class, id, and attribute declarations. - It’s just a shortcut for inserting Ruby code into an element. It works the same as = without a tag: - it inserts the result of the Ruby code into the template. - However, if the result is short enough, it is displayed entirely on one line. - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - smallEnough is a default value, recalc it - c# code - - - - Determines if this is a textnode (containg plain text) - - - - - Contains HTML attributes. - - - - - Create a new node - - parent node - collection of attributes - - - - create an attribute node - - parent node - - - - Get an attribute - - name of the attribute (case sensitive) - attribute if found; otherwise null. - - - - Parse node contents add return a fresh node. - - List containing all node types - Node that this is a subnode to. Can be null - Line to parse - Where to start the parsing. Should be set to where the next node should start parsing. - A node corresponding to the bla bla; null if parsing failed. - - - - - determines if this node can handle the line (by checking the first word); - - Controller char (word) - true if text belongs to this node type - first node on line - - - - Convert node to HTML (with ASP-tags) - - HTML string - - - - Convert the node to c# code - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - smallEnough is a default value, recalc it - c# code - - - - html attributes - - - - - A attribute - - - - - value is a simple word or quoted text - - - - - Name of the attribute - - - - - Value, can be a statement, variable or quoted text. - - - - - Arguments being used in a template. - - - - - - - Holds the arguments connected to their names for quick access. - (since the ArgumentContainer also holds the name for the argument the mapping with strings is somewhat redundant - but since the data do 'belong' to the ArgumentContainer this solution was chosen to speed up access) - - - - - Initializes the class without any set arguments. - - - - - Initializes the class with all the arguments of the parameter class. - - Cannot be null - If arguments is null - - - - Initializes the class with the objects in the parameterlist. - Note that each object that is null must be followed by a type. - - Should contain ordered pairs/truples of string, object and type where type is optional if the object isn´t null - new TemplateArguments("Dir", "\", "Users", null, typeof(User)); - If optional type differs from type of object (if object != null) or argument name is duplicate - If the order of objects is incorrect - If any argument name or type is null - - - - A function that merges two argument holders updating and adding values - - - If arguments is null - - - - Clears added arguments - - - - - Adds an argument. - (Will throw ArgumentException on duplicates since adding an argument twice points to incorrect code, for ways around - this - - Cannot be null - Cannot be null - If argumentName or argumentObject is null - If an argument named argumentName already exists - - - - Adds an argument. Allows for argumentObject to be null - (Will throw ArgumentException - - Cannot be null - - Cannot be null - If argumentName or argumentType is null - If an argument named argumentName already exists or argumentObject != null and typeof(argumentObject) differs from argumentType - - - - Updates an already added argument - - Cannot be null - Cannot be null - If no argument named argumentName exists - If argumentName or argumentObject is null - - - - Updates an already added argument, allows for argumentObject to be null - - Cannot be null - - Cannot be null - If argumentName or argumentType is null - If an argument named argumentName doesn´t exists or argumentObject != null and typeof(argumentObject) differs from argumentType - - - - Clears all added arguments - - - - - Retrieves the arguments - (Does so now by copying the values to a new array, could be optimized?) - - An array containing arguments with name, object and type - - - - Returns a individual hashcode built upon the specified types the class is holding - - The hashcode is made by joining the typenames of all held arguments and making a string hashcode from them - - - - - Retrieves a concated typename ie DictinaryInt32String - - The type to retrieve the name for - - - - Checks whether a specific argument is specified or not. - - Argument name - true if argument is specified; otherwise false. - - - - Function to make it possible to index out known arguments - - The name of an added argument - Null if no ArgumentContainer by name was found - - - - A container class grouping mapping name, argument type and the argument object - - - - - Contains the name mapped to the argument - - - - - Contains the type of the argument, this must be valid if _argumentObject is null - - - - - Holds the actual object - - - - - Constructor to initiate an ArgumentContainer, will set the ArgumentType to the value of the argumentObject's type - - Cannot be null - Cannot be null - If argumentName or argumentObject is null - - - - Alternative constructor allowing argumentObject parameter to be null - - Cannot be null - - Cannot be null - If argumentName or argumentType is null - If argumentObject != null and argumentType != typeof(argumentObject) - - - - Sets the object and type of the argument, equal to ArgumentContainer.Object = ... - - Cannot be null - If argumentObject is null - - - - Sets the argument object and type. Type of the object and argumentType must correspond. - - - Cannot be null - If argumentType is null - If typeof(argumentObject) differs from argumentType and object != null - - - - Attribute for retrieving the name. The name cannot be set however because an argument is defined by its name - changing the name would be changing the arguments meaning, thus an argument needing a name change should rather - be recreated - - - - - Returns the type of the argument object. The property cannot be set since the type depends on and must correspond to - the type of the object - - - - - Returns or changes the argument object. If the object is to be changed to null the type must be passed aswell, - in that case - - If set value is null - - - - A partial is a HAML template that is inserted into other HAML templates. - - - - - Contains the page/controller target for the partial. - The PartialNode should be written as follows: - ex. - - _"requestedpage"{parametername="parametervalue",parametername2=parameter2,parametername3=parameter3:typeof(parameter3type)} - - - - - create a new partial node. - - parent node - - - - Determines if this node can handle the line (by checking the first word); - - Controller char (word) - True if text belongs to this node type - First node on line. - - - - Parse node contents add return a fresh node. - - Node that this is a subnode to. Can be null - A list with node types - Line to parse - Where to start the parsing. Will be set to where the next node should start parsing - A node corresponding to the bla bla; null if parsing failed. - - - - - Convert the node to c# code - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - smallEnough is a default value, recalc it - c# code - - - - Convert node to HTML (with ASP-tags) - - HTML string - - - - Helper function to retrieve the code for the partial request - - A string representing the code for invocating a render of the partial - - - - Throw an exception with predefined information - - why the exception was thrown - - - - This is a plain text node - - - - - Returns the page/controller target for the node - - - - - Loads templates from embedded resources. - - - - - Loads templates 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.list.Haml accessible via /user/list.haml or /user/list/ - - - - - Load a template into a and return it. - - Relative path (and filename) to template. - - a if file was found; otherwise null. - - - - - 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. - - - - - Always returns true since a resource won't be updated during execution - - - - - - - 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 - - - - 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 logentry. - Importance of the log message - The message. - - - - 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 hierachy. - - Name is converted to lower case. - - - - - Returns true if the class contains a HttpInput value with the corresponding name - - The field/querystring name - True if the value exists - - - - Parses an item and returns it. - This function is primarly 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. @@ -2067,512 +2182,42 @@ 1 - + - Returns an enumerator that iterates through a collection. + 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). + + + + + The request could not be understood by the server due to malformed syntax. + The client SHOULD NOT repeat the request without modifications. - - An object that can be used to iterate through the collection. - - 2 - - - - Form name as lower case - - - - - Get a form item. - - - Returns HttpInputItem.Empty if item was not found. - - - - 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 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 - - - - - 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 containg form data. - Encoding used when decoding the stream - HttpInput.EmptyLanguageNode if no parser was found. Must always return something (HttpInput.Empty instead of null) - 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. - - - - - Contains an (html) attribute list. - - - - - Rules are used during preparse - - - - - Determines if this node spans over multiple lines. - - contains line information (and text) - true if rule have previously inited a multiline. - true if this line continues onto the next./// - - - - Determines if this node spans over multiple lines. - - contains line information (and text) - true if the previous line was continued. - true if this line continues onto the next. - - - - A text only node. - - - - - - - parent node - plain text - - - - Parse node contents add return a fresh node. - - List containing all node types - Node that this is a subnode to. Can be null - Line to parse - Where to start the parsing. Should be set to where the next node should start parsing. - A node corresponding to the bla bla; null if parsing failed. - - - - - determines if this node can handle the line (by checking the first word); - - Controller char (word) - true if text belongs to this node type - true if this is the first node on the line. - - - - Generate HTML for this node. - - - - - - Convert the node to c# code - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - todo: add description - c# code - - - - The text. - - - - - Is this a text node (containing plain text)? - - - - - 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. - - - - - 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 - - - - - 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. - - - - 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. - - - - - 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 - - - - - - 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 - - - - This attribute can be used to map a controller to a specific url without using - the class name. + Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php - + - Maps a controller to a url without using the controller name. + Create a new bad request exception. - - Per default the class name is used to determine which url to handle. - For instance, "class UserController" or "class User" tells the framework that - the urls that starts with "/user" should be handled by that controller. - This attribute can be used to circumvent that. - - The name. + reason to why the request was bad. - + - The name that the controller should use + Create a new bad request exception. + reason to why the request was bad. + inner exception @@ -2641,666 +2286,194 @@ Default time is 20 minutes. - + - HTTP Listener waits for HTTP connections and provide us with s using the - delegate. + Contains a connection to a browser/client. - + - Listen for regular HTTP connections + Disconnect from client - IP Address to accept connections on - TCP Port to listen on, default HTTP port is 80. + error to report in the event. - + - Launch HttpListener in SSL mode + Send a response. - IP Address to accept connections on - TCP Port to listen on, default HTTPS port is 443 - Certificate to use + 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. - + - Launch HttpListener in SSL mode + Send a response. - IP Address to accept connections on - TCP Port to listen on, default HTTPS port is 443 - Certificate to use - which HTTPS protocol to use, default is TLS. + Either or + HTTP status code + reason for the status code. - + - Start listen for new connections + Send a response. - Number of connections that can stand in a queue to be accepted. + - + - Stop the listener + send a whole buffer - + buffer to send + - + - A client have been accepted, but not handled, by the listener. + Send data using the stream + + Contains data to send + Start position in buffer + number of bytes to send + + + + + + Using SSL or other encryption method. - + - Invoked when a client disconnects + Using SSL or other encryption method. - + - Gives you a change to receive log entries for all internals of the HTTP library. + The context have been disconnected. - You may not switch log writer after starting the listener. + Event can be used to clean up a context, or to reuse it. - + - This handler will be invoked each time a new connection is accepted. + A request have been received in the context. - + - True if we should turn on trace logs. + A have been disconnected. - + - Let's to receive unhandled exceptions from the threads. + Initializes a new instance of the class. - - Exceptions will be thrown during debug mode if this event is not used, - exceptions will be printed to console and suppressed during release mode. - + Reason to disconnection. - + - PrototypeJS implementation of the javascript functions. + Gets reason to why client disconnected. - - - 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 requested resource was not found in the web server. - - - - - 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 exception - - message describing the error - inner exception - - - - Create a new exception - - message describing the error - - - - A controller in the Model-View-Controller pattern. - Derive this class and add method with one of the following signatures: - "public string MethodName()" or "public void MyMethod()". - - The first should return a string with the response, the latter - should use SendHeader and SendBody methods to handle the response. - - - Last segment of the path is always broken into the properties Id and RequestedType - Alhtough note that the RequestedType can also be empty if no file extension have - been specified. A typical use of file extensions in controllers is to specify which type of - format to return. - - - public class MyController : RequestController - { - public string Hello() - { - if (RequestedType == "xml") - return "<hello>World<hello>"; - else - return "Hello " + Request.QueryString["user"].Value + ", welcome to my world"; - } - - public void File() - { - Response.Headers.ContentType = "text/xml"; - Response.SendHeader(); - } - } - - - - - - - - create a new request controller - - prototype to copy information from - - - - create a new controller - - - - - 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. - - - - Determines which method to use. - - Requested resource - - - - Call all before filters - - true if a before filter wants to abort the processing. - - - - Override this method to be able to process result - returned by controller method. - - - - - Override this method if you want to be able to - handle unhanded exceptions - - thrown exception - Don't "eat" exceptions derived from HttpException since - they are handled by the framework,unless your are sure of what you are - doing.. - - - - This method goes through all methods in the controller and - add's them to a dictionary. They are later used to invoke - the correct method depending on the url - - - - - Method that process the url - - Uses Uri and QueryString to determine method. - Relays response object to invoked method. - Relays session object to invoked method. - - - - Will assign all variables that are unique for each session - - - - - - - - Make a clone of this controller - - a new controller with the same base information as this one. - - - - object that was attached during http authentication process. - - - You can also assign this tag yourself if you are using regular - http page login. - - - - - - Name of this controller (class name without the "Controller" part) - - - - - Specifies the method to use if no action have been specified. - - If specified method do not exist. - - - - Id is the third part of the uri path. - - - Is extracted as in: /controllername/methodname/id/ - - string.Empty if not specified. - - - - - - Method currently being invoked. - Always in lower case. - - - - - Request information (like Url, form, querystring etc) - - - - - Extension if a filename was specified. - - - - - Response information (that is going to be sent back to the browser/client) - - - - - Session information, is stored between requests as long as the session cookie is valid. - - - - - Marks methods to let framework know that the method is protected - - - - - - - Initializes a new instance of the class. - - - + - - Level is a value defined by you. It should be used to determine the users - that can access the method tagged with the AuthRequired attribute. - - - = level; - } - } - ]]> - - + - Level is a value defined by you. It should be used to determine the users - that can access the method tagged with the AuthRequired attribute. + Initializes a new instance of the class. + + The request. + + + + Gets received request. - + - A session stored in memory. + 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. - + - Interface for sessions + Cookie value. Set to null to remove cookie. - + - Remove everything from the session + 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. - + - Remove everything from the session + Cookie is only valid under this path. - 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 - - - - - IRule that says that something :) - - - - - Determines if this node spans over multiple lines. - - contains line information (and text) - true if the previous line was continued. - true if this line continues onto the next. - - - - Represents a HTML tag. - - - - - Create a new HTML tag node. - - parent node - - - - determines if this node can handle the line (by checking the first word); - - Controller char (word) - true if text belongs to this node type - first node on line. - - - - Parse node contents add return a fresh node. - - Node that this is a subnode to. Can be null - A list with node types - Line to parse - Where to start the parsing. Will be set to where the next node should start parsing - A node corresponding to the bla bla; null if parsing failed. - - - - - Convert the node to c# code - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - smallEnough is a default value, recalc it - c# code - - - - Convert node to HTML (with ASP-tags) - - HTML string - - - - This is a plain text node - - - - - tag name - - - - - Thrown when a template cannot be compiled. - - - - - Initializes a new instance of the class. - - Template that failed compilation. - Exception thrown by the compiler. - - - - Creates and returns a string representation of the current exception. - - - A string representation of the current exception. - - - - - - - - Gets a message that describes the current exception. - - - - The error message that explains the reason for the exception, or an empty string(""). - @@ -3359,8 +2532,8 @@ The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. - The metainformation 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 metainformation about + 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. @@ -3498,8 +2671,8 @@ The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. - The metainformation 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 metainformation about + 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. @@ -3580,1836 +2753,373 @@ The TRACE method is used to invoke a remote, application-layer loop- back of the request message. - + - Contains serverside http request information. + Generic helper functions for HTTP - + - 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. - - - - Called during parsing of a IHttpRequest. - - 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 - - - - Clear everything in the request + Version string for HTTP v1.0 - + - Have all body content bytes been received? + Version string for HTTP v1.1 - + - Kind of types accepted by the client. + An empty URI - + - Submitted body contents + Parses a query string. + + Query string (URI encoded) + A object if successful; otherwise + queryString is null. + If string cannot be parsed. + + + + The object form class takes an object and creates form items for it. - + - Kind of connection used for the session. + Initializes a new instance of the class. + + form name *and* id. + action to do when form is posted. + - + - Number of bytes in the body + Initializes a new instance of the class. + form name *and* id. + action to do when form is posted. + object to get values from - + - Headers sent by the client. All names are in lower case. + Initializes a new instance of the class. + form action. + object to get values from. - + - Version of http. - Probably HttpHelper.HTTP10 or HttpHelper.HTTP11 + write out the FORM-tag. - + generated html code - + - Requested method, always upper case. + Writeout the form tag - + form should be posted through ajax. + generated html code - + - Variables sent in the query string + Generates a text box. + + + generated html code - + - Requested URI (url) + password box + + + generated html code - + - Uri absolute path splitted into parts. + Hiddens the specified property name. - - // 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. - - + Name of the property. + The options. + generated html code - + - Check's both QueryString and Form after the parameter. + Labels the specified property name. + property in object. + caption + generated html code - + - Form parameters. + Generate a checkbox + property in object + checkbox value + additional html attributes. + generated html code - - Returns true if the request was made by Ajax (Asyncronous Javascript) - - - Returns set cookies for the request - - + - Parses a HTTP request directly from a stream + Write a html select tag - - - - Create a new request parser - - delegate called when a complete request have been generated - delegate receiving log entries. - - - - Add a number of bytes to the body - - - - + object property. + id column + The title column. + The options. - + - Remove all state information for the request. + 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 - + - 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 - - - where in buffer that parsing should start - number of bytes to parse - Unparsed bytes left in buffer. - - - - Current state in parser. - - - - - Invoked when a request have been completed. - - - - - - 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 - - - - - Contains serverside 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. - - + Stream containing the content + Content type (with any additional info like boundry). Content type is always supplied in lower case + Stream encoding - A new object that is a copy of this instance. + A HTTP form, or null if content could not be parsed. - 2 + If contents in the stream is not valid input data. - + - Decode body into a form. + Checks if the decoder can handle the mime type - A list with form decoders. - If body contents is not valid for the chosen decoder. - If body is still being transferred. + 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 - - the cookies - - - - Called during parsing of a IHttpRequest. - - 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 - - - - Clear everything in the request + The requested resource was not found in the web server. - + - Have all body content bytes been received? + Create a new exception - - - - Kind of types accepted by the client. - - - - - Submitted body contents - - - - - Kind of connection used for the session. - - - - - Number of bytes in the body - - - - - Headers sent by the client. All names are in lower case. - - - - - Version of http. - Probably HttpHelper.HTTP10 or HttpHelper.HTTP11 - - - - - - Requested method, always upper case. - - - - - - Variables sent in the query string - - - - - Requested URI (url) - - - - - - 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. - - - - - - Path and query (will be merged with the host header) and put in Uri - - - - - - Check's both QueryString and Form after the parameter. - - - - - Form parameters. - - - - Returns true if the request was made by Ajax (Asyncronous Javascript) - - - Returns set cookies for the request - - - - Current request is sent over secure protocol - - - - - 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. - - - - - 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 javscript options. - Method will ALWAYS be POST. - - - - 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 containtain 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 containtain 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; - } - - - - - - 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 containtain a SELECT-tag. - - - - - 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. - - - - - Creates a checkbox. - - element name - element value - determines if the check box is selected or not. This is done diffrently depending on the - type of variable. A bool simply trigges 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 checkbox. - - element name - element id - element value - determines if the check box is selected or not. This is done diffrently depending on the - type of variable. A bool simply trigges 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 checkbox. - - element name - element id - determines if the check box is selected or not. This is done diffrently depending on the - type of variable. A bool simply trigges 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 diffrently depending on the - type of variable. A bool simply trigges 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 diffrently depending on the - type of variable. A bool simply trigges 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 - - - - - - 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. + message describing the error inner exception - + - Implements HTTP Digest authentication. It's more secure than Basic auth since password is - encrypted with a "key" from the server. + Create a new exception + + message describing the error + + + + Invoked when a client have been accepted by the - Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure. + Can be used to revoke incoming connections - + - Initializes a new instance of the class. + 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). + The socket. - + - 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 + Client may not be handled. - + - 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's to log into. - User logging in - Users password. - HTTP metod. - Uri/domain that generated the login prompt. - The qop. - The nonce. - The nc. - The cnonce. - Digest enrypted string - - - - 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. + Accepted socket. - + - Session store using memory for each session. + Client should be revoked. - + - Initializes the class setting the expirationtimer to clean the session every minute + Used to queue incoming requests. - + - Delegate for the cleanup timer + Initializes a new instance of the class. + + Called when a request should be processed. + + + + Used to process queued requests. - + - Creates a new http session + Gets or sets maximum number of allowed simultaneous requests. - - + - Creates a new http session with a specific id + 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. + + + + 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. - Id used to identify the new cookie.. - A object. - Id should be generated by the store implementation if it's null or . + Should be one of the methods declared in . - + - 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 + Gets or sets the version of the HTTP protocol that the client want to use. - + - 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. + Gets or sets requested URI path. - + - Keeps information about templates, so we know when to regenerate it. + Inversion of control interface. - + - When the template was compiled. + Add a component instance - Use this date to determine if the template is old and needs to be recompiled. + Interface type + Instance to add - + - Template file name. + Get a component. - - - - The actual template. - - - - - Validator is used to validate all input items in a form. - - - - - Initializes a new instance of the class. - - collection to be filled with errors - - - - Initializes a new instance of the class. - - collection to be filled with errors - Translation used to translate the "name" parameters in all validation methods. - - - - Initializes a new instance of the class. - - Translation used to translate the "name" parameters in all validation methods. - - - - - - form that validation should be made on. - - - - - - collection that all validation errors are added to. - form that validation should be made on. - - - - - - collection that all validation errors are added to. - form that validation should be made on. - Language category used to translate field names. - - - - Switch to a new http input. - - form to use validation for now - - - - Switch to a new http input. - - form to use validation for now - language for the validation - - - - Check if a value is digits only - - Field name. - true if field is required (may not be empty) - string if validated, otherwise string.Empty - - - - Check if a value is digits only - - Field name. - extra characters that is allowed. - true if field is required (may not be empty) - string if validated, otherwise string.Empty - - - - Check whether the specified form item is an integer. - - Form parameter to validate - value if parameter is an int; 0 if not. - - - - Check whether the specified form item is an integer. - - Form parameter to validate - Paramater is required (adds an error if it's not specified) - value if parameter is an int; 0 if not. - - - - Check whether the specified value is a double. - - Name of the parameter - Paramater is required (adds an error if it's not specified) - value if parameter is a double; 0 if not. - - - - Check whether the specified value is a currency amount. - - Name of the parameter - Paramater is required (adds an error if it's not specified) - value if parameter is a currency amount; 0 if not. - - - - Validates a string to hex - - The name of the field to validate - If the field must be set - The value if validated otherwise string.Empty - - - - Validate that a string only contains letters or digits. - - Name of form parameter to validate. - Value is required. - value if valid; otherwise string.EmptyLanguageNode. - - - - Validate that a string only contains letters or digits. - - Form parameter name. - vaue if found; otherwise string.Empty - - - - Validate that a string only contains letters, digits or the specified characters - - Form parameter name. - may not be null or empty if true. - any other allowed characters. - value if valid; otherwise string.Empty - - - - Validate that a string consists of only letters (including special letters) - - - If a value must be passed - - - - - Validate that a string consists of only letters (a-z and A-Z) - - - If a value must be passed - A string of extra character to test against, dont forget language specific characters and spaces if wished for - - - - - Check whether the specified value is an integer. - - Name of the parameter - value if parameter contains valid characters; string.Empty if not. - - - - Check whether the specified value is an integer. - - Name of the parameter - Paramater is required (adds an error if it's not specified) - value if parameter contains valid characters; string.Empty if not. - - - - Validate that a string only contains letters or digits or any of the . - - Name of form parameter to validate. - Value is required. - value if valid; otherwise string.Empty. - - - - Validate that a string only contains letters or digits or any of the . - - Form parameter name. - vaue if found; otherwise string.Empty - - - - Check's weather a parameter is null or not. - - Parameter in form - true if value is not null; otherwise false. - - - - Validate a string value - - Name of form parameter to validate. - Value is required. - value if valid; otherwise string.Empty. - - - - Validate a string parameter in the form - - Form parameter name. - vaue if found; otherwise string.Empty - - - - validates email address using a regexp. - - field name - field is required (may not be null or empty). - value if validation is ok; otherwise string.Empty. - - - - Check whether the specified value is an character. - - Name of the parameter - Paramater is required (adds an error if it's not specified) - value if parameter is an int; char.MinValue if not. - - - - Check whether the specified value is an character. - - Name of the parameter - value if parameter is an int; char.MinValue if not. - - - - Checks whether a field is true (can also be in native language). - - field name - field is required (may not be null or empty). - true if value is true; false if value is false or if validation failed. - Check validation errors to see if error ocurred. - - - - Checks whether a field is true (can also be in native language). - - field name - true if value is true; false if value is false or if validation failed. - Check validation errors to see if error ocurred. - - - - Class to handle loading of resource files - - - - - ]]> - - - - Parses a filename and sets it to the extensionless name in lowercase. The extension is cut out without the dot. - - - - - string ext; - string filename = "/uSeR/teSt.haMl"; - ParseName(ref filename, out ext); - Console.WriteLine("File: " + filename); - Console.WriteLine("Ext: " + ext); - -> user/test - -> haml - - - - - Add a resource to a specified uri without extension, ie user/test - - The uri to add the resource to - The instance describing the resource - - - - 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.list.Haml accessible via /user/list.haml or /user/list/ - - - - - 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. - - - - - 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 - - - - 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 + Interface type + Component if registered, otherwise null. - Server will throw a InternalServerException in release version if you dont - handle this delegate. + Component will get created if needed. - + - Method marked with this attribute determines if authentication is required. + Checks if the specified component interface have been added. + + + true if found; otherwise false. + + + + Add a component. + + Type being requested. + Type being created. + + + + Response that is sent back to the web browser / client. - - - - - The method should take one parameter (int level), return a bool and be protected/private. - You should throw UnauthorizedException if you are using HTTP authentication. + + 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 { - Guest, - User, - Admin, - SuperAdmin + 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; + } } - public class UserController : RequestController - { - [AuthRequired(UserLevel.User)] - public string View() - { - return "Can also be viewed by users"; - } - - [AuthValidatorAttribute] - public bool ValidateUser(int level) - { - (User)user = Session["user"]; - return user != null && user.Status >= level; - } - } - ]]> - - - - - 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 - - - - Gets the count of cookies in the collection. - - - - - Gets the cookie of a given identifier (null if not existing). - - - - - 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. - - - - - 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. - - - - 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. - - - - Will request authentication. - - - Sends respond to client, nothing else can be done with the response after this. - - - - - - - - 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 =) - - - - Accept secure connections. - - IP Address to listen on, use IpAddress.Any to accept connections on all ipaddresses/network cards. - Port to listen on. 80 can be a good idea =) - Certificate to use - - - - 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 - - - - Modules used for authentication. The module that is is added first is used as - the default authentication module. - - Use the corresponding property - in the WebSiteModule 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. - - - - 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. - - - - Generates C# rendering object using ASP similiar tags in the HTML code. - - - - - Generate C# code from the template. - - A textwriter that the generated code will be written to. - If the template have not been parsed first. - If template is incorrect - - - - Parse a file and convert into to our own template object code. - - Path and filename to a template - If something is incorrect in the template. - - - - - - - - - Parse a file and convert into to our own template object code. - - A textreader containing our template - If something is incorrect in the template. - - - - Purpose if this class is to take template objects and keep them in - memory. It will also take a filename and the code generator to use - if when the template have been changed on disk. - - - - - Initializes a new instance of the class. - - - Template loaders used to load templates from any source. - The loaders will be invoked in the order they are given, that is the first loader will always be asked to give a template - first. - - - - - Initializes a new instance of the class. - - Uses the file template loader. - - - - Add a template generator - - File extension without the dot. - Generator to handle the extension - If the generator already exists. - If file extension is incorrect - If generator is not specified. - - - cache.Add("haml", new HamlGenerator()); - - - - - - This type should be included, so it may be called from the scripts (name space and assembly). - - - - - - Checks the template. - - Template information, filename must be set. - true if template exists and have been compiled. - - - - Compiles the specified code. - - Name of template. - c# code generated from a template. - Arguments as in name, value, name, value, name, value - - An id to specify the exact instance of a template. Made from joining the 'TemplateClass' with the hashcode of the filename - and the hashcode of the supplied arguments - - Template - If compilation fails - - - - Will generate code from the template. - Next step is to compile the code. - - Path and filename to template. - - If no template generator exists for the specified extension. - If parsing/compiling fails - - - - - Find a template using wildcards in filename. - - Full path (including wildcards in filename) to where we should find a template. - First found generator if an extension was matched; otherwise null. - method is not thread safe - - - - Render a partial - - Path and filename - Variables used in the template. Should be specified as "name, value, name, value" where name is variable name and value is variable contents. - Arguments passed from parent template - - - - - - - - Generate HTML from a template. - - Path and filename - Variables used in the template. Should be specified as "name, value, name, value" where name is variable name and value is variable contents. - - - - - - string html = cache.Generate("views\\users\\view.haml", new TemplateArguments("user", dbUser, "isAdmin", dbUser.IsAdmin), null); - - - - - - Keeps information about templates, so we know when to regenerate it. - - - - - Container to bind resource names to assemblies - - - - - Instantiates an instance of - - The full name/path of the resource - The assembly the resource exists in - - - - Retrieves a stream to the resouce - - 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 - - - - - This template loader loads all templates from a folder on the hard drive. - - - - - Initializes a new instance of the class. - - A prefix that is prepended to all requested files. - - - - - Initializes a new instance of the class. - - - - - Load a template into a and return it. - - Relative path (and filename) to template. - - a if file was found; otherwise null. - - - - - 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 - - - - Check's whether a template should be reloaded or not. - - template information - - true if template is OK; false if it do not exist or are old. - - - - - A prefix that is prepended to all requested files. - - - - \\templateName.*" - mgr.PathPrefix = "views\\"; - ]]> - - - PathPrefix may not be null, only string.Empty - - - - - Helpers to make XML handling easier - - - - - Serializes object to XML. - - object to serialize. - xml - - Removes namespaces and adds intendation - + todo: add two examples, using SendHeaders/SendBody and just the Body stream. @@ -5508,6 +3218,12 @@ 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 @@ -5574,511 +3290,21 @@ 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) - - - - - 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 HttpInputItem - - - - 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 - - - - - - checks if a subitem exists (and has a value). - - name in lower case - true if the subitem 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 - - - - - 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. - HttpInputItem.Empty 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. - todo: Return a readonly collection - - - - - - - name in lower case - - - - - 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 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 - - - - Used to simply testing of controls. - - - - - Fake host name, default is "http://localhost" - - - - - Session used if null have been specified as argument to one of the class methods. - - - - - Send a GET request to a controller. - - Controller receiving the post request. - Uri visited. - Response from the controller. - Session used during the test. null = is used. - body posted by the response object - - - void MyTest() - { - ControllerTester tester = new ControllerTester(); - - MyController controller = new MyController(); - IHttpResponse response; - string text = Get(controller, "/my/hello/1?hello=world", out response, null); - Assert.Equal("world|1", text); - } - - - - - - Send a POST request to a controller. - - Controller receiving the post request. - Uri visited. - Form being processed by controller. - Response from the controller. - Session used during the test. null = is used. - body posted by the response object - - - void MyTest() - { - // Create a controller. - MyController controller = new MyController(); - - // build up a form that is used by the controller. - HttpForm form = new HttpForm(); - form.Add("user[firstName]", "Jonas"); - - // Invoke the request - ControllerTester tester = new ControllerTester(); - IHttpResponse response; - string text = tester.Get(controller, "/user/create/", form, out response, null); - - // validate response back from controller. - Assert.Equal("User 'Jonas' has been created.", text); - } - - - - - - 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. - - - - - 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. - - - - - Interface for dynamically generated templates. - - - - - - Run the template to generate HTML code. - - arguments passed to the template - template manager (a manager is used to generate templates) - HTML code. - - - - Contains information on where in the template the error occurred, and what the error was. - - - - - Initializes a new instance of the class. - - Line that the error appeared on. - error description. - - - - Initializes a new instance of the class. - - Line that the error appeared on. - error description. - line contents. - - - - Returns the actual line where the error originated - - - - - Line number in template - - - - - The ’-’ character makes the text following it into “silent” code: C# code that is evaluated, but not output. - It is not recommended that you use this widely; almost all processing code and logic should be restricted to the Controller, Helpers, or partials. - - For example - - - string foo = "hello" - - foo += " there" - - foo += " you!" - %p= foo - - - Is compiled to - -

- hello there you! -

-
-
-
- - - determines if this node can handle the line (by checking the first word); - - Controller char (word) - true if text belongs to this node type - first node on line - - - - Parse node contents add return a fresh node. - - List containing all node types - Node that this is a subnode to. Can be null - Line to parse - Where to start the parsing. Should be set to where the next node should start parsing. - A node corresponding to the bla bla; null if parsing failed. - - - - - Convert the node to c# code - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - smallEnough is a default value, recalc it - c# code - - - - Convert node to HTML (with ASP-tags) - - HTML string - - - - The compiler is responsible of creating a render object which can be - cached and used over and over again. - - - - - - - Base c# code for a template object. - - - - - Create a new template compiler - - - - - Adds the specified type. - - The type. - - - - Compiles the specified args. - - Arguments, should contain "name, value, name, value" etc. - c# code that will be included in the generated template class - Id of the template class - Tiny template if successful; otherwise null. - If compilation fails - If args are incorrect - - - - 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) - { - - } - - todo: add two examples, using SendHeaders/SendBody and just the Body stream. - Initializes a new instance of the class. - The context. - The request. + 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. @@ -6098,12 +3324,12 @@ - Make sure that you have specified ContentLength and sent the headers first. + Make sure that you have specified and sent the headers first. If headers have not been sent. - offest of first byte to send + offset of first byte to send number of bytes to send. @@ -6112,7 +3338,7 @@ - Make sure that you have specified ContentLength and sent the headers first. + Make sure that you have specified and sent the headers first. If headers have not been sent. @@ -6166,6 +3392,12 @@ 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 @@ -6181,13 +3413,13 @@ Number of seconds to keep connection alive - Only used if Connection property is set to ConnectionType.KeepAlive + Only used if Connection property is set to . Status code that is sent to the client. - Default is HttpStatusCode.Ok + Default is @@ -6204,7 +3436,7 @@ Kind of content in the body - Default is text/html + Default type is "text/html" @@ -6222,549 +3454,664 @@ Cookies that should be created/changed. - + - A reverse proxy are used to act as a bridge between local (protected/hidden) websites - and public clients. + 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 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. + + 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 - + - - - 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 - - - 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 - - - - The server encountered an unexpected condition which prevented it from fulfilling the request. + Gets or sets a value indicating whether this is secure. - + - Initializes a new instance of the class. + Path and query (will be merged with the host header) and put in Uri + + + + + + Gets whether the body is complete. - + - Initializes a new instance of the class. - - error message. - - - - Initializes a new instance of the class. - - error message. - inner exception. - - - - This attribute tells the controller that the method - uses SendHeader and/or SendBody to handle the request. + Gets kind of types accepted by the client. - + - Contains line text and state information about a line in a HAML template. + Gets or sets body stream. - + - Initializes a new instance of the class. - - The line number. - The unparsed data (line contents). - - - - Will check that all rule conditions have been met. - Will also remove the rules if they are done. - - - - - - - Append another line - - - - - - Parsed line contents (without whitespaces in the beginning) - - text contents - - - - Set intendation info to previously added line text. - - - - - - - Assign line text - - - - - - - - - - - If extra lines have been added. - - - - If the next line should be appended to us (multi line) + Gets or sets kind of connection used for the session. - + - Do NOT add yourself using the Add methods of the linkedList. - Parent property will add node. + Gets or sets number of bytes in the body. - + - Untouched line text + Gets headers sent by the client. - + - Has one or more children (intented more that this one) - - - - - Number of intends (two spaces = 1, one tab = 1) - - - - - Line number - - - - - Parent node (one level up in intendation) - - - - - All line data generated on one line - - - - - IRule have not got all needed information yet, - keep appending lines to this LineInfo until rule says that it's done. - - - - - Number of whitespaces before actual entry beings. - - - - - True if node is selfclosed (i.e. <br />) - - - - - Parse node contents add return a fresh node. - - List containing all node types - Node that this is a subnode to. Can be null - Line to parse - Where to start the parsing. Should be set to where the next node should start parsing. - A node corresponding to the bla bla; null if parsing failed. - - - - - determines if this node can handle the line (by checking the first word); - - Controller char (word) - true if text belongs to this node type - First node on line, used since some nodes cannot exist on their own on a line. - - - - Convert node to HTML (with ASP-tags) - - HTML string - - - - - Convert the node to c# code - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - smallEnough is a default value, recalc it - c# code - - - - Text nodes should be added as child. - - - - - Used to inform http server that - - - - - Eventarguments used when an exception is thrown by a module - - the exception - - - - Exception thrown in a module - - - - - View controllers integrates the templates, by adding - Render methods. - - - - - Create a new . - - - - - Create a new . - - prototype to copy information from. - - - - Render template for the currently invoked method. - - arguments/parameters used in template - template generated content - calls RenderActionWithErrors - - - - Render contents into a template. - - method/template to generate - arguments/parameters used in template - template generated content - calls RenderActionWithErrors. - - - - Merge arguments array and Arguments property. - - Arguments array to merge - arguments/parameters that can be used in the template. - Will add Request/Response/Session arguments - - - - Renders errors from the property into the - current method template, or as a JavaScript alert if the request is Ajax. - - name of the currently invoked method. - arguments used in the method template. - generated string - Creates a JavaScript Alert box if request is Ajax. - - - - Renders errors from the property into the - current method template, or as a JavaScript alert if the request is Ajax. - - A collection of errors. - name of the currently invoked method. - arguments used in the method template. - generated string - Creates a JavaScript Alert box if request is Ajax. - - - - Switches content-type to "text/JavaScript" and returns content. - - JavaScript to send to the client. - JavaScript - - - - Creates a JavaScript "alert" filled with all errors. - - - a - - - - renders one of the layouts - - layout to render (should be found in the "views\\layouts" folder). - contents will be put in the template variable called "text". - generated text/HTML. - - - - Render a template. - - Merges the Arguments property with the args parameter and pass those to the template. - controller name are used as a folder name when looking for the template. - method are used as filename when looking for the template. - arguments that should be passed to the template. - - - - - Invoked each time a new request is about to be invoked. - - Can be used to clear old data. - - - - - - - Arguments that are being used in the templates. - - - - - A set of errors that occurred during request processing. - Key should be argument name (if argument error, otherwise ), value should be - the error message. - - Errors can be rendered into templates using the method. - - - - - True if we always should render contents inside page layouts when request is Ajax. - - default is false. - - - - Which page layout to use (without file extension) + Gets or sets version of HTTP protocol that's used. - - Page layouts should be places in the Views\Layouts folder. - - - default is "Application" - + Probably or . + - + - Page title (are added as a parameter to the layout template, use it in <title> HTML tag. + Gets or sets requested method. + + + + Will always be in upper case. + + + + + + Gets variables sent in the query string - + - Arguments sent when a is cleared + Gets or sets requested URI. - + - Instantiates the arguments for the event + Uri absolute path splitted into parts. - True if the session is cleared due to expiration + + // 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. + + - + - Returns true if the session is cleared due to expiration + Gets parameter from or . - + - Delegate for when a IHttpSession is cleared - - this is being cleared. - Arguments for the clearing - - - - Parse node contents add return a fresh node. - - List containing all node types - Node that this is a subnode to. Can be null - Line to parse - Where to start the parsing. Should be set to where the next node should start parsing. - A node corresponding to the bla bla; null if parsing failed. - - - - - determines if this node can handle the line (by checking the first word); - - Controller char (word) - true if text belongs to this node type - first node on line - - - - Convert node to HTML (with ASP-tags) - - HTML string - - - - Convert the node to c# code - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - smallEnough is a default value, recalc it - c# code - - - - A list of prototype nodes. + Gets form parameters. - + - Creates the node. + Gets whether the request was made by Ajax (Asynchronous JavaScript) - node identifier. - parent node. - created node if identifier was found; otherwise null. - + + + Gets cookies that was sent with the request. + + + + 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 + + + + 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. + + + + + This provider is used to let us implement any type of form decoding we want without + having to rewrite anything else in the server. + + + - - first node on line + 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. + + + + + Type of HTTP connection + + + + + Connection is closed after each request-response + + + + + Connection is kept alive for X seconds (unless another request have been made) + + + + + 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 - + - Add a prototype - - prototype node - - - - The purpose of this module is to serve files. + Number of values - + - Initializes a new instance of the class. + Get a sub item - 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 webbrowser to cache files + name in lower case. + if no item was found. - + - 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 + Name of item (in lower case). - + - Determines if the request should be handled by this module. - Invoked by the HttpServer + Returns the first value, or null if no value exist. - - true if this module should handle it. - + - check if source contains any of the chars. + Returns the last value, or null if no value exist. - - + + + + Returns the list with values. + + + + + + + name 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. + + + + + redirects from one URL to another. + + + + + 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. + + + + + 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. + + + + + 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 @@ -6772,53 +4119,228 @@ Information that is being sent back to the client. Session used to - + - return a file extension from an absolute uri path (or plain filename) + Name of site. - - - + - List with all mime-type that are allowed. + Helpers making it easier to work with forms. - All other mime types will result in a Forbidden http status code. + - + - characters that may not exist in a path. + 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 - fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" }; + + // 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 - + - Generic helper functions for Http + 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. + - + - Version string for HTTP v1.0 + 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. - + - Version string for HTTP v1.1 + 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. - + - An empty url + 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. + + - Parses a querystring. + Creates a check box. - Querystring (url decoded) - A HttpInput object if successful; otherwise HttpInput.Empty + 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 + + @@ -6837,112 +4359,6 @@ error message - - - Delegate used to let authentication modules authenticate the username and password. - - Realm that the user want to authenticate in - Username specified by client - Password supplied by the delagete - object that will be stored in a session variable called if authentication was successful. - throw forbidden exception if too many attempts have been made. - - - - Let's you decide on a system level if authentication is requried. - You can also decide if authentication is required in each HttpModule. - - Http request from client - true if user should be authenticated. - throw ForbiddenException if no more attempts are allowed. - If no more attempts are allowed - - - - Represents a html class node. - - - - - Parse node contents add return a fresh node. - - List containing all node types - Node that this is a subnode to. Can be null - Line to parse - Where to start the parsing. Should be set to where the next node should start parsing. - A node corresponding to the bla bla; null if parsing failed. - - - - - determines if this node can handle the line (by checking the first word); - - Controller char (word) - true if text belongs to this node type - first node on line - - - - Convert node to HTML (with ASP-tags) - - HTML string - - - - Convert the node to c# code - - True if we are inside the internal stringbuilder - true if all subnodes fit on one line - smallEnough is a default value, recalc it - c# code - - - - - - - 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 - - - - - - - - - - - Represents a field in a multipart form - Lists content type mime types. @@ -7015,5 +4431,1021 @@ All content types are in lower case. + + + 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 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 1024 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. + + + + + 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 + + + + 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 + + + + Parses a HTTP request directly from a stream + + + + + 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. + + + + + 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. + + + + 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 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 + + + + + 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. + + + + + + + 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 + + + + 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 + + + + + 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. + + + + 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. + + + + 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. +