diff --git a/Example/bin/Debug/example.exe b/Example/bin/Debug/example.exe index b71cc13e..42cfaa6c 100755 Binary files a/Example/bin/Debug/example.exe and b/Example/bin/Debug/example.exe differ diff --git a/Example/bin/Debug/example.exe.mdb b/Example/bin/Debug/example.exe.mdb index 398d795b..8c71abf1 100644 Binary files a/Example/bin/Debug/example.exe.mdb and b/Example/bin/Debug/example.exe.mdb differ diff --git a/Example/bin/Debug/websocket-sharp.dll b/Example/bin/Debug/websocket-sharp.dll index 4434ab51..666378fb 100755 Binary files a/Example/bin/Debug/websocket-sharp.dll and b/Example/bin/Debug/websocket-sharp.dll differ diff --git a/Example/bin/Debug/websocket-sharp.dll.mdb b/Example/bin/Debug/websocket-sharp.dll.mdb index e075586b..7da189e8 100644 Binary files a/Example/bin/Debug/websocket-sharp.dll.mdb and b/Example/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/Example/bin/Debug_Ubuntu/example.exe b/Example/bin/Debug_Ubuntu/example.exe index 87511c37..b16a2f0f 100755 Binary files a/Example/bin/Debug_Ubuntu/example.exe and b/Example/bin/Debug_Ubuntu/example.exe differ diff --git a/Example/bin/Debug_Ubuntu/example.exe.mdb b/Example/bin/Debug_Ubuntu/example.exe.mdb index 38e45ad9..73482c0e 100644 Binary files a/Example/bin/Debug_Ubuntu/example.exe.mdb and b/Example/bin/Debug_Ubuntu/example.exe.mdb differ diff --git a/Example/bin/Debug_Ubuntu/websocket-sharp.dll b/Example/bin/Debug_Ubuntu/websocket-sharp.dll index f624d82a..50cf103d 100755 Binary files a/Example/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 63eb8ac7..a0464ecb 100644 Binary files a/Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/Example/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/Example/bin/Release/example.exe b/Example/bin/Release/example.exe index c40e5054..4753627f 100755 Binary files a/Example/bin/Release/example.exe and b/Example/bin/Release/example.exe differ diff --git a/Example/bin/Release/websocket-sharp.dll b/Example/bin/Release/websocket-sharp.dll index 12429829..f1007de6 100755 Binary files a/Example/bin/Release/websocket-sharp.dll and b/Example/bin/Release/websocket-sharp.dll differ diff --git a/Example/bin/Release_Ubuntu/example.exe b/Example/bin/Release_Ubuntu/example.exe index 6204bf39..daaa5b67 100755 Binary files a/Example/bin/Release_Ubuntu/example.exe and b/Example/bin/Release_Ubuntu/example.exe differ diff --git a/Example/bin/Release_Ubuntu/websocket-sharp.dll b/Example/bin/Release_Ubuntu/websocket-sharp.dll index 8de72964..4e8a4675 100755 Binary files a/Example/bin/Release_Ubuntu/websocket-sharp.dll and b/Example/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/Example1/bin/Debug/example1.exe b/Example1/bin/Debug/example1.exe index 7242d95d..0b8fc268 100755 Binary files a/Example1/bin/Debug/example1.exe and b/Example1/bin/Debug/example1.exe differ diff --git a/Example1/bin/Debug/example1.exe.mdb b/Example1/bin/Debug/example1.exe.mdb index 0e1c315e..06d04df1 100644 Binary files a/Example1/bin/Debug/example1.exe.mdb and b/Example1/bin/Debug/example1.exe.mdb differ diff --git a/Example1/bin/Debug/websocket-sharp.dll b/Example1/bin/Debug/websocket-sharp.dll index 4434ab51..666378fb 100755 Binary files a/Example1/bin/Debug/websocket-sharp.dll and b/Example1/bin/Debug/websocket-sharp.dll differ diff --git a/Example1/bin/Debug/websocket-sharp.dll.mdb b/Example1/bin/Debug/websocket-sharp.dll.mdb index e075586b..7da189e8 100644 Binary files a/Example1/bin/Debug/websocket-sharp.dll.mdb and b/Example1/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/Example1/bin/Debug_Ubuntu/example1.exe b/Example1/bin/Debug_Ubuntu/example1.exe index b77cf797..9a8fbd12 100755 Binary files a/Example1/bin/Debug_Ubuntu/example1.exe and b/Example1/bin/Debug_Ubuntu/example1.exe differ diff --git a/Example1/bin/Debug_Ubuntu/example1.exe.mdb b/Example1/bin/Debug_Ubuntu/example1.exe.mdb index b38b635c..b798d91a 100644 Binary files a/Example1/bin/Debug_Ubuntu/example1.exe.mdb and b/Example1/bin/Debug_Ubuntu/example1.exe.mdb differ diff --git a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll index f624d82a..50cf103d 100755 Binary files a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 63eb8ac7..a0464ecb 100644 Binary files a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/Example1/bin/Release/example1.exe b/Example1/bin/Release/example1.exe index da4d4778..1be7e1f8 100755 Binary files a/Example1/bin/Release/example1.exe and b/Example1/bin/Release/example1.exe differ diff --git a/Example1/bin/Release/websocket-sharp.dll b/Example1/bin/Release/websocket-sharp.dll index 12429829..f1007de6 100755 Binary files a/Example1/bin/Release/websocket-sharp.dll and b/Example1/bin/Release/websocket-sharp.dll differ diff --git a/Example1/bin/Release_Ubuntu/example1.exe b/Example1/bin/Release_Ubuntu/example1.exe index b2274673..b17176b7 100755 Binary files a/Example1/bin/Release_Ubuntu/example1.exe and b/Example1/bin/Release_Ubuntu/example1.exe differ diff --git a/Example1/bin/Release_Ubuntu/websocket-sharp.dll b/Example1/bin/Release_Ubuntu/websocket-sharp.dll index 8de72964..4e8a4675 100755 Binary files a/Example1/bin/Release_Ubuntu/websocket-sharp.dll and b/Example1/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/Example2/bin/Debug/example2.exe b/Example2/bin/Debug/example2.exe index 12360aaf..9bb54108 100755 Binary files a/Example2/bin/Debug/example2.exe and b/Example2/bin/Debug/example2.exe differ diff --git a/Example2/bin/Debug/example2.exe.mdb b/Example2/bin/Debug/example2.exe.mdb index 29fcfcd3..6d9f9c07 100644 Binary files a/Example2/bin/Debug/example2.exe.mdb and b/Example2/bin/Debug/example2.exe.mdb differ diff --git a/Example2/bin/Debug/websocket-sharp.dll b/Example2/bin/Debug/websocket-sharp.dll index 4434ab51..666378fb 100755 Binary files a/Example2/bin/Debug/websocket-sharp.dll and b/Example2/bin/Debug/websocket-sharp.dll differ diff --git a/Example2/bin/Debug/websocket-sharp.dll.mdb b/Example2/bin/Debug/websocket-sharp.dll.mdb index e075586b..7da189e8 100644 Binary files a/Example2/bin/Debug/websocket-sharp.dll.mdb and b/Example2/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/Example2/bin/Debug_Ubuntu/example2.exe b/Example2/bin/Debug_Ubuntu/example2.exe index 42d38660..c31b318b 100755 Binary files a/Example2/bin/Debug_Ubuntu/example2.exe and b/Example2/bin/Debug_Ubuntu/example2.exe differ diff --git a/Example2/bin/Debug_Ubuntu/example2.exe.mdb b/Example2/bin/Debug_Ubuntu/example2.exe.mdb index c6e86391..b4844258 100644 Binary files a/Example2/bin/Debug_Ubuntu/example2.exe.mdb and b/Example2/bin/Debug_Ubuntu/example2.exe.mdb differ diff --git a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll index f624d82a..50cf103d 100755 Binary files a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 63eb8ac7..a0464ecb 100644 Binary files a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/Example2/bin/Release/example2.exe b/Example2/bin/Release/example2.exe index c3a14e29..cbebc39b 100755 Binary files a/Example2/bin/Release/example2.exe and b/Example2/bin/Release/example2.exe differ diff --git a/Example2/bin/Release/websocket-sharp.dll b/Example2/bin/Release/websocket-sharp.dll index 12429829..f1007de6 100755 Binary files a/Example2/bin/Release/websocket-sharp.dll and b/Example2/bin/Release/websocket-sharp.dll differ diff --git a/Example2/bin/Release_Ubuntu/example2.exe b/Example2/bin/Release_Ubuntu/example2.exe index f4a75ec2..34de4687 100755 Binary files a/Example2/bin/Release_Ubuntu/example2.exe and b/Example2/bin/Release_Ubuntu/example2.exe differ diff --git a/Example2/bin/Release_Ubuntu/websocket-sharp.dll b/Example2/bin/Release_Ubuntu/websocket-sharp.dll index 8de72964..4e8a4675 100755 Binary files a/Example2/bin/Release_Ubuntu/websocket-sharp.dll and b/Example2/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/Example3/bin/Debug/Example3.exe b/Example3/bin/Debug/Example3.exe index 1d3b90cb..a0e2b1df 100755 Binary files a/Example3/bin/Debug/Example3.exe and b/Example3/bin/Debug/Example3.exe differ diff --git a/Example3/bin/Debug/Example3.exe.mdb b/Example3/bin/Debug/Example3.exe.mdb index 64faac29..e8e2ffdc 100644 Binary files a/Example3/bin/Debug/Example3.exe.mdb and b/Example3/bin/Debug/Example3.exe.mdb differ diff --git a/Example3/bin/Debug/websocket-sharp.dll b/Example3/bin/Debug/websocket-sharp.dll index 4434ab51..666378fb 100755 Binary files a/Example3/bin/Debug/websocket-sharp.dll and b/Example3/bin/Debug/websocket-sharp.dll differ diff --git a/Example3/bin/Debug/websocket-sharp.dll.mdb b/Example3/bin/Debug/websocket-sharp.dll.mdb index e075586b..7da189e8 100644 Binary files a/Example3/bin/Debug/websocket-sharp.dll.mdb and b/Example3/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/Example3/bin/Debug_Ubuntu/Example3.exe b/Example3/bin/Debug_Ubuntu/Example3.exe index 8a4ca324..92451554 100755 Binary files a/Example3/bin/Debug_Ubuntu/Example3.exe and b/Example3/bin/Debug_Ubuntu/Example3.exe differ diff --git a/Example3/bin/Debug_Ubuntu/Example3.exe.mdb b/Example3/bin/Debug_Ubuntu/Example3.exe.mdb index 538dca00..78ef7c2f 100644 Binary files a/Example3/bin/Debug_Ubuntu/Example3.exe.mdb and b/Example3/bin/Debug_Ubuntu/Example3.exe.mdb differ diff --git a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll index f624d82a..50cf103d 100755 Binary files a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 63eb8ac7..a0464ecb 100644 Binary files a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/Example3/bin/Release/Example3.exe b/Example3/bin/Release/Example3.exe index 33c5d04b..b7fd472c 100755 Binary files a/Example3/bin/Release/Example3.exe and b/Example3/bin/Release/Example3.exe differ diff --git a/Example3/bin/Release/websocket-sharp.dll b/Example3/bin/Release/websocket-sharp.dll index 12429829..f1007de6 100755 Binary files a/Example3/bin/Release/websocket-sharp.dll and b/Example3/bin/Release/websocket-sharp.dll differ diff --git a/Example3/bin/Release_Ubuntu/Example3.exe b/Example3/bin/Release_Ubuntu/Example3.exe index fbc26e9c..39b6d1dd 100755 Binary files a/Example3/bin/Release_Ubuntu/Example3.exe and b/Example3/bin/Release_Ubuntu/Example3.exe differ diff --git a/Example3/bin/Release_Ubuntu/websocket-sharp.dll b/Example3/bin/Release_Ubuntu/websocket-sharp.dll index 8de72964..4e8a4675 100755 Binary files a/Example3/bin/Release_Ubuntu/websocket-sharp.dll and b/Example3/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index fbbe0a83..7c771ac0 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -69,12 +69,6 @@ namespace WebSocketSharp { act(); } - private static void times(this ulong n, Action act) - { - for (ulong i = 0; i < n; i++) - act(i); - } - #endregion #region Internal Method @@ -945,10 +939,10 @@ namespace WebSocketSharp { /// Executes the specified delegate times. /// /// - /// An that contains the number of times to execute. + /// An is the number of times to execute. /// /// - /// An delegate that contains the method(s) to execute. + /// An delegate that references the method(s) to execute. /// public static void Times(this int n, Action act) { @@ -960,10 +954,10 @@ namespace WebSocketSharp { /// Executes the specified delegate times. /// /// - /// A that contains the number of times to execute. + /// A is the number of times to execute. /// /// - /// An delegate that contains the method(s) to execute. + /// An delegate that references the method(s) to execute. /// public static void Times(this long n, Action act) { @@ -975,10 +969,10 @@ namespace WebSocketSharp { /// Executes the specified delegate times. /// /// - /// A that contains the number of times to execute. + /// A is the number of times to execute. /// /// - /// An delegate that contains the method(s) to execute. + /// An delegate that references the method(s) to execute. /// public static void Times(this uint n, Action act) { @@ -990,10 +984,10 @@ namespace WebSocketSharp { /// Executes the specified delegate times. /// /// - /// A that contains the number of times to execute. + /// A is the number of times to execute. /// /// - /// An delegate that contains the method(s) to execute. + /// An delegate that references the method(s) to execute. /// public static void Times(this ulong n, Action act) { @@ -1002,67 +996,71 @@ namespace WebSocketSharp { } /// - /// Executes the specified Action<ulong> delegate times. + /// Executes the specified Action<int> delegate times. /// /// - /// An that contains the number of times to execute. + /// An is the number of times to execute. /// /// - /// An Action<ulong> delegate that contains the method(s) to execute. - /// A parameter to pass to this method(s) contains the zero-based count of iteration. + /// An Action<int> delegate that references the method(s) to execute. + /// An parameter to pass to the method(s) is the zero-based count of iteration. /// - public static void Times(this int n, Action act) + public static void Times(this int n, Action act) { if (n > 0 && !act.IsNull()) - ((ulong)n).times(act); + for (int i = 0; i < n; i++) + act(i); + } + + /// + /// Executes the specified Action<long> delegate times. + /// + /// + /// A is the number of times to execute. + /// + /// + /// An Action<long> delegate that references the method(s) to execute. + /// A parameter to pass to the method(s) is the zero-based count of iteration. + /// + public static void Times(this long n, Action act) + { + if (n > 0 && !act.IsNull()) + for (long i = 0; i < n; i++) + act(i); + } + + /// + /// Executes the specified Action<uint> delegate times. + /// + /// + /// A is the number of times to execute. + /// + /// + /// An Action<uint> delegate that references the method(s) to execute. + /// A parameter to pass to the method(s) is the zero-based count of iteration. + /// + public static void Times(this uint n, Action act) + { + if (n > 0 && !act.IsNull()) + for (uint i = 0; i < n; i++) + act(i); } /// /// Executes the specified Action<ulong> delegate times. /// /// - /// A that contains the number of times to execute. + /// A is the number of times to execute. /// /// - /// An Action<ulong> delegate that contains the method(s) to execute. - /// A parameter to pass to this method(s) contains the zero-based count of iteration. - /// - public static void Times(this long n, Action act) - { - if (n > 0 && !act.IsNull()) - ((ulong)n).times(act); - } - - /// - /// Executes the specified Action<ulong> delegate times. - /// - /// - /// A that contains the number of times to execute. - /// - /// - /// An Action<ulong> delegate that contains the method(s) to execute. - /// A parameter to pass to this method(s) contains the zero-based count of iteration. - /// - public static void Times(this uint n, Action act) - { - if (n > 0 && !act.IsNull()) - ((ulong)n).times(act); - } - - /// - /// Executes the specified Action<ulong> delegate times. - /// - /// - /// A that contains the number of times to execute. - /// - /// - /// An Action<ulong> delegate that contains the method(s) to execute. - /// A parameter to pass to this method(s) contains the zero-based count of iteration. + /// An Action<ulong> delegate that references the method(s) to execute. + /// A parameter to pass to this method(s) is the zero-based count of iteration. /// public static void Times(this ulong n, Action act) { if (n > 0 && !act.IsNull()) - n.times(act); + for (ulong i = 0; i < n; i++) + act(i); } /// diff --git a/websocket-sharp/Net/HttpHeaderInfo.cs b/websocket-sharp/Net/HttpHeaderInfo.cs new file mode 100644 index 00000000..cceb7ea8 --- /dev/null +++ b/websocket-sharp/Net/HttpHeaderInfo.cs @@ -0,0 +1,99 @@ +// +// HttpHeaderInfo.cs +// +// Authors: +// sta (sta.blockhead@gmail.com) +// +// Copyright (c) 2013 sta.blockhead (sta.blockhead@gmail.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace WebSocketSharp.Net { + + class HttpHeaderInfo { + + #region Constructor + + public HttpHeaderInfo () + { + } + + #endregion + + #region Properties + + public bool IsMultiValueInRequest { + get { + return (Type & HttpHeaderType.MultiValueInRequest) == HttpHeaderType.MultiValueInRequest; + } + } + + public bool IsMultiValueInResponse { + get { + return (Type & HttpHeaderType.MultiValueInResponse) == HttpHeaderType.MultiValueInResponse; + } + } + + public bool IsRequest { + get { + return (Type & HttpHeaderType.Request) == HttpHeaderType.Request; + } + } + + public bool IsResponse { + get { + return (Type & HttpHeaderType.Response) == HttpHeaderType.Response; + } + } + + public string Name { get; set; } + + public HttpHeaderType Type { get; set; } + + #endregion + + #region Methods + + public bool IsMultiValue (bool response) + { + return (Type & HttpHeaderType.MultiValue) != HttpHeaderType.MultiValue + ? response + ? IsMultiValueInResponse + : IsMultiValueInRequest + : response + ? IsResponse + : IsRequest; + } + + public bool IsRestricted (bool response) + { + return (Type & HttpHeaderType.Restricted) != HttpHeaderType.Restricted + ? false + : response + ? IsResponse + : IsRequest; + } + + #endregion + } +} diff --git a/websocket-sharp/Net/HttpHeaderType.cs b/websocket-sharp/Net/HttpHeaderType.cs new file mode 100644 index 00000000..3bed0a03 --- /dev/null +++ b/websocket-sharp/Net/HttpHeaderType.cs @@ -0,0 +1,44 @@ +// +// HttpHeaderType.cs +// +// Authors: +// sta (sta.blockhead@gmail.com) +// +// Copyright (c) 2013 sta.blockhead (sta.blockhead@gmail.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace WebSocketSharp.Net { + + [Flags] + enum HttpHeaderType + { + Undefined, + Request, + Response, + Restricted, + MultiValue, + MultiValueInRequest, + MultiValueInResponse + } +} diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index b7c5f5bf..bc8df327 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -112,7 +112,7 @@ namespace WebSocketSharp.Net { public int ClientCertificateError { // TODO: Always returns 0 get { -/* +/* if (no_get_certificate) throw new InvalidOperationException ( "Call GetClientCertificate() before calling this method."); @@ -470,7 +470,7 @@ namespace WebSocketSharp.Net { string name = header.Substring (0, colon).Trim (); string val = header.Substring (colon + 1).Trim (); string lower = name.ToLower (CultureInfo.InvariantCulture); - headers.SetInternal (name, val); + headers.SetInternal (name, val, false); switch (lower) { case "accept-language": user_languages = val.Split (','); // yes, only split with a ',' diff --git a/websocket-sharp/Net/HttpListenerResponse.cs b/websocket-sharp/Net/HttpListenerResponse.cs index 4e6770a8..51c2e5f3 100644 --- a/websocket-sharp/Net/HttpListenerResponse.cs +++ b/websocket-sharp/Net/HttpListenerResponse.cs @@ -483,18 +483,18 @@ namespace WebSocketSharp.Net { if (content_type != null) { if (content_encoding != null && content_type.IndexOf ("charset=", StringComparison.Ordinal) == -1) { string enc_name = content_encoding.WebName; - headers.SetInternal ("Content-Type", content_type + "; charset=" + enc_name); + headers.SetInternal ("Content-Type", content_type + "; charset=" + enc_name, true); } else { - headers.SetInternal ("Content-Type", content_type); + headers.SetInternal ("Content-Type", content_type, true); } } if (headers ["Server"] == null) - headers.SetInternal ("Server", "WebSocketSharp-HTTPAPI/1.0"); + headers.SetInternal ("Server", "WebSocketSharp-HTTPAPI/1.0", true); CultureInfo inv = CultureInfo.InvariantCulture; if (headers ["Date"] == null) - headers.SetInternal ("Date", DateTime.UtcNow.ToString ("r", inv)); + headers.SetInternal ("Date", DateTime.UtcNow.ToString ("r", inv), true); if (!chunked) { if (!cl_set && closing) { @@ -503,7 +503,7 @@ namespace WebSocketSharp.Net { } if (cl_set) - headers.SetInternal ("Content-Length", content_length.ToString (inv)); + headers.SetInternal ("Content-Length", content_length.ToString (inv), true); } Version v = context.Request.ProtocolVersion; @@ -528,39 +528,39 @@ namespace WebSocketSharp.Net { // They sent both KeepAlive: true and Connection: close!? if (!keep_alive || conn_close) { - headers.SetInternal ("Connection", "close"); + headers.SetInternal ("Connection", "close", true); conn_close = true; } if (chunked) - headers.SetInternal ("Transfer-Encoding", "chunked"); + headers.SetInternal ("Transfer-Encoding", "chunked", true); int reuses = context.Connection.Reuses; if (reuses >= 100) { force_close_chunked = true; if (!conn_close) { - headers.SetInternal ("Connection", "close"); + headers.SetInternal ("Connection", "close", true); conn_close = true; } } if (!conn_close) { - headers.SetInternal ("Keep-Alive", String.Format ("timeout=15,max={0}", 100 - reuses)); + headers.SetInternal ("Keep-Alive", String.Format ("timeout=15,max={0}", 100 - reuses), true); if (context.Request.ProtocolVersion <= HttpVersion.Version10) - headers.SetInternal ("Connection", "keep-alive"); + headers.SetInternal ("Connection", "keep-alive", true); } if (location != null) - headers.SetInternal ("Location", location); + headers.SetInternal ("Location", location, true); if (cookies != null) { foreach (Cookie cookie in cookies) - headers.SetInternal ("Set-Cookie", cookie.ToClientString ()); + headers.SetInternal ("Set-Cookie", cookie.ToClientString (), true); } StreamWriter writer = new StreamWriter (ms, encoding, 256); writer.Write ("HTTP/{0} {1} {2}\r\n", version, status_code, status_description); - string headers_str = headers.ToStringMultiValue (); + string headers_str = headers.ToStringMultiValue (true); writer.Write (headers_str); writer.Flush (); int preamble = (encoding.CodePage == 65001) ? 3 : encoding.GetPreamble ().Length; diff --git a/websocket-sharp/Net/WebHeaderCollection.cs b/websocket-sharp/Net/WebHeaderCollection.cs index 767d1e09..32a72964 100644 --- a/websocket-sharp/Net/WebHeaderCollection.cs +++ b/websocket-sharp/Net/WebHeaderCollection.cs @@ -6,6 +6,7 @@ // Lawrence Pit (loz@cable.a2000.nl) // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Miguel de Icaza (miguel@novell.com) +// sta (sta.blockhead@gmail.com) // // Copyright (c) 2003 Ximian, Inc. (http://www.ximian.com) // Copyright (c) 2007 Novell, Inc. (http://www.novell.com) @@ -35,6 +36,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; +using System.Linq; using System.Net; using System.Runtime.InteropServices; using System.Runtime.Serialization; @@ -48,15 +50,14 @@ namespace WebSocketSharp.Net { /// [Serializable] [ComVisible (true)] - public class WebHeaderCollection : NameValueCollection, ISerializable - { + public class WebHeaderCollection : NameValueCollection, ISerializable { + #region Fields - private static readonly Dictionary multiValue; - private static readonly Dictionary restricted; - private static readonly Dictionary restricted_response; + static readonly Dictionary headers; - private bool internallyCreated = false; + bool internallyCreated; + HttpHeaderType state; #endregion @@ -64,64 +65,195 @@ namespace WebSocketSharp.Net { static WebHeaderCollection () { - // the list of restricted header names as defined - // by the ms.net spec - restricted = new Dictionary (StringComparer.InvariantCultureIgnoreCase); - restricted.Add ("accept", true); - restricted.Add ("connection", true); - restricted.Add ("content-length", true); - restricted.Add ("content-type", true); - restricted.Add ("date", true); - restricted.Add ("expect", true); - restricted.Add ("host", true); - restricted.Add ("if-modified-since", true); - restricted.Add ("range", true); - restricted.Add ("referer", true); - restricted.Add ("transfer-encoding", true); - restricted.Add ("user-agent", true); - restricted.Add ("proxy-connection", true); - - // - restricted_response = new Dictionary (StringComparer.InvariantCultureIgnoreCase); - restricted_response.Add ("Content-Length", true); - restricted_response.Add ("Transfer-Encoding", true); - restricted_response.Add ("WWW-Authenticate", true); - - // see par 14 of RFC 2068 to see which header names - // accept multiple values each separated by a comma - multiValue = new Dictionary (StringComparer.InvariantCultureIgnoreCase); - multiValue.Add ("accept", true); - multiValue.Add ("accept-charset", true); - multiValue.Add ("accept-encoding", true); - multiValue.Add ("accept-language", true); - multiValue.Add ("accept-ranges", true); - multiValue.Add ("allow", true); - multiValue.Add ("authorization", true); - multiValue.Add ("cache-control", true); - multiValue.Add ("connection", true); - multiValue.Add ("content-encoding", true); - multiValue.Add ("content-language", true); - multiValue.Add ("expect", true); - multiValue.Add ("if-match", true); - multiValue.Add ("if-none-match", true); - multiValue.Add ("proxy-authenticate", true); - multiValue.Add ("public", true); - multiValue.Add ("range", true); - multiValue.Add ("transfer-encoding", true); - multiValue.Add ("upgrade", true); - multiValue.Add ("vary", true); - multiValue.Add ("via", true); - multiValue.Add ("warning", true); - multiValue.Add ("www-authenticate", true); - - // Extra - multiValue.Add ("set-cookie", true); - multiValue.Add ("set-cookie2", true); + headers = new Dictionary (StringComparer.InvariantCultureIgnoreCase) + { + { "Accept", new HttpHeaderInfo () { + Name = "Accept", + Type = HttpHeaderType.Request | HttpHeaderType.Restricted | HttpHeaderType.MultiValue } }, + { "AcceptCharset", new HttpHeaderInfo () { + Name = "Accept-Charset", + Type = HttpHeaderType.Request | HttpHeaderType.MultiValue } }, + { "AcceptEncoding", new HttpHeaderInfo () { + Name = "Accept-Encoding", + Type = HttpHeaderType.Request | HttpHeaderType.MultiValue } }, + { "AcceptLanguage", new HttpHeaderInfo () { + Name = "Accept-language", + Type = HttpHeaderType.Request | HttpHeaderType.MultiValue } }, + { "AcceptRanges", new HttpHeaderInfo () { + Name = "Accept-Ranges", + Type = HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "Age", new HttpHeaderInfo () { + Name = "Age", + Type = HttpHeaderType.Response } }, + { "Allow", new HttpHeaderInfo () { + Name = "Allow", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "Authorization", new HttpHeaderInfo () { + Name = "Authorization", + Type = HttpHeaderType.Request | HttpHeaderType.MultiValue } }, + { "CacheControl", new HttpHeaderInfo () { + Name = "Cache-Control", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "Connection", new HttpHeaderInfo () { + Name = "Connection", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted | HttpHeaderType.MultiValue } }, + { "ContentEncoding", new HttpHeaderInfo () { + Name = "Content-Encoding", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "ContentLanguage", new HttpHeaderInfo () { + Name = "Content-Language", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "ContentLength", new HttpHeaderInfo () { + Name = "Content-Length", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted } }, + { "ContentLocation", new HttpHeaderInfo () { + Name = "Content-Location", + Type = HttpHeaderType.Request | HttpHeaderType.Response } }, + { "ContentMd5", new HttpHeaderInfo () { + Name = "Content-MD5", + Type = HttpHeaderType.Request | HttpHeaderType.Response } }, + { "ContentRange", new HttpHeaderInfo () { + Name = "Content-Range", + Type = HttpHeaderType.Request | HttpHeaderType.Response } }, + { "ContentType", new HttpHeaderInfo () { + Name = "Content-Type", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted } }, + { "Cookie", new HttpHeaderInfo () { + Name = "Cookie", + Type = HttpHeaderType.Request } }, + { "Cookie2", new HttpHeaderInfo () { + Name = "Cookie2", + Type = HttpHeaderType.Request } }, + { "Date", new HttpHeaderInfo () { + Name = "Date", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted } }, + { "Expect", new HttpHeaderInfo () { + Name = "Expect", + Type = HttpHeaderType.Request | HttpHeaderType.Restricted | HttpHeaderType.MultiValue } }, + { "Expires", new HttpHeaderInfo () { + Name = "Expires", + Type = HttpHeaderType.Request | HttpHeaderType.Response } }, + { "ETag", new HttpHeaderInfo () { + Name = "ETag", + Type = HttpHeaderType.Response } }, + { "From", new HttpHeaderInfo () { + Name = "From", + Type = HttpHeaderType.Request } }, + { "Host", new HttpHeaderInfo () { + Name = "Host", + Type = HttpHeaderType.Request | HttpHeaderType.Restricted } }, + { "IfMatch", new HttpHeaderInfo () { + Name = "If-Match", + Type = HttpHeaderType.Request | HttpHeaderType.MultiValue } }, + { "IfModifiedSince", new HttpHeaderInfo () { + Name = "If-Modified-Since", + Type = HttpHeaderType.Request | HttpHeaderType.Restricted } }, + { "IfNoneMatch", new HttpHeaderInfo () { + Name = "If-None-Match", + Type = HttpHeaderType.Request | HttpHeaderType.MultiValue } }, + { "IfRange", new HttpHeaderInfo () { + Name = "If-Range", + Type = HttpHeaderType.Request } }, + { "IfUnmodifiedSince", new HttpHeaderInfo () { + Name = "If-Unmodified-Since", + Type = HttpHeaderType.Request } }, + { "KeepAlive", new HttpHeaderInfo () { + Name = "Keep-Alive", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "LastModified", new HttpHeaderInfo () { + Name = "Last-Modified", + Type = HttpHeaderType.Request | HttpHeaderType.Response } }, + { "Location", new HttpHeaderInfo () { + Name = "Location", + Type = HttpHeaderType.Response } }, + { "MaxForwards", new HttpHeaderInfo () { + Name = "Max-Forwards", + Type = HttpHeaderType.Request } }, + { "Pragma", new HttpHeaderInfo () { + Name = "Pragma", + Type = HttpHeaderType.Request | HttpHeaderType.Response } }, + { "ProxyConnection", new HttpHeaderInfo () { + Name = "Proxy-Connection", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted } }, + { "ProxyAuthenticate", new HttpHeaderInfo () { + Name = "Proxy-Authenticate", + Type = HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "ProxyAuthorization", new HttpHeaderInfo () { + Name = "Proxy-Authorization", + Type = HttpHeaderType.Request } }, + { "Public", new HttpHeaderInfo () { + Name = "Public", + Type = HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "Range", new HttpHeaderInfo () { + Name = "Range", + Type = HttpHeaderType.Request | HttpHeaderType.Restricted | HttpHeaderType.MultiValue } }, + { "Referer", new HttpHeaderInfo () { + Name = "Referer", + Type = HttpHeaderType.Request | HttpHeaderType.Restricted } }, + { "RetryAfter", new HttpHeaderInfo () { + Name = "Retry-After", + Type = HttpHeaderType.Response } }, + { "SecWebSocketAccept", new HttpHeaderInfo () { + Name = "Sec-WebSocket-Accept", + Type = HttpHeaderType.Response | HttpHeaderType.Restricted } }, + { "SecWebSocketExtensions", new HttpHeaderInfo () { + Name = "Sec-WebSocket-Extensions", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted | HttpHeaderType.MultiValueInRequest } }, + { "SecWebSocketKey", new HttpHeaderInfo () { + Name = "Sec-WebSocket-Key", + Type = HttpHeaderType.Request | HttpHeaderType.Restricted } }, + { "SecWebSocketProtocol", new HttpHeaderInfo () { + Name = "Sec-WebSocket-Protocol", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValueInRequest } }, + { "SecWebSocketVersion", new HttpHeaderInfo () { + Name = "Sec-WebSocket-Version", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted | HttpHeaderType.MultiValueInResponse } }, + { "Server", new HttpHeaderInfo () { + Name = "Server", + Type = HttpHeaderType.Response } }, + { "SetCookie", new HttpHeaderInfo () { + Name = "Set-Cookie", + Type = HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "SetCookie2", new HttpHeaderInfo () { + Name = "Set-Cookie2", + Type = HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "Te", new HttpHeaderInfo () { + Name = "TE", + Type = HttpHeaderType.Request } }, + { "Trailer", new HttpHeaderInfo () { + Name = "Trailer", + Type = HttpHeaderType.Request | HttpHeaderType.Response } }, + { "TransferEncoding", new HttpHeaderInfo () { + Name = "Transfer-Encoding", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.Restricted | HttpHeaderType.MultiValue } }, + { "Translate", new HttpHeaderInfo () { + Name = "Translate", + Type = HttpHeaderType.Request } }, + { "Upgrade", new HttpHeaderInfo () { + Name = "Upgrade", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "UserAgent", new HttpHeaderInfo () { + Name = "User-Agent", + Type = HttpHeaderType.Request | HttpHeaderType.Restricted } }, + { "Vary", new HttpHeaderInfo () { + Name = "Vary", + Type = HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "Via", new HttpHeaderInfo () { + Name = "Via", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "Warning", new HttpHeaderInfo () { + Name = "Warning", + Type = HttpHeaderType.Request | HttpHeaderType.Response | HttpHeaderType.MultiValue } }, + { "WwwAuthenticate", new HttpHeaderInfo () { + Name = "WWW-Authenticate", + Type = HttpHeaderType.Response | HttpHeaderType.Restricted | HttpHeaderType.MultiValue } } + }; } internal WebHeaderCollection (bool internallyCreated) { this.internallyCreated = internallyCreated; + state = HttpHeaderType.Undefined; } /// @@ -129,27 +261,35 @@ namespace WebSocketSharp.Net { /// with the specified and . /// /// - /// A that holds the serialized object data. + /// A that contains the data to need to serialize the object. /// /// - /// A that contains the contextual information about the source or destination. + /// A that contains the source of the serialized stream associated with the new . /// + /// + /// is . + /// + /// + /// An element with the specified name is not found in . + /// protected WebHeaderCollection ( SerializationInfo serializationInfo, StreamingContext streamingContext) { - int count; + if (serializationInfo.IsNull ()) + throw new ArgumentNullException ("serializationInfo"); + try { - count = serializationInfo.GetInt32("Count"); - for (int i = 0; i < count; i++) - this.Add ( + internallyCreated = serializationInfo.GetBoolean ("InternallyCreated"); + state = (HttpHeaderType) serializationInfo.GetInt32 ("State"); + + int count = serializationInfo.GetInt32 ("Count"); + count.Times (i => { + base.Add ( serializationInfo.GetString (i.ToString ()), serializationInfo.GetString ((count + i).ToString ())); - } catch (SerializationException) { - count = serializationInfo.GetInt32("count"); - for (int i = 0; i < count; i++) - this.Add ( - serializationInfo.GetString ("k" + i), - serializationInfo.GetString ("v" + i)); + }); + } catch (SerializationException ex) { + throw new ArgumentException (ex.Message, "serializationInfo", ex); } } @@ -158,6 +298,8 @@ namespace WebSocketSharp.Net { /// public WebHeaderCollection () { + internallyCreated = false; + state = HttpHeaderType.Undefined; } #endregion @@ -197,17 +339,32 @@ namespace WebSocketSharp.Net { /// A that contains the value of the specified request . /// /// - /// A that contains a request header name. + /// A that indicates a request header. /// + /// + /// The current instance does not allow any of values. + /// + /// + /// + /// is a restricted header. + /// + /// + /// -or- + /// + /// + /// contains invalid characters. + /// + /// + /// + /// The length of is greater than 65535. + /// public string this [HttpRequestHeader header] { get { - return Get (RequestHeaderToString (header)); + return Get (Convert (header)); } set { - // TODO: Support to throw InvalidOperationException. - Add (header, value); } } @@ -219,17 +376,32 @@ namespace WebSocketSharp.Net { /// A that contains the value of the specified response . /// /// - /// A that contains a response header name. + /// A that indicates a response header. /// + /// + /// The current instance does not allow any of values. + /// + /// + /// + /// is a restricted header. + /// + /// + /// -or- + /// + /// + /// contains invalid characters. + /// + /// + /// + /// The length of is greater than 65535. + /// public string this [HttpResponseHeader header] { get { - return Get (ResponseHeaderToString (header)); + return Get (Convert (header)); } set { - // TODO: Support to throw InvalidOperationException. - Add (header, value); } } @@ -251,162 +423,163 @@ namespace WebSocketSharp.Net { #region Private Methods - static string RequestHeaderToString (HttpRequestHeader value) + void Add (string name, string value, bool ignoreRestricted) { - switch (value){ - case HttpRequestHeader.CacheControl: - return "Cache-Control"; - case HttpRequestHeader.Connection: - return "Connection"; - case HttpRequestHeader.Date: - return "Date"; - case HttpRequestHeader.KeepAlive: - return "Keep-Alive"; - case HttpRequestHeader.Pragma: - return "Pragma"; - case HttpRequestHeader.Trailer: - return "Trailer"; - case HttpRequestHeader.TransferEncoding: - return "Transfer-Encoding"; - case HttpRequestHeader.Upgrade: - return "Upgrade"; - case HttpRequestHeader.Via: - return "Via"; - case HttpRequestHeader.Warning: - return "Warning"; - case HttpRequestHeader.Allow: - return "Allow"; - case HttpRequestHeader.ContentLength: - return "Content-Length"; - case HttpRequestHeader.ContentType: - return "Content-Type"; - case HttpRequestHeader.ContentEncoding: - return "Content-Encoding"; - case HttpRequestHeader.ContentLanguage: - return "Content-Language"; - case HttpRequestHeader.ContentLocation: - return "Content-Location"; - case HttpRequestHeader.ContentMd5: - return "Content-MD5"; - case HttpRequestHeader.ContentRange: - return "Content-Range"; - case HttpRequestHeader.Expires: - return "Expires"; - case HttpRequestHeader.LastModified: - return "Last-Modified"; - case HttpRequestHeader.Accept: - return "Accept"; - case HttpRequestHeader.AcceptCharset: - return "Accept-Charset"; - case HttpRequestHeader.AcceptEncoding: - return "Accept-Encoding"; - case HttpRequestHeader.AcceptLanguage: - return "accept-language"; - case HttpRequestHeader.Authorization: - return "Authorization"; - case HttpRequestHeader.Cookie: - return "Cookie"; - case HttpRequestHeader.Expect: - return "Expect"; - case HttpRequestHeader.From: - return "From"; - case HttpRequestHeader.Host: - return "Host"; - case HttpRequestHeader.IfMatch: - return "If-Match"; - case HttpRequestHeader.IfModifiedSince: - return "If-Modified-Since"; - case HttpRequestHeader.IfNoneMatch: - return "If-None-Match"; - case HttpRequestHeader.IfRange: - return "If-Range"; - case HttpRequestHeader.IfUnmodifiedSince: - return "If-Unmodified-Since"; - case HttpRequestHeader.MaxForwards: - return "Max-Forwards"; - case HttpRequestHeader.ProxyAuthorization: - return "Proxy-Authorization"; - case HttpRequestHeader.Referer: - return "Referer"; - case HttpRequestHeader.Range: - return "Range"; - case HttpRequestHeader.Te: - return "TE"; - case HttpRequestHeader.Translate: - return "Translate"; - case HttpRequestHeader.UserAgent: - return "User-Agent"; - default: - throw new InvalidOperationException (); - } + name = Trim (name); + CheckName (name); + + Action add; + if (ignoreRestricted) + add = AddWithoutCheckingNameAndRestricted; + else + add = AddWithoutCheckingName; + + DoWithCheckingState (add, name, value); } - static string ResponseHeaderToString (HttpResponseHeader value) + void AddWithoutCheckingName (string name, string value) { - switch (value){ - case HttpResponseHeader.CacheControl: - return "Cache-Control"; - case HttpResponseHeader.Connection: - return "Connection"; - case HttpResponseHeader.Date: - return "Date"; - case HttpResponseHeader.KeepAlive: - return "Keep-Alive"; - case HttpResponseHeader.Pragma: - return "Pragma"; - case HttpResponseHeader.Trailer: - return "Trailer"; - case HttpResponseHeader.TransferEncoding: - return "Transfer-Encoding"; - case HttpResponseHeader.Upgrade: - return "Upgrade"; - case HttpResponseHeader.Via: - return "Via"; - case HttpResponseHeader.Warning: - return "Warning"; - case HttpResponseHeader.Allow: - return "Allow"; - case HttpResponseHeader.ContentLength: - return "Content-Length"; - case HttpResponseHeader.ContentType: - return "Content-Type"; - case HttpResponseHeader.ContentEncoding: - return "Content-Encoding"; - case HttpResponseHeader.ContentLanguage: - return "Content-Language"; - case HttpResponseHeader.ContentLocation: - return "Content-Location"; - case HttpResponseHeader.ContentMd5: - return "Content-MD5"; - case HttpResponseHeader.ContentRange: - return "Content-Range"; - case HttpResponseHeader.Expires: - return "Expires"; - case HttpResponseHeader.LastModified: - return "Last-Modified"; - case HttpResponseHeader.AcceptRanges: - return "Accept-Ranges"; - case HttpResponseHeader.Age: - return "Age"; - case HttpResponseHeader.ETag: - return "ETag"; - case HttpResponseHeader.Location: - return "Location"; - case HttpResponseHeader.ProxyAuthenticate: - return "Proxy-Authenticate"; - case HttpResponseHeader.RetryAfter: - return "Retry-After"; - case HttpResponseHeader.Server: - return "Server"; - case HttpResponseHeader.SetCookie: - return "Set-Cookie"; - case HttpResponseHeader.Vary: - return "Vary"; - case HttpResponseHeader.WwwAuthenticate: - return "WWW-Authenticate"; - default: - throw new InvalidOperationException (); + CheckRestricted (name); + AddWithoutCheckingNameAndRestricted (name, value); + } + + void AddWithoutCheckingNameAndRestricted (string name, string value) + { + value = Trim (value); + CheckValue (value); + base.Add (name, value); + } + + static int CheckColonSeparated (string header) + { + int i = header.IndexOf (':'); + if (i == -1) + throw new ArgumentException ("No colon found.", "header"); + + return i; + } + + static void CheckName (string name) + { + if (name.IsEmpty ()) + throw new ArgumentNullException ("name"); + + if (!IsHeaderName (name)) + throw new ArgumentException ("Contains invalid characters.", "name"); + } + + void CheckRestricted (string name) + { + if (!internallyCreated && ContainsInRestricted (name, true)) + throw new ArgumentException ("This header must be modified with the appropiate property."); + } + + void CheckState (bool response) + { + if (state == HttpHeaderType.Undefined) + return; + + if (response && state == HttpHeaderType.Request) + throw new InvalidOperationException ("This collection has already been used to store the request headers."); + + if (!response && state == HttpHeaderType.Response) + throw new InvalidOperationException ("This collection has already been used to store the response headers."); + } + + void CheckState (HttpHeaderInfo info) + { + if (info.IsRequest && !info.IsResponse) + CheckState (false); + + if (!info.IsRequest && info.IsResponse) + CheckState (true); + } + + static void CheckValue (string value) + { + if (value.Length > 65535) + throw new ArgumentOutOfRangeException ("value", "The length must not be greater than 65535."); + + if (!IsHeaderValue (value)) + throw new ArgumentException ("Contains invalid characters.", "value"); + } + + static string Convert (HttpRequestHeader header) + { + return Convert (header.ToString ()); + } + + static string Convert (HttpResponseHeader header) + { + return Convert (header.ToString ()); + } + + static string Convert (string header) + { + HttpHeaderInfo info; + return headers.TryGetValue (header, out info) + ? info.Name + : String.Empty; + } + + static bool ContainsInRestricted (string name, bool response) + { + HttpHeaderInfo info; + return TryGetHeaderInfo (name, out info) + ? info.IsRestricted (response) + : false; + } + + void DoWithCheckingState (Action act, string name, string value) + { + HttpHeaderInfo info; + if (TryGetHeaderInfo (name, out info)) + { + CheckState (info); + act (name, value); + SetState (info); + return; } + + act (name, value); + } + + static HttpHeaderInfo GetHeaderInfo (string name) + { + return (from HttpHeaderInfo info in headers.Values + where info.Name.Equals (name, StringComparison.InvariantCultureIgnoreCase) + select info).FirstOrDefault (); + } + + void RemoveWithoutCheckingName (string name) + { + CheckRestricted (name); + base.Remove (name); + } + + void SetState (bool response) + { + if (state == HttpHeaderType.Undefined) + state = response + ? HttpHeaderType.Response + : HttpHeaderType.Request; + } + + void SetState (HttpHeaderInfo info) + { + if (info.IsRequest && !info.IsResponse) + SetState (false); + + if (!info.IsRequest && info.IsResponse) + SetState (true); + } + + void SetWithoutCheckingName (string name, string value) + { + CheckRestricted (name); + value = Trim (value); + CheckValue (value); + base.Set (name, value); } static string Trim (string value) @@ -416,6 +589,14 @@ namespace WebSocketSharp.Net { : value.Trim (); } + static bool TryGetHeaderInfo (string name, out HttpHeaderInfo info) + { + info = GetHeaderInfo (name); + return info.IsNull () + ? false + : true; + } + #endregion #region Internal Methods @@ -432,74 +613,53 @@ namespace WebSocketSharp.Net { return value.IsText (); } - internal static bool IsMultiValue (string headerName) + internal static bool IsMultiValue (string headerName, bool response) { - return headerName.IsNullOrEmpty () - ? false - : multiValue.ContainsKey (headerName); - } + if (headerName.IsNullOrEmpty ()) + return false; - internal string ToStringMultiValue () - { - var sb = new StringBuilder(); - int count = base.Count; - for (int i = 0; i < count ; i++) { - string key = GetKey (i); - if (IsMultiValue (key)) { - foreach (string v in GetValues (i)) { - sb.Append (key) - .Append (": ") - .Append (v) - .Append ("\r\n"); - } - } else { - sb.Append (key) - .Append (": ") - .Append (Get (i)) - .Append ("\r\n"); - } - } - - return sb.Append("\r\n").ToString(); - } - - // With this we don't check for invalid characters in header. See bug #55994. - internal void SetInternal (string header) - { - int pos = header.IndexOf (':'); - if (pos == -1) - throw new ArgumentException ("No colon found", "header"); - - SetInternal (header.Substring (0, pos), header.Substring (pos + 1)); - } - - internal void RemoveAndAdd (string name, string value) - { - value = Trim (value); - base.Remove (name); - base.Set (name, value); + HttpHeaderInfo info; + return TryGetHeaderInfo (headerName, out info) + ? info.IsMultiValue (response) + : false; } internal void RemoveInternal (string name) { - if (name.IsNull ()) - throw new ArgumentNullException ("name"); - base.Remove (name); } - internal void SetInternal (string name, string value) + internal void SetInternal (string header, bool response) + { + int pos = CheckColonSeparated (header); + SetInternal (header.Substring (0, pos), header.Substring (pos + 1), response); + } + + internal void SetInternal (string name, string value, bool response) { value = Trim (value); - if (!IsHeaderValue (value)) - throw new ArgumentException ("Invalid header value."); + CheckValue (value); - if (IsMultiValue (name)) { + if (IsMultiValue (name, response)) base.Add (name, value); - } else { - base.Remove (name); + else base.Set (name, value); - } + } + + internal string ToStringMultiValue (bool response) + { + var sb = new StringBuilder (); + Count.Times (i => { + string key = GetKey (i); + if (IsMultiValue (key, response)) { + foreach (string value in GetValues (i)) + sb.AppendFormat ("{0}: {1}\r\n", key, value); + } else { + sb.AppendFormat ("{0}: {1}\r\n", key, Get (i)); + } + }); + + return sb.Append ("\r\n").ToString (); } #endregion @@ -507,14 +667,18 @@ namespace WebSocketSharp.Net { #region Explicit Interface Implementation /// - /// Populates the specified with the data needed to serialize the . + /// Populates the specified with the data to need to + /// serialize the object. /// /// - /// A that holds the serialized object data. + /// A that holds the data to need to serialize the object. /// /// /// A that specifies the destination for the serialization. /// + /// + /// is . + /// [SecurityPermission (SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter, SerializationFormatter = true)] void ISerializable.GetObjectData ( SerializationInfo serializationInfo, StreamingContext streamingContext) @@ -535,29 +699,21 @@ namespace WebSocketSharp.Net { /// /// A that contains the value of the header to add. /// + /// + /// is or . + /// /// - /// - /// is , , or - /// contains invalid characters. - /// - /// - /// -or- - /// - /// - /// contains invalid characters. - /// + /// or contains invalid characters. + /// + /// + /// The length of is greater than 65535. + /// + /// + /// The current instance does not allow the . /// protected void AddWithoutValidate (string headerName, string headerValue) { - var name = Trim (headerName); - if (!IsHeaderName (name)) - throw new ArgumentException ("Invalid header name: " + name, "headerName"); - - var value = Trim (headerValue); - if (!IsHeaderValue (value)) - throw new ArgumentException ("Invalid header value: " + value, "headerValue"); - - base.Add (name, value); + Add (headerName, headerValue, true); } #endregion @@ -571,20 +727,38 @@ namespace WebSocketSharp.Net { /// A that contains a header with the name and value separated by a colon (:). /// /// - /// is or a . + /// is , , or + /// the name part of is . /// /// - /// does not contain a colon. + /// + /// does not contain a colon. + /// + /// + /// -or- + /// + /// + /// is a restricted header. + /// + /// + /// -or- + /// + /// + /// The name or value part of contains invalid characters. + /// + /// + /// + /// The length of the value part of is greater than 65535. + /// + /// + /// The current instance does not allow the . /// public void Add (string header) { if (header.IsNullOrEmpty ()) throw new ArgumentNullException ("header"); - int pos = header.IndexOf (':'); - if (pos == -1) - throw new ArgumentException ("No colon found", "header"); - + int pos = CheckColonSeparated (header); Add (header.Substring (0, pos), header.Substring (pos + 1)); } @@ -592,28 +766,66 @@ namespace WebSocketSharp.Net { /// Adds the specified request with the specified to the collection. /// /// - /// A that contains the name of the request header to add. + /// A is a request header to add. /// /// /// A that contains the value of the header to add. /// + /// + /// The current instance does not allow any of values. + /// + /// + /// + /// is a restricted header. + /// + /// + /// -or- + /// + /// + /// contains invalid characters. + /// + /// + /// + /// The length of is greater than 65535. + /// public void Add (HttpRequestHeader header, string value) { - Add (RequestHeaderToString (header), value); + CheckState (false); + AddWithoutCheckingName (Convert (header), value); + SetState (false); } /// /// Adds the specified response with the specified to the collection. /// /// - /// A that contains the name of the response header to add. + /// A is a response header to add. /// /// /// A that contains the value of the header to add. /// + /// + /// The current instance does not allow any of values. + /// + /// + /// + /// is a restricted header. + /// + /// + /// -or- + /// + /// + /// contains invalid characters. + /// + /// + /// + /// The length of is greater than 65535. + /// public void Add (HttpResponseHeader header, string value) { - Add (ResponseHeaderToString (header), value); + CheckState (true); + AddWithoutCheckingName (Convert (header), value); + SetState (true); } /// @@ -625,32 +837,29 @@ namespace WebSocketSharp.Net { /// /// A that contains the value of the header to add. /// + /// + /// is or . + /// /// /// - /// is or a . + /// or contains invalid characters. /// /// /// -or- /// /// - /// is a restricted header that must be set with a property setting. - /// - /// - /// -or- + /// is a restricted header name. /// /// /// /// The length of is greater than 65535. /// + /// + /// The current instance does not allow the header . + /// public override void Add (string name, string value) { - if (internallyCreated && IsRestricted (name)) - throw new ArgumentException ("This header must be modified with the appropiate property."); - - if (value.Length > 65535) - throw new ArgumentOutOfRangeException ("value", "The length must not be greater than 65535."); - - AddWithoutValidate (name, value); + Add (name, value, false); } /// @@ -659,6 +868,7 @@ namespace WebSocketSharp.Net { public override void Clear () { base.Clear (); + state = HttpHeaderType.Undefined; } /// @@ -751,24 +961,34 @@ namespace WebSocketSharp.Net { } /// - /// Populates the specified with the data needed to serialize the . + /// Populates the specified with the data to need to + /// serialize the object. /// /// - /// A that holds the serialized object data. + /// A that holds the data to need to serialize the object. /// /// /// A that specifies the destination for the serialization. /// + /// + /// is . + /// [SecurityPermission (SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public override void GetObjectData ( SerializationInfo serializationInfo, StreamingContext streamingContext) { - int count = base.Count; + if (serializationInfo.IsNull ()) + throw new ArgumentNullException ("serializationInfo"); + + serializationInfo.AddValue ("InternallyCreated", internallyCreated); + serializationInfo.AddValue ("State", (int) state); + + int count = Count; serializationInfo.AddValue ("Count", count); - for (int i = 0; i < count; i++) { + count.Times (i => { serializationInfo.AddValue (i.ToString (), GetKey (i)); serializationInfo.AddValue ((count + i).ToString (), Get (i)); - } + }); } /// @@ -811,16 +1031,9 @@ namespace WebSocketSharp.Net { /// public static bool IsRestricted (string headerName, bool response) { - if (headerName.IsNullOrEmpty ()) - throw new ArgumentNullException ("headerName", "Must not be null or empty."); - - var name = headerName.Trim (); - if (!IsHeaderName (name)) - throw new ArgumentException ("Invalid character in header."); - - return response - ? restricted_response.ContainsKey (name) - : restricted.ContainsKey (name); + var name = Trim (headerName); + CheckName (name); + return ContainsInRestricted (name, response); } /// @@ -840,11 +1053,16 @@ namespace WebSocketSharp.Net { /// /// A to remove from the collection. /// + /// + /// The current instance does not allow any of values. + /// + /// + /// is a restricted header. + /// public void Remove (HttpRequestHeader header) { - // TODO: Support to throw InvalidOperationException. - - Remove (RequestHeaderToString (header)); + CheckState (false); + RemoveWithoutCheckingName (Convert (header)); } /// @@ -853,11 +1071,16 @@ namespace WebSocketSharp.Net { /// /// A to remove from the collection. /// + /// + /// The current instance does not allow any of values. + /// + /// + /// is a restricted header. + /// public void Remove (HttpResponseHeader header) { - // TODO: Support to throw InvalidOperationException. - - Remove (ResponseHeaderToString (header)); + CheckState (true); + RemoveWithoutCheckingName (Convert (header)); } /// @@ -880,19 +1103,19 @@ namespace WebSocketSharp.Net { /// is a restricted header name. /// /// + /// + /// The current instance does not allow the header . + /// public override void Remove (string name) { - if (name.IsNullOrEmpty ()) - throw new ArgumentNullException ("name"); + name = Trim (name); + CheckName (name); - name = name.Trim (); - if (!IsHeaderName (name)) - throw new ArgumentException ("Invalid characters in header."); + HttpHeaderInfo info; + if (TryGetHeaderInfo (name, out info)) + CheckState (info); - if (internallyCreated && IsRestricted (name)) - throw new ArgumentException ("Restricted header."); - - base.Remove (name); + RemoveWithoutCheckingName (name); } /// @@ -904,11 +1127,28 @@ namespace WebSocketSharp.Net { /// /// A that contains the value of the header to set. /// + /// + /// The current instance does not allow any of values. + /// + /// + /// + /// is a restricted header. + /// + /// + /// -or- + /// + /// + /// contains invalid characters. + /// + /// + /// + /// The length of is greater than 65535. + /// public void Set (HttpRequestHeader header, string value) { - // TODO: Support to throw InvalidOperationException. - - Set (RequestHeaderToString (header), value); + CheckState (false); + SetWithoutCheckingName (Convert (header), value); + SetState (false); } /// @@ -920,11 +1160,28 @@ namespace WebSocketSharp.Net { /// /// A that contains the value of the header to set. /// + /// + /// The current instance does not allow any of values. + /// + /// + /// + /// is a restricted header. + /// + /// + /// -or- + /// + /// + /// contains invalid characters. + /// + /// + /// + /// The length of is greater than 65535. + /// public void Set (HttpResponseHeader header, string value) { - // TODO: Support to throw InvalidOperationException. - - Set (ResponseHeaderToString (header), value); + CheckState (true); + SetWithoutCheckingName (Convert (header), value); + SetState (true); } /// @@ -953,26 +1210,14 @@ namespace WebSocketSharp.Net { /// /// The length of is greater than 65535. /// + /// + /// The current instance does not allow the header . + /// public override void Set (string name, string value) { - if (name.IsNullOrEmpty ()) - throw new ArgumentNullException ("name"); - - name = name.Trim (); - if (!IsHeaderName (name)) - throw new ArgumentException ("Invalid header name."); - - if (internallyCreated && IsRestricted (name)) - throw new ArgumentException ("Restricted header."); - - value = Trim (value); - if (value.Length > 65535) - throw new ArgumentOutOfRangeException ("value", "The length must not be greater than 65535."); - - if (!IsHeaderValue (value)) - throw new ArgumentException ("Invalid header value."); - - base.Set (name, value); + name = Trim (name); + CheckName (name); + DoWithCheckingState (SetWithoutCheckingName, name, value); } /// @@ -995,13 +1240,11 @@ namespace WebSocketSharp.Net { public override string ToString () { var sb = new StringBuilder(); - for (int i = 0; i < Count ; i++) - sb.Append (GetKey (i)) - .Append (": ") - .Append (Get (i)) - .Append ("\r\n"); + Count.Times (i => { + sb.AppendFormat ("{0}: {1}\r\n", GetKey (i), Get (i)); + }); - return sb.Append("\r\n").ToString(); + return sb.Append ("\r\n").ToString (); } #endregion diff --git a/websocket-sharp/RequestHandshake.cs b/websocket-sharp/RequestHandshake.cs index 3e394b33..b9b2c68a 100644 --- a/websocket-sharp/RequestHandshake.cs +++ b/websocket-sharp/RequestHandshake.cs @@ -148,7 +148,7 @@ namespace WebSocketSharp { var headers = new WebHeaderCollection(); for (int i = 1; i < request.Length; i++) - headers.Add(request[i]); + headers.SetInternal (request[i], false); return new RequestHandshake { Headers = headers, diff --git a/websocket-sharp/ResponseHandshake.cs b/websocket-sharp/ResponseHandshake.cs index b2bc1ee9..2c2e0a1d 100644 --- a/websocket-sharp/ResponseHandshake.cs +++ b/websocket-sharp/ResponseHandshake.cs @@ -96,7 +96,7 @@ namespace WebSocketSharp { var headers = new WebHeaderCollection(); for (int i = 1; i < response.Length; i++) - headers.Add(response[i]); + headers.SetInternal (response[i], true); return new ResponseHandshake { Headers = headers, diff --git a/websocket-sharp/bin/Debug/websocket-sharp.dll b/websocket-sharp/bin/Debug/websocket-sharp.dll index 4434ab51..666378fb 100755 Binary files a/websocket-sharp/bin/Debug/websocket-sharp.dll and b/websocket-sharp/bin/Debug/websocket-sharp.dll differ diff --git a/websocket-sharp/bin/Debug/websocket-sharp.dll.mdb b/websocket-sharp/bin/Debug/websocket-sharp.dll.mdb index e075586b..7da189e8 100644 Binary files a/websocket-sharp/bin/Debug/websocket-sharp.dll.mdb and b/websocket-sharp/bin/Debug/websocket-sharp.dll.mdb differ diff --git a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll index f624d82a..50cf103d 100755 Binary files a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll and b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb index 63eb8ac7..a0464ecb 100644 Binary files a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb and b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll.mdb differ diff --git a/websocket-sharp/bin/Release/websocket-sharp.dll b/websocket-sharp/bin/Release/websocket-sharp.dll index 12429829..f1007de6 100755 Binary files a/websocket-sharp/bin/Release/websocket-sharp.dll and b/websocket-sharp/bin/Release/websocket-sharp.dll differ diff --git a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.dll b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.dll index ef94d7e5..4e8a4675 100755 Binary files a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.dll and b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.dll differ diff --git a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml index 597eb293..7e8a20c3 100644 --- a/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml +++ b/websocket-sharp/bin/Release_Ubuntu/websocket-sharp.xml @@ -462,10 +462,10 @@ Executes the specified delegate times. - An that contains the number of times to execute. + An is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. @@ -473,10 +473,10 @@ Executes the specified delegate times. - A that contains the number of times to execute. + A is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. @@ -484,10 +484,10 @@ Executes the specified delegate times. - A that contains the number of times to execute. + A is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. @@ -495,46 +495,46 @@ Executes the specified delegate times. - A that contains the number of times to execute. + A is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. - + - Executes the specified Action<ulong> delegate times. + Executes the specified Action<int> delegate times. - An that contains the number of times to execute. + An is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<int> delegate that references the method(s) to execute. + An parameter to pass to the method(s) is the zero-based count of iteration. - + - Executes the specified Action<ulong> delegate times. + Executes the specified Action<long> delegate times. - A that contains the number of times to execute. + A is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<long> delegate that references the method(s) to execute. + A parameter to pass to the method(s) is the zero-based count of iteration. - + - Executes the specified Action<ulong> delegate times. + Executes the specified Action<uint> delegate times. - A that contains the number of times to execute. + A is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<uint> delegate that references the method(s) to execute. + A parameter to pass to the method(s) is the zero-based count of iteration. @@ -542,11 +542,11 @@ Executes the specified Action<ulong> delegate times. - A that contains the number of times to execute. + A is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<ulong> delegate that references the method(s) to execute. + A parameter to pass to this method(s) is the zero-based count of iteration. @@ -2965,11 +2965,17 @@ with the specified and . - A that holds the serialized object data. + A that contains the data to need to serialize the object. - A that contains the contextual information about the source or destination. + A that contains the source of the serialized stream associated with the new . + + is . + + + An element with the specified name is not found in . + @@ -2984,8 +2990,25 @@ A that contains the value of the specified request . - A that contains a request header name. + A that indicates a request header. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. + @@ -2995,8 +3018,25 @@ A that contains the value of the specified response . - A that contains a response header name. + A that indicates a response header. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. + @@ -3024,14 +3064,18 @@ - Populates the specified with the data needed to serialize the . + Populates the specified with the data to need to + serialize the object. - A that holds the serialized object data. + A that holds the data to need to serialize the object. A that specifies the destination for the serialization. + + is . + @@ -3043,17 +3087,17 @@ A that contains the value of the header to add. + + is or . + - - is , , or - contains invalid characters. - - - -or- - - - contains invalid characters. - + or contains invalid characters. + + + The length of is greater than 65535. + + + The current instance does not allow the . @@ -3064,10 +3108,31 @@ A that contains a header with the name and value separated by a colon (:). - is or a . + is , , or + the name part of is . - does not contain a colon. + + does not contain a colon. + + + -or- + + + is a restricted header. + + + -or- + + + The name or value part of contains invalid characters. + + + + The length of the value part of is greater than 65535. + + + The current instance does not allow the . @@ -3075,22 +3140,56 @@ Adds the specified request with the specified to the collection. - A that contains the name of the request header to add. + A is a request header to add. A that contains the value of the header to add. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. + Adds the specified response with the specified to the collection. - A that contains the name of the response header to add. + A is a response header to add. A that contains the value of the header to add. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. + @@ -3102,23 +3201,26 @@ A that contains the value of the header to add. + + is or . + - is or a . + or contains invalid characters. -or- - is a restricted header that must be set with a property setting. - - - -or- + is a restricted header name. The length of is greater than 65535. + + The current instance does not allow the header . + @@ -3192,14 +3294,18 @@ - Populates the specified with the data needed to serialize the . + Populates the specified with the data to need to + serialize the object. - A that holds the serialized object data. + A that holds the data to need to serialize the object. A that specifies the destination for the serialization. + + is . + @@ -3254,6 +3360,12 @@ A to remove from the collection. + + The current instance does not allow any of values. + + + is a restricted header. + @@ -3262,6 +3374,12 @@ A to remove from the collection. + + The current instance does not allow any of values. + + + is a restricted header. + @@ -3284,6 +3402,9 @@ is a restricted header name. + + The current instance does not allow the header . + @@ -3295,6 +3416,23 @@ A that contains the value of the header to set. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. + @@ -3306,6 +3444,23 @@ A that contains the value of the header to set. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. + @@ -3334,6 +3489,9 @@ The length of is greater than 65535. + + The current instance does not allow the header . + diff --git a/websocket-sharp/doc/html/WebSocketSharp.Net/WebHeaderCollection.html b/websocket-sharp/doc/html/WebSocketSharp.Net/WebHeaderCollection.html index 636299f6..5b49fec2 100644 --- a/websocket-sharp/doc/html/WebSocketSharp.Net/WebHeaderCollection.html +++ b/websocket-sharp/doc/html/WebSocketSharp.Net/WebHeaderCollection.html @@ -472,7 +472,8 @@ GetObjectData (System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
- Populates the specified System.Runtime.Serialization.SerializationInfo with the data needed to serialize the WebSocketSharp.Net.WebHeaderCollection. + Populates the specified System.Runtime.Serialization.SerializationInfo with the data to need to + serialize the WebSocketSharp.Net.WebHeaderCollection object.
@@ -661,7 +662,8 @@ - Populates the specified System.Runtime.Serialization.SerializationInfo with the data needed to serialize the WebSocketSharp.Net.WebHeaderCollection. + Populates the specified System.Runtime.Serialization.SerializationInfo with the data to need to + serialize the WebSocketSharp.Net.WebHeaderCollection object. @@ -755,16 +757,41 @@ serializationInfo
- A System.Runtime.Serialization.SerializationInfo that holds the serialized object data. + A System.Runtime.Serialization.SerializationInfo that contains the data to need to serialize the WebSocketSharp.Net.WebHeaderCollection object.
streamingContext
- A System.Runtime.Serialization.StreamingContext that contains the contextual information about the source or destination. + A System.Runtime.Serialization.StreamingContext that contains the source of the serialized stream associated with the new WebSocketSharp.Net.WebHeaderCollection.
+

Exceptions

+
+ + + + + + + + + + + + + +
TypeReason
+ ArgumentNullException + + serializationInfo is null. +
+ ArgumentException + + An element with the specified name is not found in serializationInfo. +
+

Remarks

Documentation for this section has not yet been entered. @@ -804,7 +831,8 @@ ArgumentNullException - header is null or a string.Empty. + header is null, string.Empty, or + the name part of header is string.Empty. @@ -812,7 +840,37 @@ ArgumentException - header does not contain a colon. +

+ header does not contain a colon. +

+

+ -or- +

+

+ header is a restricted header. +

+

+ -or- +

+

+ The name or value part of header contains invalid characters. +

+ + + + + ArgumentOutOfRangeException + + + The length of the value part of header is greater than 65535. + + + + + InvalidOperationException + + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow the header. @@ -840,7 +898,7 @@ header
- A System.Net.HttpRequestHeader that contains the name of the request header to add. + A System.Net.HttpRequestHeader is a request header to add.
value @@ -850,6 +908,47 @@ +

Exceptions

+
+ + + + + + + + + + + + + + + + + +
TypeReason
+ ArgumentOutOfRangeException + + The length of value is greater than 65535. +
+ InvalidOperationException + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow any of System.Net.HttpRequestHeader values. +
+ ArgumentException + +

+ header is a restricted header. +

+

+ -or- +

+

+ value contains invalid characters. +

+
+

Remarks

Documentation for this section has not yet been entered. @@ -873,7 +972,7 @@ header
- A System.Net.HttpResponseHeader that contains the name of the response header to add. + A System.Net.HttpResponseHeader is a response header to add.
value @@ -883,6 +982,47 @@ +

Exceptions

+
+ + + + + + + + + + + + + + + + + +
TypeReason
+ ArgumentOutOfRangeException + + The length of value is greater than 65535. +
+ InvalidOperationException + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow any of System.Net.HttpResponseHeader values. +
+ ArgumentException + +

+ header is a restricted header. +

+

+ -or- +

+

+ value contains invalid characters. +

+
+

Remarks

Documentation for this section has not yet been entered. @@ -929,16 +1069,13 @@

- name is null or a string.Empty. + name or value contains invalid characters.

-or-

- name is a restricted header that must be set with a property setting. -

-

- -or- + name is a restricted header name.

@@ -948,6 +1085,22 @@ The length of value is greater than 65535. + + + + + ArgumentNullException + + + name is null or string.Empty. + + + + + InvalidOperationException + + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow the header name. @@ -997,17 +1150,32 @@ ArgumentException -

- headerName is null, string.Empty, or - contains invalid characters. -

-

- -or- -

-

- headerValue contains invalid characters. -

+ headerName or headerValue contains invalid characters. + + + + + ArgumentNullException + + headerName is null or string.Empty. + + + + + ArgumentOutOfRangeException + + + The length of headerValue is greater than 65535. + + + + + InvalidOperationException + + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow the headerName. + @@ -1194,7 +1362,8 @@

GetObjectData Method

- Populates the specified System.Runtime.Serialization.SerializationInfo with the data needed to serialize the WebSocketSharp.Net.WebHeaderCollection. + Populates the specified System.Runtime.Serialization.SerializationInfo with the data to need to + serialize the WebSocketSharp.Net.WebHeaderCollection object.

Syntax

public override void GetObjectData (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext)
@@ -1205,7 +1374,7 @@ serializationInfo
- A System.Runtime.Serialization.SerializationInfo that holds the serialized object data. + A System.Runtime.Serialization.SerializationInfo that holds the data to need to serialize the WebSocketSharp.Net.WebHeaderCollection object.
streamingContext @@ -1215,6 +1384,23 @@ +

Exceptions

+
+ + + + + + + + + +
TypeReason
+ ArgumentNullException + + serializationInfo is null. +
+

Remarks

Documentation for this section has not yet been entered. @@ -1421,7 +1607,7 @@ header
- A System.Net.HttpRequestHeader that contains a request header name. + A System.Net.HttpRequestHeader that indicates a request header.
@@ -1429,6 +1615,47 @@
A string that contains the value of the specified request header.
+

Exceptions

+
+ + + + + + + + + + + + + + + + + +
TypeReason
+ InvalidOperationException + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow any of System.Net.HttpRequestHeader values. +
+ ArgumentException + +

+ header is a restricted header. +

+

+ -or- +

+

+ value contains invalid characters. +

+
+ ArgumentOutOfRangeException + + The length of value is greater than 65535. +
+

Remarks

Documentation for this section has not yet been entered. @@ -1455,7 +1682,7 @@ header
- A System.Net.HttpResponseHeader that contains a response header name. + A System.Net.HttpResponseHeader that indicates a response header.
@@ -1463,6 +1690,47 @@
A string that contains the value of the specified response header.
+

Exceptions

+
+ + + + + + + + + + + + + + + + + +
TypeReason
+ InvalidOperationException + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow any of System.Net.HttpResponseHeader values. +
+ ArgumentException + +

+ header is a restricted header. +

+

+ -or- +

+

+ value contains invalid characters. +

+
+ ArgumentOutOfRangeException + + The length of value is greater than 65535. +
+

Remarks

Documentation for this section has not yet been entered. @@ -1538,6 +1806,31 @@ +

Exceptions

+
+ + + + + + + + + + + + + +
TypeReason
+ InvalidOperationException + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow any of System.Net.HttpRequestHeader values. +
+ ArgumentException + + header is a restricted header. +
+

Remarks

Documentation for this section has not yet been entered. @@ -1565,6 +1858,31 @@ +

Exceptions

+
+ + + + + + + + + + + + + +
TypeReason
+ InvalidOperationException + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow any of System.Net.HttpResponseHeader values. +
+ ArgumentException + + header is a restricted header. +
+

Remarks

Documentation for this section has not yet been entered. @@ -1623,6 +1941,14 @@

+ + + InvalidOperationException + + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow the header name. + +

Remarks

@@ -1658,6 +1984,47 @@ +

Exceptions

+
+ + + + + + + + + + + + + + + + + +
TypeReason
+ InvalidOperationException + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow any of System.Net.HttpRequestHeader values. +
+ ArgumentException + +

+ header is a restricted header. +

+

+ -or- +

+

+ value contains invalid characters. +

+
+ ArgumentOutOfRangeException + + The length of value is greater than 65535. +
+

Remarks

Documentation for this section has not yet been entered. @@ -1691,6 +2058,47 @@ +

Exceptions

+
+ + + + + + + + + + + + + + + + + +
TypeReason
+ InvalidOperationException + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow any of System.Net.HttpResponseHeader values. +
+ ArgumentException + +

+ header is a restricted header. +

+

+ -or- +

+

+ value contains invalid characters. +

+
+ ArgumentOutOfRangeException + + The length of value is greater than 65535. +
+

Remarks

Documentation for this section has not yet been entered. @@ -1761,6 +2169,14 @@ The length of value is greater than 65535. + + + + + InvalidOperationException + + + The current WebSocketSharp.Net.WebHeaderCollection instance does not allow the header name. @@ -1777,7 +2193,8 @@

System.Runtime.Serialization.ISerializable.GetObjectData Method

- Populates the specified System.Runtime.Serialization.SerializationInfo with the data needed to serialize the WebSocketSharp.Net.WebHeaderCollection. + Populates the specified System.Runtime.Serialization.SerializationInfo with the data to need to + serialize the WebSocketSharp.Net.WebHeaderCollection object.

Syntax

@@ -1789,7 +2206,7 @@ serializationInfo
- A System.Runtime.Serialization.SerializationInfo that holds the serialized object data. + A System.Runtime.Serialization.SerializationInfo that holds the data to need to serialize the WebSocketSharp.Net.WebHeaderCollection object.
streamingContext @@ -1799,6 +2216,23 @@
+

Exceptions

+
+ + + + + + + + + +
TypeReason
+ ArgumentNullException + + serializationInfo is null. +
+

Remarks

Documentation for this section has not yet been entered. diff --git a/websocket-sharp/doc/html/WebSocketSharp/Ext.html b/websocket-sharp/doc/html/WebSocketSharp/Ext.html index 58cadb53..398dfbe9 100644 --- a/websocket-sharp/doc/html/WebSocketSharp/Ext.html +++ b/websocket-sharp/doc/html/WebSocketSharp/Ext.html @@ -582,9 +582,9 @@ - Times - (this int, Action<ulong>)
- Executes the specified Action<ulong> delegate n times. + Times + (this int, Action<int>)
+ Executes the specified Action<int> delegate n times.
@@ -604,9 +604,9 @@ - Times - (this long, Action<ulong>)
- Executes the specified Action<ulong> delegate n times. + Times + (this long, Action<long>)
+ Executes the specified Action<long> delegate n times.
@@ -626,9 +626,9 @@ - Times - (this uint, Action<ulong>)
- Executes the specified Action<ulong> delegate n times. + Times + (this uint, Action<uint>)
+ Executes the specified Action<uint> delegate n times.
@@ -2011,13 +2011,13 @@ n
- An int that contains the number of times to execute. + An int is the number of times to execute.
act
- An Action delegate that contains the method(s) to execute. + An Action delegate that references the method(s) to execute.
@@ -2030,37 +2030,37 @@ Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

-

Times Method

-
+

Times Method

+

- Executes the specified Action<ulong> delegate n times. + Executes the specified Action<int> delegate n times.

Syntax

-
public static void Times (this int n, Action<ulong> act)
+
public static void Times (this int n, Action<int> act)

Parameters

-
+
n
- An int that contains the number of times to execute. + An int is the number of times to execute.
act
- An Action<ulong> delegate that contains the method(s) to execute. - A ulong parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<int> delegate that references the method(s) to execute. + An int parameter to pass to the method(s) is the zero-based count of iteration.

Remarks

-
+
Documentation for this section has not yet been entered.

Requirements

-
+
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

@@ -2078,13 +2078,13 @@ n
- A long that contains the number of times to execute. + A long is the number of times to execute.
act
- An Action delegate that contains the method(s) to execute. + An Action delegate that references the method(s) to execute.
@@ -2097,37 +2097,37 @@ Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

-

Times Method

-
+

Times Method

+

- Executes the specified Action<ulong> delegate n times. + Executes the specified Action<long> delegate n times.

Syntax

-
public static void Times (this long n, Action<ulong> act)
+
public static void Times (this long n, Action<long> act)

Parameters

-
+
n
- A long that contains the number of times to execute. + A long is the number of times to execute.
act
- An Action<ulong> delegate that contains the method(s) to execute. - A ulong parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<long> delegate that references the method(s) to execute. + A long parameter to pass to the method(s) is the zero-based count of iteration.

Remarks

-
+
Documentation for this section has not yet been entered.

Requirements

-
+
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

@@ -2145,13 +2145,13 @@ n
- A uint that contains the number of times to execute. + A uint is the number of times to execute.
act
- An Action delegate that contains the method(s) to execute. + An Action delegate that references the method(s) to execute.
@@ -2164,37 +2164,37 @@ Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

-

Times Method

-
+

Times Method

+

- Executes the specified Action<ulong> delegate n times. + Executes the specified Action<uint> delegate n times.

Syntax

-
public static void Times (this uint n, Action<ulong> act)
+
public static void Times (this uint n, Action<uint> act)

Parameters

-
+
n
- A uint that contains the number of times to execute. + A uint is the number of times to execute.
act
- An Action<ulong> delegate that contains the method(s) to execute. - A ulong parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<uint> delegate that references the method(s) to execute. + A uint parameter to pass to the method(s) is the zero-based count of iteration.

Remarks

-
+
Documentation for this section has not yet been entered.

Requirements

-
+
Namespace: WebSocketSharp
Assembly: websocket-sharp (in websocket-sharp.dll)

@@ -2212,13 +2212,13 @@ n
- A ulong that contains the number of times to execute. + A ulong is the number of times to execute.
act
- An Action delegate that contains the method(s) to execute. + An Action delegate that references the method(s) to execute.
@@ -2245,14 +2245,14 @@ n
- A ulong that contains the number of times to execute. + A ulong is the number of times to execute.
act
- An Action<ulong> delegate that contains the method(s) to execute. - A ulong parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<ulong> delegate that references the method(s) to execute. + A ulong parameter to pass to this method(s) is the zero-based count of iteration.
diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp.Net/WebHeaderCollection.xml b/websocket-sharp/doc/mdoc/WebSocketSharp.Net/WebHeaderCollection.xml index f1c79fca..8bc83e58 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp.Net/WebHeaderCollection.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp.Net/WebHeaderCollection.xml @@ -46,16 +46,22 @@ - A that holds the serialized object data. + A that contains the data to need to serialize the object. - A that contains the contextual information about the source or destination. + A that contains the source of the serialized stream associated with the new . Initializes a new instance of the class with the specified and . To be added. + + is . + + + An element with the specified name is not found in . + @@ -77,10 +83,31 @@
To be added. - is or a . + is , , or + the name part of is . - does not contain a colon. + + does not contain a colon. + + + -or- + + + is a restricted header. + + + -or- + + + The name or value part of contains invalid characters. + + + + The length of the value part of is greater than 65535. + + + The current instance does not allow the .
@@ -97,7 +124,7 @@ - A that contains the name of the request header to add. + A is a request header to add. A that contains the value of the header to add. @@ -106,6 +133,23 @@ Adds the specified request with the specified to the collection.
To be added. + + The length of is greater than 65535. + + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + +
@@ -121,7 +165,7 @@ - A that contains the name of the response header to add. + A is a response header to add. A that contains the value of the header to add. @@ -130,6 +174,23 @@ Adds the specified response with the specified to the collection.
To be added. + + The length of is greater than 65535. + + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + +
@@ -156,21 +217,24 @@ To be added. - is or a . + or contains invalid characters. -or- - is a restricted header that must be set with a property setting. - - - -or- + is a restricted header name. The length of is greater than 65535. + + is or . + + + The current instance does not allow the header . + @@ -196,17 +260,17 @@
To be added. - - is , , or - contains invalid characters. - - - -or- - - - contains invalid characters. - - + or contains invalid characters. + + + is or . + + + The length of is greater than 65535. + + + The current instance does not allow the . +
@@ -360,15 +424,19 @@ - A that holds the serialized object data. + A that holds the data to need to serialize the object. A that specifies the destination for the serialization. - Populates the specified with the data needed to serialize the . + Populates the specified with the data to need to + serialize the object. To be added. + + is . + @@ -491,7 +559,7 @@ - A that contains a request header name. + A that indicates a request header. Gets or sets the specified request in the collection. @@ -500,6 +568,23 @@ A that contains the value of the specified request . To be added. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. + @@ -514,7 +599,7 @@ - A that contains a response header name. + A that indicates a response header. Gets or sets the specified response in the collection. @@ -523,6 +608,23 @@ A that contains the value of the specified response . To be added. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. + @@ -581,6 +683,12 @@ Removes the specified header from the collection. To be added. + + The current instance does not allow any of values. + + + is a restricted header. + @@ -601,6 +709,12 @@ Removes the specified header from the collection. To be added. + + The current instance does not allow any of values. + + + is a restricted header. + @@ -635,6 +749,9 @@ is a restricted header name. + + The current instance does not allow the header . + @@ -659,6 +776,23 @@ Sets the specified header to the specified value.
To be added. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. +
@@ -683,6 +817,23 @@ Sets the specified header to the specified value.
To be added. + + The current instance does not allow any of values. + + + + is a restricted header. + + + -or- + + + contains invalid characters. + + + + The length of is greater than 65535. +
@@ -724,6 +875,9 @@ The length of is greater than 65535. + + The current instance does not allow the header . + @@ -739,15 +893,19 @@ - A that holds the serialized object data. + A that holds the data to need to serialize the object. A that specifies the destination for the serialization. - Populates the specified with the data needed to serialize the . + Populates the specified with the data to need to + serialize the object. To be added. + + is . + diff --git a/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml b/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml index fbbad4eb..2e6395b0 100644 --- a/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml +++ b/websocket-sharp/doc/mdoc/WebSocketSharp/Ext.xml @@ -894,10 +894,10 @@ - An that contains the number of times to execute. + An is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. Executes the specified delegate times. @@ -906,26 +906,26 @@ - - + + Method System.Void - + - An that contains the number of times to execute. + An is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<int> delegate that references the method(s) to execute. + An parameter to pass to the method(s) is the zero-based count of iteration. - Executes the specified Action<ulong> delegate times. + Executes the specified Action<int> delegate times. To be added. @@ -943,10 +943,10 @@ - A that contains the number of times to execute. + A is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. Executes the specified delegate times. @@ -955,26 +955,26 @@ - - + + Method System.Void - + - A that contains the number of times to execute. + A is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<long> delegate that references the method(s) to execute. + A parameter to pass to the method(s) is the zero-based count of iteration. - Executes the specified Action<ulong> delegate times. + Executes the specified Action<long> delegate times. To be added. @@ -992,10 +992,10 @@ - A that contains the number of times to execute. + A is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. Executes the specified delegate times. @@ -1004,26 +1004,26 @@ - - + + Method System.Void - + - A that contains the number of times to execute. + A is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<uint> delegate that references the method(s) to execute. + A parameter to pass to the method(s) is the zero-based count of iteration. - Executes the specified Action<ulong> delegate times. + Executes the specified Action<uint> delegate times. To be added. @@ -1041,10 +1041,10 @@ - A that contains the number of times to execute. + A is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. Executes the specified delegate times. @@ -1065,11 +1065,11 @@ - A that contains the number of times to execute. + A is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<ulong> delegate that references the method(s) to execute. + A parameter to pass to this method(s) is the zero-based count of iteration. Executes the specified Action<ulong> delegate times. diff --git a/websocket-sharp/doc/mdoc/index.xml b/websocket-sharp/doc/mdoc/index.xml index e1c2c511..33c871bc 100644 --- a/websocket-sharp/doc/mdoc/index.xml +++ b/websocket-sharp/doc/mdoc/index.xml @@ -1,6 +1,6 @@ - + [00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 11 00 00 00 29 17 fb 89 fe c3 91 f7 2b cb 8b e2 61 d2 3f 05 93 6d 65 a8 9e 63 72 a6 f5 d5 2c f2 9d 20 fa 0b c0 70 6a f6 88 7e 8b 90 3f 39 f5 76 c8 48 e0 bb 7b b2 7b ed d3 10 a7 1a 0f 70 98 0f 7f f4 4b 53 09 d2 a5 ef 36 c3 56 b4 aa f0 91 72 63 25 07 89 e0 93 3e 3f 2e f2 b9 73 0e 12 15 5d 43 56 c3 f4 70 a5 89 fe f7 f6 ac 3e 77 c2 d8 d0 84 91 f4 0c d1 f3 8e dc c3 c3 b8 38 3d 0c bf 17 de 20 78 c1 ] @@ -1004,10 +1004,10 @@ - An that contains the number of times to execute. + An is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. Executes the specified delegate times. @@ -1021,29 +1021,29 @@ - - + + ExtensionMethod System.Void - + - An that contains the number of times to execute. + An is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<int> delegate that references the method(s) to execute. + An parameter to pass to the method(s) is the zero-based count of iteration. - Executes the specified Action<ulong> delegate times. + Executes the specified Action<int> delegate times. - + @@ -1063,10 +1063,10 @@ - A that contains the number of times to execute. + A is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. Executes the specified delegate times. @@ -1080,29 +1080,29 @@ - - + + ExtensionMethod System.Void - + - A that contains the number of times to execute. + A is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<long> delegate that references the method(s) to execute. + A parameter to pass to the method(s) is the zero-based count of iteration. - Executes the specified Action<ulong> delegate times. + Executes the specified Action<long> delegate times. - + @@ -1122,10 +1122,10 @@ - A that contains the number of times to execute. + A is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. Executes the specified delegate times. @@ -1139,29 +1139,29 @@ - - + + ExtensionMethod System.Void - + - A that contains the number of times to execute. + A is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<uint> delegate that references the method(s) to execute. + A parameter to pass to the method(s) is the zero-based count of iteration. - Executes the specified Action<ulong> delegate times. + Executes the specified Action<uint> delegate times. - + @@ -1181,10 +1181,10 @@ - A that contains the number of times to execute. + A is the number of times to execute. - An delegate that contains the method(s) to execute. + An delegate that references the method(s) to execute. Executes the specified delegate times. @@ -1210,11 +1210,11 @@ - A that contains the number of times to execute. + A is the number of times to execute. - An Action<ulong> delegate that contains the method(s) to execute. - A parameter to pass to this method(s) contains the zero-based count of iteration. + An Action<ulong> delegate that references the method(s) to execute. + A parameter to pass to this method(s) is the zero-based count of iteration. Executes the specified Action<ulong> delegate times. diff --git a/websocket-sharp/websocket-sharp.csproj b/websocket-sharp/websocket-sharp.csproj index e8db03fd..31be87e7 100644 --- a/websocket-sharp/websocket-sharp.csproj +++ b/websocket-sharp/websocket-sharp.csproj @@ -120,6 +120,8 @@ + + diff --git a/websocket-sharp/websocket-sharp.pidb b/websocket-sharp/websocket-sharp.pidb index 48ac9369..cde0d606 100644 Binary files a/websocket-sharp/websocket-sharp.pidb and b/websocket-sharp/websocket-sharp.pidb differ